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)
256256 $ u = unpack ('v ' , $ this ->read (2 ));
257257 $ field ['charset ' ] = $ u [1 ];
258258
259- $ u = unpack ('v ' , $ this ->read (4 ));
259+ $ u = unpack ('V ' , $ this ->read (4 ));
260260 $ field ['length ' ] = $ u [1 ];
261261
262262 $ field ['type ' ] = ord ($ this ->read (1 ));
Original file line number Diff line number Diff line change @@ -61,6 +61,26 @@ public function testSelectStaticTextWithQuestionMark()
6161 $ loop ->run ();
6262 }
6363
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+
6484 public function testSimpleSelect ()
6585 {
6686 $ loop = \React \EventLoop \Factory::create ();
You can’t perform that action at this time.
0 commit comments