diff --git a/src/drivers/mysql/drv_mysql.c b/src/drivers/mysql/drv_mysql.c index f2f0afc56..1c7f8d7a5 100644 --- a/src/drivers/mysql/drv_mysql.c +++ b/src/drivers/mysql/drv_mysql.c @@ -969,8 +969,10 @@ int mysql_drv_fetch_row(db_result_t *rs, db_row_t *row) DEBUG("mysql_fetch_row(%p) = %p", rs->ptr, my_row); unsigned long *lengths = mysql_fetch_lengths(rs->ptr); + DEBUG("mysql_fetch_lengths(%p) = %p", rs->ptr, lengths); + if (lengths == NULL) - return DB_ERROR_NONE; + return DB_ERROR_IGNORABLE; for (size_t i = 0; i < rs->nfields; i++) { diff --git a/src/drivers/pgsql/drv_pgsql.c b/src/drivers/pgsql/drv_pgsql.c index f7fceea15..7c2ffe2f7 100644 --- a/src/drivers/pgsql/drv_pgsql.c +++ b/src/drivers/pgsql/drv_pgsql.c @@ -721,7 +721,7 @@ int pgsql_drv_fetch_row(db_result_t *rs, db_row_t *row) */ rownum = (intptr_t) row->ptr; if (rownum >= (int) rs->nrows) - return DB_ERROR_NONE; + return DB_ERROR_IGNORABLE; for (i = 0; i < (int) rs->nfields; i++) { diff --git a/tests/include/api_sql_common.sh b/tests/include/api_sql_common.sh index 3d9c0f8e8..959e30473 100644 --- a/tests/include/api_sql_common.sh +++ b/tests/include/api_sql_common.sh @@ -181,9 +181,11 @@ EOF sysbench $SB_ARGS run +cat <$CRAMTMP/api_sql.lua <$CRAMTMP/api_sql.lua <$CRAMTMP/api_sql.lua <$CRAMTMP/api_sql.lua <