Commit 7aecbab8 authored by unknown's avatar unknown

Merge with global tree


BitKeeper/etc/logging_ok:
  auto-union
client/mysql.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
libmysql/libmysql.c:
  Auto merged
myisam/mi_open.c:
  Auto merged
mysql-test/r/order_by.result:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/t/order_by.test:
  Merge
sql/sql_lex.cc:
  Merge
sql/sql_yacc.yy:
  Use local copy
parents 25245179 985805ce
...@@ -197,6 +197,7 @@ ram@mysql.r18.ru ...@@ -197,6 +197,7 @@ ram@mysql.r18.ru
ram@ram.(none) ram@ram.(none)
ranger@regul.home.lan ranger@regul.home.lan
rburnett@build.mysql.com rburnett@build.mysql.com
reggie@bob.(none)
root@home.(none) root@home.(none)
root@mc04.(none) root@mc04.(none)
root@x3.internalnet root@x3.internalnet
......
...@@ -3234,13 +3234,20 @@ static const char* construct_prompt() ...@@ -3234,13 +3234,20 @@ static const char* construct_prompt()
break; break;
} }
case 'p': case 'p':
{
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if (!connected) if (!connected)
{ {
processed_prompt.append("not_connected"); processed_prompt.append("not_connected");
break; 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) !mysql.unix_socket)
add_int_to_prompt(mysql.port); add_int_to_prompt(mysql.port);
else else
...@@ -3249,6 +3256,7 @@ static const char* construct_prompt() ...@@ -3249,6 +3256,7 @@ static const char* construct_prompt()
processed_prompt.append(pos ? pos+1 : mysql.unix_socket); processed_prompt.append(pos ? pos+1 : mysql.unix_socket);
} }
#endif #endif
}
break; break;
case 'U': case 'U':
if (!full_username) if (!full_username)
......
...@@ -305,6 +305,9 @@ static struct my_option my_long_options[] = ...@@ -305,6 +305,9 @@ static struct my_option my_long_options[] =
{"opt", OPT_OPTIMIZE, {"opt", OPT_OPTIMIZE,
"Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.", "Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"order-by-primary", OPT_ORDER_BY_PRIMARY,
"Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
(gptr*) &opt_order_by_primary, (gptr*) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', {"password", 'p',
"Password to use when connecting to server. If password is not given it's solicited on the tty.", "Password to use when connecting to server. If password is not given it's solicited on the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
...@@ -356,9 +359,6 @@ static struct my_option my_long_options[] = ...@@ -356,9 +359,6 @@ static struct my_option my_long_options[] =
{"socket", 'S', "Socket file to use for connection.", {"socket", 'S', "Socket file to use for connection.",
(gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR, (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"order-by-primary", OPT_ORDER_BY_PRIMARY,
"Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.",
(gptr*) &opt_order_by_primary, (gptr*) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
#include <sslopt-longopts.h> #include <sslopt-longopts.h>
{"tab",'T', {"tab",'T',
"Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.", "Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.",
......
...@@ -857,6 +857,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) ...@@ -857,6 +857,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
err: err:
/* free up memory allocated with _init, usually */ /* free up memory allocated with _init, usually */
(*options->local_infile_end)(li_ptr); (*options->local_infile_end)(li_ptr);
my_free(buf, MYF(0));
DBUG_RETURN(result); DBUG_RETURN(result);
} }
......
...@@ -148,7 +148,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -148,7 +148,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);
......
...@@ -778,3 +778,41 @@ sid wnid ...@@ -778,3 +778,41 @@ sid wnid
39560 01019090000 39560 01019090000
37994 01019090000 37994 01019090000
drop table t1; drop table t1;
create table t1 (
`sid` decimal(8,0) default null,
`wnid` varchar(11) not null default '',
key `wnid14` (`wnid`(4)),
key `wnid` (`wnid`)
) engine=myisam default charset=latin1;
insert into t1 (`sid`, `wnid`) values
('10100','01019000000'),('37986','01019000000'),('37987','01019010000'),
('39560','01019090000'),('37989','01019000000'),('37990','01019011000'),
('37991','01019011000'),('37992','01019019000'),('37993','01019030000'),
('37994','01019090000'),('475','02070000000'),('25253','02071100000'),
('25255','02071100000'),('25256','02071110000'),('25258','02071130000'),
('25259','02071190000'),('25260','02071200000'),('25261','02071210000'),
('25262','02071290000'),('25263','02071300000'),('25264','02071310000'),
('25265','02071310000'),('25266','02071320000'),('25267','02071320000'),
('25269','02071330000'),('25270','02071340000'),('25271','02071350000'),
('25272','02071360000'),('25273','02071370000'),('25281','02071391000'),
('25282','02071391000'),('25283','02071399000'),('25284','02071400000'),
('25285','02071410000'),('25286','02071410000'),('25287','02071420000'),
('25288','02071420000'),('25291','02071430000'),('25290','02071440000'),
('25292','02071450000'),('25293','02071460000'),('25294','02071470000'),
('25295','02071491000'),('25296','02071491000'),('25297','02071499000');
explain select * from t1 where wnid like '0101%' order by wnid;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range wnid14,wnid wnid 11 NULL 10 Using where
select * from t1 where wnid like '0101%' order by wnid;
sid wnid
10100 01019000000
37986 01019000000
37989 01019000000
37987 01019010000
37990 01019011000
37991 01019011000
37992 01019019000
37993 01019030000
39560 01019090000
37994 01019090000
drop table t1;
...@@ -26,8 +26,10 @@ ...@@ -26,8 +26,10 @@
/* /*
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
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. -1 on error.
*/ */
...@@ -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 */
} }
......
...@@ -187,28 +187,33 @@ public: ...@@ -187,28 +187,33 @@ public:
}; };
void update_max_auto_val(const char *data, int size) { void update_max_auto_val(const char *data, int size) {
Uint64 val= 0; union {
Uint8 u8;
Uint16 u16;
Uint32 u32;
} val;
Uint64 v;
switch(size){ switch(size){
case 8: case 64:
val= *(Uint8*)data; memcpy(&v,data,8);
break;
case 16:
val= *(Uint16*)data;
break;
case 24:
val= (0xffffff)&*(Uint32*)data;
break; break;
case 32: case 32:
val= *(Uint32*)data; memcpy(&val.u32,data,4);
v= val.u32;
break; break;
case 64: case 16:
val= *(Uint64*)data; memcpy(&val.u16,data,2);
v= val.u16;
break;
case 8:
memcpy(&val.u8,data,1);
v= val.u8;
break; break;
default: default:
return; return;
}; };
if(val > m_max_auto_val) if(v > m_max_auto_val)
m_max_auto_val= val; m_max_auto_val= v;
}; };
/** /**
* Get attribute descriptor * Get attribute descriptor
......
...@@ -847,7 +847,10 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer, ...@@ -847,7 +847,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 */
......
...@@ -944,6 +944,7 @@ int yylex(void *arg, void *yythd) ...@@ -944,6 +944,7 @@ int yylex(void *arg, void *yythd)
if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) && if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) &&
(thd->command != COM_PREPARE)) (thd->command != COM_PREPARE))
{ {
lex->safe_to_cache_query= 0;
lex->found_colon= (char*) lex->ptr; lex->found_colon= (char*) lex->ptr;
thd->server_status|= SERVER_MORE_RESULTS_EXISTS; thd->server_status|= SERVER_MORE_RESULTS_EXISTS;
lex->next_state= MY_LEX_END; lex->next_state= MY_LEX_END;
......
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