@@ -101,7 +101,7 @@ MySQL_ResultSet::absolute(const int new_pos)
101
101
return true ;
102
102
}
103
103
} else if (new_pos < 0 ) {
104
- if ((-new_pos) > (int ) num_rows || (new_pos == std::numeric_limits<int >::min ())) {
104
+ if ((-new_pos) > (int ) num_rows || (new_pos == std::numeric_limits<int >::min ())) {
105
105
row_position = 0 ; /* before first new_pos */
106
106
} else {
107
107
row_position = num_rows - (-new_pos) + 1 ;
@@ -509,7 +509,7 @@ MySQL_ResultSet::getInt64(const uint32_t columnIndex) const
509
509
CPP_INFO_FMT (" %ssigned" , (getFieldMeta (columnIndex)->flags & UNSIGNED_FLAG)? " un" :" " );
510
510
was_null = false ;
511
511
if (getFieldMeta (columnIndex)->type == MYSQL_TYPE_BIT &&
512
- getFieldMeta (columnIndex)->flags != (BINARY_FLAG|UNSIGNED_FLAG)) {
512
+ getFieldMeta (columnIndex)->flags != (BINARY_FLAG|UNSIGNED_FLAG)) {
513
513
uint64_t uval = 0 ;
514
514
std::div_t length= std::div (getFieldMeta (columnIndex)->length , 8 );
515
515
if (length.rem ) {
@@ -573,7 +573,7 @@ MySQL_ResultSet::getUInt64(const uint32_t columnIndex) const
573
573
CPP_INFO_FMT (" %ssigned" , (getFieldMeta (columnIndex)->flags & UNSIGNED_FLAG)? " un" :" " );
574
574
was_null = false ;
575
575
if (getFieldMeta (columnIndex)->type == MYSQL_TYPE_BIT &&
576
- getFieldMeta (columnIndex)->flags != (BINARY_FLAG|UNSIGNED_FLAG)) {
576
+ getFieldMeta (columnIndex)->flags != (BINARY_FLAG|UNSIGNED_FLAG)) {
577
577
uint64_t uval = 0 ;
578
578
std::div_t length= std::div (getFieldMeta (columnIndex)->length , 8 );
579
579
if (length.rem ) {
@@ -907,6 +907,8 @@ MySQL_ResultSet::next()
907
907
ret = (row != NULL );
908
908
}
909
909
} else {
910
+ // reset last_queried_column
911
+ last_queried_column = -1 ;
910
912
row = result->fetch_row ();
911
913
boost::shared_ptr< NativeAPI::NativeConnectionWrapper > proxy_p = proxy.lock ();
912
914
if (!proxy_p) {
@@ -1059,7 +1061,7 @@ MySQL_ResultSet::wasNull() const
1059
1061
}
1060
1062
if (last_queried_column == -1 ) {
1061
1063
throw sql::InvalidArgumentException (" MySQL_ResultSet::wasNull: should be called only after one of the getter methods" );
1062
- }
1064
+ }
1063
1065
return was_null;
1064
1066
}
1065
1067
/* }}} */
0 commit comments