Browse code

- better check of the return value of mysql_stmt_result_metadata

Jan Janak authored on 16/01/2008 14:58:46
Showing 1 changed files
... ...
@@ -865,6 +865,8 @@ static int check_result_columns(db_cmd_t* cmd, struct my_cmd* payload)
865 865
 
866 866
 	meta = mysql_stmt_result_metadata(payload->st);
867 867
 	if (meta == NULL) {
868
+		/* No error means no result set to be checked */
869
+		if (mysql_stmt_errno(payload->st) == 0) return 0;
868 870
 		ERR("mysql: Error while getting metadata of SQL command: %d, %s\n",
869 871
 			mysql_stmt_errno(payload->st), mysql_stmt_error(payload->st));
870 872
 		return -1;