Commit 8685497a authored by unknown's avatar unknown

Merge mysql.com:/usr/home/bar/mysql-4.1.b12351

into  mysql.com:/usr/home/bar/mysql-5.0


client/mysqlcheck.c:
  Auto merged
mysql-test/r/func_system.result:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
parents 36283ca2 058d5bff
...@@ -575,8 +575,13 @@ static void print_result() ...@@ -575,8 +575,13 @@ static void print_result()
if (status) if (status)
{ {
/*
if there was an error with the table, we have --auto-repair set,
and this isn't a repair op, then add the table to the tables4repair
list
*/
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR && if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
(!opt_fast || strcmp(row[3],"OK"))) strcmp(row[3],"OK"))
insert_dynamic(&tables4repair, prev); insert_dynamic(&tables4repair, prev);
found_error=0; found_error=0;
if (opt_silent) if (opt_silent)
...@@ -595,8 +600,8 @@ static void print_result() ...@@ -595,8 +600,8 @@ static void print_result()
strmov(prev, row[0]); strmov(prev, row[0]);
putchar('\n'); putchar('\n');
} }
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR && /* add the last table to be repaired to the list */
!opt_fast) if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
insert_dynamic(&tables4repair, prev); insert_dynamic(&tables4repair, prev);
mysql_free_result(res); mysql_free_result(res);
} }
......
...@@ -68,6 +68,21 @@ drop table t1; ...@@ -68,6 +68,21 @@ drop table t1;
select TRUE,FALSE,NULL; select TRUE,FALSE,NULL;
TRUE FALSE NULL TRUE FALSE NULL
1 0 NULL 1 0 NULL
create table t1 (c1 char(5)) character set=latin1;
insert into t1 values('row 1');
insert into t1 values('row 2');
insert into t1 values('row 3');
select concat(user(), '--', c1) from t1;
concat(user(), '--', c1)
root@localhost--row 1
root@localhost--row 2
root@localhost--row 3
select concat(database(), '--', c1) from t1;
concat(database(), '--', c1)
test--row 1
test--row 2
test--row 3
drop table t1;
create table t1 (a char(10)) character set latin1; create table t1 (a char(10)) character set latin1;
select * from t1 where a=version(); select * from t1 where a=version();
a a
......
...@@ -31,6 +31,18 @@ drop table t1; ...@@ -31,6 +31,18 @@ drop table t1;
select TRUE,FALSE,NULL; select TRUE,FALSE,NULL;
#
# Bug#12351: CONCAT with USER()/DATEBASE() and
# a constant and a column gets strange results
#
create table t1 (c1 char(5)) character set=latin1;
insert into t1 values('row 1');
insert into t1 values('row 2');
insert into t1 values('row 3');
select concat(user(), '--', c1) from t1;
select concat(database(), '--', c1) from t1;
drop table t1;
# #
# Bug#8291 Illegal collation mix with USER() function # Bug#8291 Illegal collation mix with USER() function
# #
......
...@@ -1570,6 +1570,7 @@ Item *Item_func_sysconst::safe_charset_converter(CHARSET_INFO *tocs) ...@@ -1570,6 +1570,7 @@ Item *Item_func_sysconst::safe_charset_converter(CHARSET_INFO *tocs)
return NULL; return NULL;
} }
conv->str_value.copy(); conv->str_value.copy();
conv->str_value.shrink_to_length();
return conv; return conv;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment