summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-06-12 16:34:54 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-06-12 16:34:54 +0300
commite53dfc6df42d83c45ec5121c98dcbcff7960beab (patch)
tree49f65594ef7867ace676423b3635cec9297e4936 /sql/sql_prepare.cc
parent023f3dd0df68b04f5bca6e0a15f1f4d426731383 (diff)
parent119412f8d0cc364678e8e3b3c36c42e6fea69e3d (diff)
downloadmariadb-git-e53dfc6df42d83c45ec5121c98dcbcff7960beab.tar.gz
Merge bk-internal:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/work/merge-5.1-opt mysql-test/r/insert_update.result: Auto merged mysql-test/r/trigger.result: Auto merged mysql-test/t/insert_update.test: Auto merged mysql-test/t/trigger.test: Auto merged sql/item_strfunc.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_show.cc: Auto merged sql/item_func.cc: merge of 5.0-opt -> 5.1-opt sql/sql_insert.cc: merge of 5.0-opt -> 5.1-opt sql/structs.h: merge of 5.0-opt -> 5.1-opt tests/mysql_client_test.c: merge of 5.0-opt -> 5.1-opt
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index c54b2358b37..0fd905d3fb3 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -572,6 +572,8 @@ void set_param_date(Item_param *param, uchar **pos, ulong len)
static void set_param_str(Item_param *param, uchar **pos, ulong len)
{
ulong length= get_param_length(pos, len);
+ if (length > len)
+ length= len;
param->set_str((const char *)*pos, length);
*pos+= length;
}
@@ -742,6 +744,8 @@ static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array,
if (read_pos >= data_end)
DBUG_RETURN(1);
param->set_param_func(param, &read_pos, data_end - read_pos);
+ if (param->state == Item_param::NO_VALUE)
+ DBUG_RETURN(1);
}
}
res= param->query_val_str(&str);
@@ -778,6 +782,8 @@ static bool insert_params(Prepared_statement *stmt, uchar *null_array,
if (read_pos >= data_end)
DBUG_RETURN(1);
param->set_param_func(param, &read_pos, data_end - read_pos);
+ if (param->state == Item_param::NO_VALUE)
+ DBUG_RETURN(1);
}
}
if (param->convert_str_value(stmt->thd))
@@ -860,6 +866,8 @@ static bool emb_insert_params(Prepared_statement *stmt, String *expanded_query)
client_param->length ?
*client_param->length :
client_param->buffer_length);
+ if (param->state == Item_param::NO_VALUE)
+ DBUG_RETURN(1);
}
}
if (param->convert_str_value(thd))
@@ -902,6 +910,8 @@ static bool emb_insert_params_with_log(Prepared_statement *stmt,
client_param->length ?
*client_param->length :
client_param->buffer_length);
+ if (param->state == Item_param::NO_VALUE)
+ DBUG_RETURN(1);
}
}
res= param->query_val_str(&str);