[fix](sample)(cpp) fix the condition of breaking for loop in function (#8497)

This commit is contained in:
BrightHewei
2022-03-18 09:37:48 +08:00
committed by GitHub
parent 25cdd0be1a
commit ac9acc8e9d

View File

@ -74,7 +74,7 @@ bool DorisClient::exec(const string& sql) {
std::cout << "Query result:" << std::endl;
for (int i = 0; i < num_rows; i++) {
_row = mysql_fetch_row(_result);
if (_row < 0) {
if (_row == nullptr) {
break;
}
for (int j = 0; j < num_fields; j++) {