summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-07-22 11:46:29 -0700
committerunknown <jimw@mysql.com>2005-07-22 11:46:29 -0700
commit657a5346e4df9b0aa9a533d407340d5603c9614b (patch)
tree2d9101f44231ffd75ff9767a455be7e569ce1196 /sql/item_strfunc.cc
parentbf45b6ba8477a9a910ec530c126569c208d5c0a1 (diff)
downloadmariadb-git-657a5346e4df9b0aa9a533d407340d5603c9614b.tar.gz
Fix calculation for length of LPAD() and RPAD() reported to
client via mysql_fetch_fields(). (Bug #11311) mysql-test/r/func_str.result: Add new results mysql-test/t/func_str.test: Add new regression test sql/item_strfunc.cc: Fix length reported for LPAD() and RPAD() -- they always truncate to the length that is given.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc2
1 files changed, 0 insertions, 2 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 3a5ddd583ef..d316c7eaf72 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2042,7 +2042,6 @@ void Item_func_rpad::fix_length_and_dec()
{
ulonglong length= ((ulonglong) args[1]->val_int() *
collation.collation->mbmaxlen);
- length= max((ulonglong) args[0]->max_length, length);
if (length >= MAX_BLOB_WIDTH)
{
length= MAX_BLOB_WIDTH;
@@ -2130,7 +2129,6 @@ void Item_func_lpad::fix_length_and_dec()
{
ulonglong length= ((ulonglong) args[1]->val_int() *
collation.collation->mbmaxlen);
- length= max((ulonglong) args[0]->max_length, length);
if (length >= MAX_BLOB_WIDTH)
{
length= MAX_BLOB_WIDTH;