mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Implementation of mysql_stmt_attr_get and mysql_stmt_attr_set
requested by Monty for Bug#1647 (No way to determine what size blob/clob is being returned into bound buffer) include/mysql.h: Implementation of mysql_stmt_attr_get and mysql_stmt_attr_set requested by Monty for Bug#1647. libmysql/libmysql.c: Implementation of mysql_stmt_attr_get and mysql_stmt_attr_set requested by Monty for Bug#1647. libmysql/libmysql.def: Windows .defs added for new API calls
This commit is contained in:
parent
242fe78d2b
commit
e73e26f381
3 changed files with 75 additions and 0 deletions
|
|
@ -2514,6 +2514,56 @@ stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)),
|
|||
return MYSQL_NO_DATA;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Get/set statement attributes
|
||||
|
||||
SYNOPSIS
|
||||
mysql_stmt_attr_get()
|
||||
mysql_stmt_attr_set()
|
||||
|
||||
attr_type statemenet attribute
|
||||
value casted to const void * pointer to value.
|
||||
|
||||
RETURN VALUE
|
||||
0 success
|
||||
!0 wrong attribute type
|
||||
*/
|
||||
|
||||
my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt,
|
||||
enum enum_stmt_attr_type attr_type,
|
||||
const void *value)
|
||||
{
|
||||
switch (attr_type) {
|
||||
case STMT_ATTR_UPDATE_MAX_LENGTH:
|
||||
/*
|
||||
Do we need a flags variable for all attributes or a bool for each
|
||||
attribute?
|
||||
*/
|
||||
stmt->update_max_length= value ? *(const my_bool*) value : 0;
|
||||
break;
|
||||
default:
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
|
||||
enum enum_stmt_attr_type attr_type,
|
||||
void *value)
|
||||
{
|
||||
switch (attr_type) {
|
||||
case STMT_ATTR_UPDATE_MAX_LENGTH:
|
||||
*(unsigned long *) value= stmt->update_max_length;
|
||||
break;
|
||||
default:
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Execute the prepared query
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -127,3 +127,5 @@ EXPORTS
|
|||
mysql_stmt_prepare
|
||||
mysql_stmt_init
|
||||
mysql_stmt_insert_id
|
||||
mysql_stmt_attr_get
|
||||
mysql_stmt_attr_set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue