summaryrefslogtreecommitdiff
path: root/sql/sql_string.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-04-14 01:56:19 +0400
committerKonstantin Osipov <kostja@sun.com>2010-04-14 01:56:19 +0400
commitb8d014b8f6671395b9965b5a9953f5b2efa0fd15 (patch)
tree7a87035df6e8d664a8301574158d57d8305c65cf /sql/sql_string.cc
parent03b1cdd04549c754a24e996f1aefd4e3a050af49 (diff)
downloadmariadb-git-b8d014b8f6671395b9965b5a9953f5b2efa0fd15.tar.gz
A fix for Bug#11918 "SP does not accept variables in LIMIT clause"
Allow stored procedure variables in LIMIT clause. Only allow variables of INTEGER types. Handle negative values by means of an implicit cast to UNSIGNED (similarly to prepared statement placeholders). Add tests. Make sure replication works by not doing NAME_CONST substitution for variables in LIMIT clause. Add replication tests.
Diffstat (limited to 'sql/sql_string.cc')
-rw-r--r--sql/sql_string.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 75e8ca30cf0..9fbc06b7529 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -405,6 +405,16 @@ bool String::append(const char *s)
}
+
+bool String::append_ulonglong(ulonglong val)
+{
+ if (realloc(str_length+MAX_BIGINT_WIDTH+2))
+ return TRUE;
+ char *end= (char*) longlong10_to_str(val, (char*) Ptr + str_length, 10);
+ str_length= end - Ptr;
+ return FALSE;
+}
+
/*
Append a string in the given charset to the string
with character set recoding