Skip to content

Commit 72142ee

Browse files
committed
Correct 1 last_queried_column misplaced (was not before first return)
Correct identation problems
1 parent aafcb37 commit 72142ee

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

driver/mysql_resultset.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ MySQL_ResultSet::checkScrollable() const
162162
if (resultset_type == sql::ResultSet::TYPE_FORWARD_ONLY) {
163163
throw sql::NonScrollableException("Nonscrollable result set");
164164
}
165-
// reset last_queried_column
166-
last_queried_column = -1;
165+
// reset last_queried_column
166+
last_queried_column = -1;
167167
}
168168
/* }}} */
169169

@@ -354,7 +354,7 @@ MySQL_ResultSet::getDouble(const uint32_t columnIndex) const
354354
throw sql::InvalidArgumentException("MySQL_ResultSet::getDouble: invalid value of 'columnIndex'");
355355
}
356356

357-
last_queried_column = columnIndex;
357+
last_queried_column = columnIndex;
358358

359359
if (row[columnIndex - 1] == NULL) {
360360
was_null = true;
@@ -497,12 +497,13 @@ MySQL_ResultSet::getInt64(const uint32_t columnIndex) const
497497
throw sql::InvalidArgumentException("MySQL_ResultSet::getInt64: invalid value of 'columnIndex'");
498498
}
499499

500+
last_queried_column = columnIndex;
501+
500502
if (row[columnIndex - 1] == NULL) {
501503
was_null = true;
502504
return 0;
503505
}
504506

505-
last_queried_column = columnIndex;
506507

507508
CPP_INFO_FMT("%ssigned", (getFieldMeta(columnIndex)->flags & UNSIGNED_FLAG)? "un":"");
508509
was_null = false;
@@ -560,12 +561,13 @@ MySQL_ResultSet::getUInt64(const uint32_t columnIndex) const
560561
throw sql::InvalidArgumentException("MySQL_ResultSet::getUInt64: invalid value of 'columnIndex'");
561562
}
562563

564+
last_queried_column = columnIndex;
565+
563566
if (row[columnIndex - 1] == NULL) {
564567
was_null = true;
565568
return 0;
566569
}
567570

568-
last_queried_column = columnIndex;
569571

570572
CPP_INFO_FMT("%ssigned", (getFieldMeta(columnIndex)->flags & UNSIGNED_FLAG)? "un":"");
571573
was_null = false;
@@ -681,7 +683,7 @@ MySQL_ResultSet::getString(const uint32_t columnIndex) const
681683
throw sql::InvalidArgumentException("MySQL_ResultSet::getString: invalid value of 'columnIndex'");
682684
}
683685

684-
last_queried_column = columnIndex;
686+
last_queried_column = columnIndex;
685687

686688
if (row == NULL || row[columnIndex - 1] == NULL) {
687689
was_null = true;

0 commit comments

Comments
 (0)