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
1335
1335
assert (rows[1 ].getName(0 ) == " another" );
1336
1336
assert (rows[1 ].getName(1 ) == " someValue" );
1337
1337
}
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 663
663
if (binary && _nulls[i])
664
664
{
665
665
_values[i] = null ;
666
+ _names[i] = rh[i].name;
666
667
continue ;
667
668
}
668
669
You can’t perform that action at this time.
0 commit comments