File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
integration-tests/source/mysql Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1335,3 +1335,17 @@ unittest
13351335 assert (rows[1 ].getName(0 ) == " another" );
13361336 assert (rows[1 ].getName(1 ) == " someValue" );
13371337}
1338+
1339+ // issue 222, set column names when data is null.
1340+ @(" colNamesForBinary" )
1341+ debug (MYSQLN_TESTS )
1342+ unittest
1343+ {
1344+ import mysql.test.common;
1345+ import mysql.commands;
1346+ mixin (scopedCn);
1347+ // binary mode happens with prepared statements
1348+ auto row = cn.queryRow(" SELECT `colname` FROM (SELECT 1 AS `id`, NULL AS `colname`) as `tbl` WHERE `id` = ?" , 1 );
1349+ assert (row.get [0 ] == null );
1350+ assert (row.get .getName(0 ) == " colname" );
1351+ }
Original file line number Diff line number Diff line change 663663 if (binary && _nulls[i])
664664 {
665665 _values[i] = null ;
666+ _names[i] = rh[i].name;
666667 continue ;
667668 }
668669
You can’t perform that action at this time.
0 commit comments