Skip to content

Commit a4628a2

Browse files
committed
Fix broken assertion for rows read
We also can have rows read on an EOF packet. In fact, that's very common since the end of a SELECT query is always marked with an EOF, not with an OK packet. This would crash MySQL when building with assertions enabled (which isn't what we do on release builds, which is why this isn't blowing up in prod today).
1 parent 87805bf commit a4628a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sql/sql_error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class Diagnostics_area {
393393
}
394394

395395
ulonglong rows_read() const {
396-
assert(m_status == DA_OK);
396+
assert(m_status == DA_OK || m_status == DA_EOF);
397397
return m_rows_read;
398398
}
399399

0 commit comments

Comments
 (0)