summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-04-30 14:24:06 +0300
committerunknown <monty@mysql.com>2004-04-30 14:24:06 +0300
commit7bf15f4b7956b6f57ec6f695382e4589814c2d79 (patch)
tree2b276018e20491b28c92dabd57798ede13ed56df /libmysql
parent72c7b3529e02d5b4b4e8ba1c907dea8b7eb743ea (diff)
downloadmariadb-git-7bf15f4b7956b6f57ec6f695382e4589814c2d79.tar.gz
Only calculate MYSQL_FIELD->max_length if mysql_stmt_attr_set(..., STMT_ATTR_UPDATE_MAX_LENGTH) is done.
tests/client_test.c: Test mysql_stmt_attr_set(...STMT_ATTR_UPDATE_MAX_LENGTH)
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index bbff4e7a8d8..83346f46c5e 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -2530,10 +2530,6 @@ my_bool STDCALL mysql_stmt_attr_set(MYSQL_STMT *stmt,
{
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:
@@ -2550,7 +2546,7 @@ my_bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
switch (attr_type) {
case STMT_ATTR_UPDATE_MAX_LENGTH:
*(unsigned long *) value= stmt->update_max_length;
- break;
+ break;
default:
return TRUE;
}
@@ -3716,7 +3712,7 @@ int cli_read_binary_rows(MYSQL_STMT *stmt)
mysql= mysql->last_used_con;
- if (!stmt->bind_result_done)
+ if (stmt->update_max_length && !stmt->bind_result_done)
{
/*
We must initalize the bind structure to be able to calculate
@@ -3755,7 +3751,8 @@ int cli_read_binary_rows(MYSQL_STMT *stmt)
memcpy((char *) cur->data, (char *) cp+1, pkt_len-1);
cur->length= pkt_len; /* To allow us to do sanity checks */
result->rows++;
- stmt_update_metadata(stmt, cur);
+ if (stmt->update_max_length)
+ stmt_update_metadata(stmt, cur);
}
else
{