summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlenz@mysql.com <>2005-01-18 11:41:51 +0100
committerlenz@mysql.com <>2005-01-18 11:41:51 +0100
commit69bfcfe33ae8221804c9b3a1d2d5fdb9c7140752 (patch)
tree2cfaf28b9d1b941bb1791222cae950272b916dc0
parentb9f3f4a2216a11db8770495c9b99cf67bff8c20a (diff)
parent8f23e9023243d3ae27fe8722c5aa407ca2ba450c (diff)
downloadmariadb-git-69bfcfe33ae8221804c9b3a1d2d5fdb9c7140752.tar.gz
Merge lgrimmer@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/space/my/mysql-4.1
-rw-r--r--BitKeeper/etc/logging_ok1
-rw-r--r--client/mysql.cc10
-rw-r--r--myisam/mi_open.c2
-rw-r--r--mysql-test/r/ctype_utf8.result12
-rw-r--r--mysql-test/t/ctype_utf8.test12
-rw-r--r--mysys/my_symlink.c9
-rw-r--r--sql/filesort.cc3
-rw-r--r--sql/item_strfunc.cc3
-rw-r--r--sql/sql_lex.cc1
-rw-r--r--sql/sql_yacc.yy6
10 files changed, 52 insertions, 7 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index 7ff770e8fbb..52b8b0584bc 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -181,6 +181,7 @@ ram@mysql.r18.ru
ram@ram.(none)
ranger@regul.home.lan
rburnett@build.mysql.com
+reggie@bob.(none)
root@home.(none)
root@mc04.(none)
root@x3.internalnet
diff --git a/client/mysql.cc b/client/mysql.cc
index b9251361a01..480a0deb347 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -3232,13 +3232,20 @@ static const char* construct_prompt()
break;
}
case 'p':
+ {
#ifndef EMBEDDED_LIBRARY
if (!connected)
{
processed_prompt.append("not_connected");
break;
}
- if (strstr(mysql_get_host_info(&mysql),"TCP/IP") ||
+
+ const char *host_info = mysql_get_host_info(&mysql);
+ if (strstr(host_info, "memory"))
+ {
+ processed_prompt.append( mysql.host );
+ }
+ else if (strstr(host_info,"TCP/IP") ||
!mysql.unix_socket)
add_int_to_prompt(mysql.port);
else
@@ -3247,6 +3254,7 @@ static const char* construct_prompt()
processed_prompt.append(pos ? pos+1 : mysql.unix_socket);
}
#endif
+ }
break;
case 'U':
if (!full_username)
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index 442bf00b9d3..2a327e4bd35 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -142,7 +142,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
goto err;
}
/* 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)
(void) strmov(index_name, org_name);
(void) fn_format(data_name,org_name,"",MI_NAME_DEXT,2+4+16);
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index f62d754392b..415ed33ad40 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -849,3 +849,15 @@ utf8_bin 6109
utf8_bin 61
utf8_bin 6120
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;
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index a57db4455ab..8e3eb71c3e5 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -681,3 +681,15 @@ SET collation_connection='utf8_general_ci';
-- source include/ctype_filesort.inc
SET collation_connection='utf8_bin';
-- 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;
diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c
index 045802c5e61..7be3fcd36f0 100644
--- a/mysys/my_symlink.c
+++ b/mysys/my_symlink.c
@@ -26,9 +26,11 @@
/*
Reads the content of a symbolic link
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
- -1 on error.
+
+ RETURN
+ 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)
@@ -58,6 +60,7 @@ int my_readlink(char *to, const char *filename, myf MyFlags)
}
else
to[length]=0;
+ DBUG_PRINT("exit" ,("result: %d", result));
DBUG_RETURN(result);
#endif /* HAVE_READLINK */
}
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 45478b436a5..24088210f1a 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -809,7 +809,10 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer,
}
close_cached_file(to_file); // This holds old result
if (to_file == t_file)
+ {
*t_file=t_file2; // Copy result file
+ setup_io_cache(t_file);
+ }
DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */
} /* merge_many_buff */
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 8341dda0a41..f131d849d62 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -275,7 +275,8 @@ String *Item_func_concat::val_str(String *str)
current_thd->variables.max_allowed_packet);
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
res->append(*res2);
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 5730073bd35..2783406e16a 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -912,6 +912,7 @@ int yylex(void *arg, void *yythd)
if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) &&
(thd->command != COM_PREPARE))
{
+ lex->safe_to_cache_query=0;
lex->found_colon=(char*)lex->ptr;
thd->server_status |= SERVER_MORE_RESULTS_EXISTS;
lex->next_state=MY_LEX_END;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 4fcc72bc90e..1e51d8fb82d 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -4008,7 +4008,8 @@ insert:
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_INSERT;
- lex->duplicates= DUP_ERROR;
+ lex->duplicates= DUP_ERROR;
+ mysql_init_select(lex);
/* for subselects */
lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ;
lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
@@ -4028,6 +4029,7 @@ replace:
LEX *lex=Lex;
lex->sql_command = SQLCOM_REPLACE;
lex->duplicates= DUP_REPLACE;
+ mysql_init_select(lex);
lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
}
replace_lock_option insert2
@@ -4229,6 +4231,7 @@ delete:
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_DELETE;
+ mysql_init_select(lex);
lex->lock_option= lex->thd->update_lock_default;
lex->ignore= 0;
lex->select_lex.init_order();
@@ -5321,6 +5324,7 @@ set:
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_SET_OPTION;
+ mysql_init_select(lex);
lex->option_type=OPT_SESSION;
lex->var_list.empty();
lex->one_shot_set= 0;