File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ public function parse($data)
256
256
$ u = unpack ('v ' , $ this ->read (2 ));
257
257
$ field ['charset ' ] = $ u [1 ];
258
258
259
- $ u = unpack ('v ' , $ this ->read (4 ));
259
+ $ u = unpack ('V ' , $ this ->read (4 ));
260
260
$ field ['length ' ] = $ u [1 ];
261
261
262
262
$ field ['type ' ] = ord ($ this ->read (1 ));
Original file line number Diff line number Diff line change @@ -61,6 +61,26 @@ public function testSelectStaticTextWithQuestionMark()
61
61
$ loop ->run ();
62
62
}
63
63
64
+ public function testSelectLongStaticTextWithProperType ()
65
+ {
66
+ $ loop = \React \EventLoop \Factory::create ();
67
+
68
+ $ connection = new \React \MySQL \Connection ($ loop , $ this ->getConnectionOptions ());
69
+ $ connection ->connect (function () {});
70
+
71
+ $ length = 40000 ;
72
+
73
+ $ connection ->query ('SELECT ? ' , function ($ command , $ conn ) use ($ length ) {
74
+ $ this ->assertEquals (false , $ command ->hasError ());
75
+ $ this ->assertCount (1 , $ command ->resultFields );
76
+ $ this ->assertEquals ($ length * 3 , $ command ->resultFields [0 ]['length ' ]);
77
+ $ this ->assertInstanceOf ('React\MySQL\Connection ' , $ conn );
78
+ }, str_repeat ('. ' , $ length ));
79
+
80
+ $ connection ->close ();
81
+ $ loop ->run ();
82
+ }
83
+
64
84
public function testSimpleSelect ()
65
85
{
66
86
$ loop = \React \EventLoop \Factory::create ();
You can’t perform that action at this time.
0 commit comments