Commit 5cc410bb authored by unknown's avatar unknown

mysql_stmt_field_count()


include/mysql.h:
  mysql_stmt_field_count() declaration
libmysql/libmysql.c:
  added mysql_stmt_field_count(): 
  we need this function to ease use of mysql_stmt_result_metadata:
  if mysql_stmt_field_count() != 0 mysql_stmt_result_metadata fails
  only if OOM.
libmysql/libmysql.def:
  declaration for mysql_stmt_field_count()
parent 780fdb02
......@@ -710,6 +710,7 @@ void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset);
my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt);
my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt);
my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt);
unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt);
my_bool STDCALL mysql_commit(MYSQL * mysql);
my_bool STDCALL mysql_rollback(MYSQL * mysql);
......
......@@ -2598,6 +2598,16 @@ my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt)
}
/*
Returns the number of result columns for the most recent query
run on this statement.
*/
unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt)
{
return stmt->field_count;
}
/*
Return last inserted id for auto_increment columns
*/
......
......@@ -131,3 +131,4 @@ EXPORTS
mysql_stmt_insert_id
mysql_stmt_attr_get
mysql_stmt_attr_set
mysql_stmt_field_count
......@@ -6284,6 +6284,7 @@ static void test_field_misc()
result= mysql_stmt_result_metadata(stmt);
mytest(result);
assert(mysql_stmt_field_count(stmt) == mysql_num_fields(result));
rc= mysql_stmt_execute(stmt);
check_execute(stmt, rc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment