Fixed that LPAD() and RPAD() cuts arguments

New test for string functions


Docs/manual.texi:
  Updated changes for 3.23.29
client/mysqldump.c:
  Cleanup
libmysql/libmysql.c:
  Fixed possible overflow
sql/handler.cc:
  Fixed typo
sql/item_strfunc.cc:
  Fixed that LPAD() and RPAD() cuts arguments
sql/mysqld.cc:
  Better error message on core dump
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
This commit is contained in:
unknown 2000-12-15 10:58:17 +02:00
commit e1e7ba756a
9 changed files with 168 additions and 29 deletions

View file

@ -1465,7 +1465,10 @@ String *Item_func_rpad::val_str(String *str)
goto err;
null_value=0;
if (count <= (int32) (res_length=res->length()))
return (res); // String to pad is big enough
{ // String to pad is big enough
res->length(count); // Shorten result if longer
return (res);
}
length_pad= rpad->length();
if ((ulong) count > max_allowed_packet || args[2]->null_value || !length_pad)
goto err;
@ -1521,7 +1524,10 @@ String *Item_func_lpad::val_str(String *str)
goto err;
null_value=0;
if (count <= (res_length=res->length()))
return (res); // String to pad is big enough
{ // String to pad is big enough
res->length(count); // Shorten result if longer
return (res);
}
length_pad= lpad->length();
if (count > max_allowed_packet || args[2]->null_value || !length_pad)
goto err;