@@ -135,7 +135,7 @@ MySQL_Prepared_ResultSet::absolute(const int new_pos)
135
135
return true ;
136
136
}
137
137
} else if (new_pos < 0 ) {
138
- if ((-new_pos) > (int ) num_rows || (new_pos == std::numeric_limits<int >::min ())) {
138
+ if ((-new_pos) > (int ) num_rows || (new_pos == std::numeric_limits<int >::min ())) {
139
139
row_position = 0 ; /* before first new_pos */
140
140
} else {
141
141
row_position = num_rows - (-new_pos) + 1 ;
@@ -211,6 +211,8 @@ MySQL_Prepared_ResultSet::checkScrollable() const
211
211
if (resultset_type == sql::ResultSet::TYPE_FORWARD_ONLY) {
212
212
throw sql::NonScrollableException (" Nonscrollable result set" );
213
213
}
214
+ // reset last_queried_column
215
+ last_queried_column = -1 ;
214
216
}
215
217
/* }}} */
216
218
@@ -963,13 +965,13 @@ MySQL_Prepared_ResultSet::getString(const uint32_t columnIndex) const
963
965
{
964
966
char buf[28 ];
965
967
MYSQL_TIME * t = static_cast <MYSQL_TIME *>(result_bind->rbind [columnIndex - 1 ].buffer );
966
- if (t->second_part ) {
967
- snprintf (buf, sizeof (buf) - 1 , " %04d-%02d-%02d %02d:%02d:%02d.%06lu" ,
968
- t->year , t->month , t->day , t->hour , t->minute , t->second , t->second_part );
969
- } else {
970
- snprintf (buf, sizeof (buf) - 1 , " %04d-%02d-%02d %02d:%02d:%02d" ,
971
- t->year , t->month , t->day , t->hour , t->minute , t->second );
972
- }
968
+ if (t->second_part ) {
969
+ snprintf (buf, sizeof (buf) - 1 , " %04d-%02d-%02d %02d:%02d:%02d.%06lu" ,
970
+ t->year , t->month , t->day , t->hour , t->minute , t->second , t->second_part );
971
+ } else {
972
+ snprintf (buf, sizeof (buf) - 1 , " %04d-%02d-%02d %02d:%02d:%02d" ,
973
+ t->year , t->month , t->day , t->hour , t->minute , t->second );
974
+ }
973
975
CPP_INFO_FMT (" It's a datetime/timestamp %s" , buf);
974
976
return sql::SQLString (buf);
975
977
}
@@ -985,11 +987,11 @@ MySQL_Prepared_ResultSet::getString(const uint32_t columnIndex) const
985
987
{
986
988
char buf[18 ];
987
989
MYSQL_TIME * t = static_cast <MYSQL_TIME *>(result_bind->rbind [columnIndex - 1 ].buffer );
988
- if (t->second_part ) {
989
- snprintf (buf, sizeof (buf), " %s%02d:%02d:%02d.%06lu" , t->neg ? " -" :" " , t->hour , t->minute , t->second , t->second_part );
990
- } else {
991
- snprintf (buf, sizeof (buf), " %s%02d:%02d:%02d" , t->neg ? " -" :" " , t->hour , t->minute , t->second );
992
- }
990
+ if (t->second_part ) {
991
+ snprintf (buf, sizeof (buf), " %s%02d:%02d:%02d.%06lu" , t->neg ? " -" :" " , t->hour , t->minute , t->second , t->second_part );
992
+ } else {
993
+ snprintf (buf, sizeof (buf), " %s%02d:%02d:%02d" , t->neg ? " -" :" " , t->hour , t->minute , t->second );
994
+ }
993
995
CPP_INFO_FMT (" It's a time %s" , buf);
994
996
return sql::SQLString (buf);
995
997
}
0 commit comments