Below is the list of changes that have just been committed into a local
4.1 repository of uchum. When uchum does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-04-28 23:45:32+05:00, gshchepa@stripped +3 -0
Fixed bug #20710.
This bug occurs when error message length exceeds allowed limit: my_error()
function output "%s" sequences instead of long string arguments.
Formats like %-.64s are very common in errmsg.txt files, however my_error()
function simply ignores precision of those formats.
mysql-test/r/alter_table.result@stripped, 2007-04-28 22:12:30+05:00, gshchepa@stripped
+5 -0
Added test case for bug #20710.
mysql-test/t/alter_table.test@stripped, 2007-04-28 22:11:52+05:00, gshchepa@stripped +11
-0
Added test case for bug #20710.
mysys/my_error.c@stripped, 2007-04-28 23:00:43+05:00, gshchepa@stripped +15 -0
Fixed bug #20710.
This bug occurs when error message length exceeds allowed limit: my_error()
function output "%s" sequences instead of long string arguments.
my_error() function has been fixed to accept formats like %-.64s.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: gshchepa
# Host: gshchepa.loc
# Root: /home/uchum/work/bk-trees/mysql-4.1-opt-20710
--- 1.17/mysys/my_error.c 2004-06-07 13:21:23 +05:00
+++ 1.18/mysys/my_error.c 2007-04-28 23:00:43 +05:00
@@ -82,6 +82,11 @@ int my_error(int nr,myf MyFlags, ...)
If "%.*u" or "%.*d" are encountered, the precision number is read
from the variable argument list but its value is ignored.
*/
+ if (*tpos == '-')
+ {
+ tpos++;
+ olen--;
+ }
prec_supplied= 0;
if (*tpos== '.')
{
@@ -93,6 +98,16 @@ int my_error(int nr,myf MyFlags, ...)
olen--;
prec_chars= va_arg(ap, int); /* get length parameter */
prec_supplied= 1;
+ }
+ else
+ {
+ while (my_isdigit(&my_charset_latin1, *tpos))
+ {
+ prec_supplied= 1;
+ prec_chars= prec_chars * 10 + *tpos - '0';
+ tpos++;
+ olen--;
+ }
}
}
--- 1.53/mysql-test/r/alter_table.result 2007-01-19 03:53:47 +04:00
+++ 1.54/mysql-test/r/alter_table.result 2007-04-28 22:12:30 +05:00
@@ -803,3 +803,8 @@ ERROR 42000: You have an error in your S
alter table table_24562 order by no_such_col;
ERROR 42S22: Unknown column 'no_such_col' in 'order clause'
drop table table_24562;
+CREATE TABLE t1 (c1 CHAR(255));
+INSERT INTO t1 VALUES (REPEAT("x", 255)), (REPEAT("x", 255));
+ALTER TABLE t1 ADD UNIQUE (c1);
+ERROR 23000: Duplicate entry
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' for key 1
+DROP TABLE t1;
--- 1.43/mysql-test/t/alter_table.test 2007-01-19 03:53:47 +04:00
+++ 1.44/mysql-test/t/alter_table.test 2007-04-28 22:11:52 +05:00
@@ -583,5 +583,16 @@ alter table table_24562 order by no_such
drop table table_24562;
+#
+# Bug #20710: adding unique index of column with duplicated
+# long values to reproduce error message with truncated key value.
+#
+
+CREATE TABLE t1 (c1 CHAR(255));
+INSERT INTO t1 VALUES (REPEAT("x", 255)), (REPEAT("x", 255));
+--error 1062
+ALTER TABLE t1 ADD UNIQUE (c1);
+DROP TABLE t1;
+
# End of 4.1 tests
| Thread |
|---|
| • bk commit into 4.1 tree (gshchepa:1.2637) BUG#20710 | gshchepa | 28 Apr |