... | ... |
@@ -1231,6 +1231,12 @@ int my_cmd_next(db_res_t* res) |
1231 | 1231 |
|
1232 | 1232 |
mcmd = DB_GET_PAYLOAD(res->cmd); |
1233 | 1233 |
if (mcmd->next_flag == 2 || mcmd->next_flag == -2) return 1; |
1234 |
+ |
|
1235 |
+ if (mcmd->st == NULL) { |
|
1236 |
+ ERR("mysql: Prepared statement not found\n"); |
|
1237 |
+ return -1; |
|
1238 |
+ } |
|
1239 |
+ |
|
1234 | 1240 |
ret = mysql_stmt_fetch(mcmd->st); |
1235 | 1241 |
|
1236 | 1242 |
if (ret == MYSQL_NO_DATA) { |