Commit 9569b022 authored by guilhem@mysql.com's avatar guilhem@mysql.com

Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.1

into mysql.com:/home/mysql_src/mysql-4.1-clean
parents 5e43cf86 8f23e902
...@@ -142,7 +142,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -142,7 +142,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
goto err; goto err;
} }
/* Don't call realpath() if the name can't be a link */ /* Don't call realpath() if the name can't be a link */
if (strcmp(name_buff, org_name) || if (!strcmp(name_buff, org_name) ||
my_readlink(index_name, org_name, MYF(0)) == -1) my_readlink(index_name, org_name, MYF(0)) == -1)
(void) strmov(index_name, org_name); (void) strmov(index_name, org_name);
(void) fn_format(data_name,org_name,"",MI_NAME_DEXT,2+4+16); (void) fn_format(data_name,org_name,"",MI_NAME_DEXT,2+4+16);
......
...@@ -849,3 +849,15 @@ utf8_bin 6109 ...@@ -849,3 +849,15 @@ utf8_bin 6109
utf8_bin 61 utf8_bin 61
utf8_bin 6120 utf8_bin 6120
drop table t1; drop table t1;
CREATE TABLE t1 (
user varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES ('one'),('two');
SELECT CHARSET('a');
CHARSET('a')
utf8
SELECT user, CONCAT('<', user, '>') AS c FROM t1;
user c
one <one>
two <two>
DROP TABLE t1;
...@@ -681,3 +681,15 @@ SET collation_connection='utf8_general_ci'; ...@@ -681,3 +681,15 @@ SET collation_connection='utf8_general_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
SET collation_connection='utf8_bin'; SET collation_connection='utf8_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
#
# Bug #7874 CONCAT() gives wrong results mixing
# latin1 field and utf8 string literals
#
CREATE TABLE t1 (
user varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES ('one'),('two');
SELECT CHARSET('a');
SELECT user, CONCAT('<', user, '>') AS c FROM t1;
DROP TABLE t1;
...@@ -26,9 +26,11 @@ ...@@ -26,9 +26,11 @@
/* /*
Reads the content of a symbolic link Reads the content of a symbolic link
If the file is not a symbolic link, return the original file name in to. If the file is not a symbolic link, return the original file name in to.
Returns: 0 if table was a symlink,
1 if table was a normal file RETURN
-1 on error. 0 If filename was a symlink, (to will be set to value of symlink)
1 If filename was a normal file (to will be set to filename)
-1 on error.
*/ */
int my_readlink(char *to, const char *filename, myf MyFlags) int my_readlink(char *to, const char *filename, myf MyFlags)
...@@ -58,6 +60,7 @@ int my_readlink(char *to, const char *filename, myf MyFlags) ...@@ -58,6 +60,7 @@ int my_readlink(char *to, const char *filename, myf MyFlags)
} }
else else
to[length]=0; to[length]=0;
DBUG_PRINT("exit" ,("result: %d", result));
DBUG_RETURN(result); DBUG_RETURN(result);
#endif /* HAVE_READLINK */ #endif /* HAVE_READLINK */
} }
......
...@@ -809,7 +809,10 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer, ...@@ -809,7 +809,10 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer,
} }
close_cached_file(to_file); // This holds old result close_cached_file(to_file); // This holds old result
if (to_file == t_file) if (to_file == t_file)
{
*t_file=t_file2; // Copy result file *t_file=t_file2; // Copy result file
setup_io_cache(t_file);
}
DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */ DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */
} /* merge_many_buff */ } /* merge_many_buff */
......
...@@ -275,7 +275,8 @@ String *Item_func_concat::val_str(String *str) ...@@ -275,7 +275,8 @@ String *Item_func_concat::val_str(String *str)
current_thd->variables.max_allowed_packet); current_thd->variables.max_allowed_packet);
goto null; goto null;
} }
if (res->alloced_length() >= res->length()+res2->length()) if (!args[0]->const_item() &&
res->alloced_length() >= res->length()+res2->length())
{ // Use old buffer { // Use old buffer
res->append(*res2); res->append(*res2);
} }
......
...@@ -4008,7 +4008,8 @@ insert: ...@@ -4008,7 +4008,8 @@ insert:
{ {
LEX *lex= Lex; LEX *lex= Lex;
lex->sql_command= SQLCOM_INSERT; lex->sql_command= SQLCOM_INSERT;
lex->duplicates= DUP_ERROR; lex->duplicates= DUP_ERROR;
mysql_init_select(lex);
/* for subselects */ /* for subselects */
lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ; lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
...@@ -4028,6 +4029,7 @@ replace: ...@@ -4028,6 +4029,7 @@ replace:
LEX *lex=Lex; LEX *lex=Lex;
lex->sql_command = SQLCOM_REPLACE; lex->sql_command = SQLCOM_REPLACE;
lex->duplicates= DUP_REPLACE; lex->duplicates= DUP_REPLACE;
mysql_init_select(lex);
lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
} }
replace_lock_option insert2 replace_lock_option insert2
...@@ -4229,6 +4231,7 @@ delete: ...@@ -4229,6 +4231,7 @@ delete:
{ {
LEX *lex= Lex; LEX *lex= Lex;
lex->sql_command= SQLCOM_DELETE; lex->sql_command= SQLCOM_DELETE;
mysql_init_select(lex);
lex->lock_option= lex->thd->update_lock_default; lex->lock_option= lex->thd->update_lock_default;
lex->ignore= 0; lex->ignore= 0;
lex->select_lex.init_order(); lex->select_lex.init_order();
...@@ -5321,6 +5324,7 @@ set: ...@@ -5321,6 +5324,7 @@ set:
{ {
LEX *lex=Lex; LEX *lex=Lex;
lex->sql_command= SQLCOM_SET_OPTION; lex->sql_command= SQLCOM_SET_OPTION;
mysql_init_select(lex);
lex->option_type=OPT_SESSION; lex->option_type=OPT_SESSION;
lex->var_list.empty(); lex->var_list.empty();
lex->one_shot_set= 0; lex->one_shot_set= 0;
......
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