Commit 04011331 authored by unknown's avatar unknown

Merge bk-internal:/home/bk/mysql-5.0-maint

into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint

parents 97c0c810 734a4c55
...@@ -913,6 +913,7 @@ ndb/src/common/mgmcommon/printConfig/*.d ...@@ -913,6 +913,7 @@ ndb/src/common/mgmcommon/printConfig/*.d
ndb/src/common/portlib/libportlib.dsp ndb/src/common/portlib/libportlib.dsp
ndb/src/common/transporter/libtransporter.dsp ndb/src/common/transporter/libtransporter.dsp
ndb/src/common/util/libgeneral.dsp ndb/src/common/util/libgeneral.dsp
ndb/src/common/util/testBitmask.cpp
ndb/src/cw/cpcd/ndb_cpcd ndb/src/cw/cpcd/ndb_cpcd
ndb/src/dummy.cpp ndb/src/dummy.cpp
ndb/src/kernel/blocks/backup/libbackup.dsp ndb/src/kernel/blocks/backup/libbackup.dsp
...@@ -1138,6 +1139,7 @@ sql/*.ds? ...@@ -1138,6 +1139,7 @@ sql/*.ds?
sql/*.vcproj sql/*.vcproj
sql/.gdbinit sql/.gdbinit
sql/client.c sql/client.c
sql/f.c
sql/gen_lex_hash sql/gen_lex_hash
sql/gmon.out sql/gmon.out
sql/lex_hash.h sql/lex_hash.h
...@@ -1296,4 +1298,3 @@ vio/viotest-sslconnect.cpp ...@@ -1296,4 +1298,3 @@ vio/viotest-sslconnect.cpp
vio/viotest.cpp vio/viotest.cpp
zlib/*.ds? zlib/*.ds?
zlib/*.vcproj zlib/*.vcproj
ndb/src/common/util/testBitmask.cpp
...@@ -157,17 +157,29 @@ static int create_defaults_file(const char *path, const char *our_defaults_path) ...@@ -157,17 +157,29 @@ static int create_defaults_file(const char *path, const char *our_defaults_path)
File our_defaults_file, defaults_file; File our_defaults_file, defaults_file;
char buffer[512]; char buffer[512];
char *buffer_end; char *buffer_end;
int failed_to_open_count= 0;
int error; int error;
/* check if the defaults file is needed at all */ /* check if the defaults file is needed at all */
if (!opt_password) if (!opt_password)
return 0; return 0;
defaults_file= my_open(path, O_BINARY | O_CREAT | O_WRONLY, retry_open:
defaults_file= my_open(path, O_BINARY | O_CREAT | O_WRONLY | O_EXCL,
MYF(MY_FAE | MY_WME)); MYF(MY_FAE | MY_WME));
if (defaults_file < 0) if (defaults_file < 0)
{
if (failed_to_open_count == 0)
{
remove(path);
failed_to_open_count+= 1;
goto retry_open;
}
else
return 1; return 1;
}
upgrade_defaults_created= 1; upgrade_defaults_created= 1;
if (our_defaults_path) if (our_defaults_path)
{ {
......
...@@ -101,6 +101,10 @@ extern "C" { ...@@ -101,6 +101,10 @@ extern "C" {
/* On NetWare, to fix the problem with the deletion of open files */ /* On NetWare, to fix the problem with the deletion of open files */
#define CANT_DELETE_OPEN_FILES 1 #define CANT_DELETE_OPEN_FILES 1
#define FN_LIBCHAR '\\'
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'
/* default directory information */ /* default directory information */
#define DEFAULT_MYSQL_HOME "sys:/mysql" #define DEFAULT_MYSQL_HOME "sys:/mysql"
#define PACKAGE "mysql" #define PACKAGE "mysql"
......
...@@ -5000,3 +5000,13 @@ insert t1 values (1),(2),(3),(4),(5); ...@@ -5000,3 +5000,13 @@ insert t1 values (1),(2),(3),(4),(5);
truncate table t1; truncate table t1;
affected rows: 0 affected rows: 0
drop table t1; drop table t1;
create table bug15205 (val int(11) default null) engine=csv;
create table bug15205_2 (val int(11) default null) engine=csv;
select * from bug15205;
ERROR HY000: Got error 1 from storage engine
select * from bug15205_2;
val
select * from bug15205;
val
drop table bug15205;
drop table bug15205_2;
...@@ -730,6 +730,49 @@ id MIN(s) ...@@ -730,6 +730,49 @@ id MIN(s)
1 ZZZ 1 ZZZ
2 ZZZ 2 ZZZ
DROP TABLE t1; DROP TABLE t1;
drop table if exists bug20536;
set names latin1;
create table bug20536 (id bigint not null auto_increment primary key, name
varchar(255) character set ucs2 not null);
insert into `bug20536` (`id`,`name`) values (1, _latin1 x'74657374311a'), (2, "'test\\_2'");
select md5(name) from bug20536;
md5(name)
3417d830fe24ffb2f81a28e54df2d1b3
48d95db0d8305c2fe11548a3635c9385
select sha1(name) from bug20536;
sha1(name)
72228a6d56efb7a89a09543068d5d8fa4c330881
677d4d505355eb5b0549b865fcae4b7f0c28aef5
select make_set(3, name, upper(name)) from bug20536;
make_set(3, name, upper(name))
test1,TEST1
'test\_2','TEST\_2'
select export_set(5, name, upper(name)) from bug20536;
export_set(5, name, upper(name))
test1,TEST1,test1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1
'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2'
select export_set(5, name, upper(name), ",", 5) from bug20536;
export_set(5, name, upper(name), ",", 5)
test1,TEST1,test1,TEST1,TEST1
'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2'
select password(name) from bug20536;
password(name)
????????????????????
????????????????????
select old_password(name) from bug20536;
old_password(name)
????????
????????
select encrypt(name, 'SALT') from bug20536;
encrypt(name, 'SALT')
SA5pDi1UPZdys
SA5pDi1UPZdys
select quote(name) from bug20536;
quote(name)
??????????
????????????????
drop table bug20536;
End of 4.1 tests
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3)); CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
update t1 set b=a; update t1 set b=a;
...@@ -765,3 +808,4 @@ blob 65535 65535 ...@@ -765,3 +808,4 @@ blob 65535 65535
text 65535 65535 text 65535 65535
text 65535 32767 text 65535 32767
drop table t1; drop table t1;
End of 5.0 tests
...@@ -87,6 +87,10 @@ SELECT IS_USED_LOCK('bug16501'); ...@@ -87,6 +87,10 @@ SELECT IS_USED_LOCK('bug16501');
IS_USED_LOCK('bug16501') IS_USED_LOCK('bug16501')
NULL NULL
DROP TABLE t1; DROP TABLE t1;
select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
export_set(3, _latin1'foo', _utf8'bar', ',', 4)
foo,foo,bar,bar
End of 4.1 tests
create table t1 as select uuid(), length(uuid()); create table t1 as select uuid(), length(uuid());
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -130,3 +134,4 @@ timediff(b, a) >= '00:00:03' ...@@ -130,3 +134,4 @@ timediff(b, a) >= '00:00:03'
drop table t2; drop table t2;
drop table t1; drop table t1;
set global query_cache_size=default; set global query_cache_size=default;
End of 5.0 tests
...@@ -3,9 +3,12 @@ create table t1(f1 int); ...@@ -3,9 +3,12 @@ create table t1(f1 int);
insert into t1 values (5); insert into t1 values (5);
grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user1@localhost require SSL;
grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA";
grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com"; grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/emailAddress=abstract.mysql.developer@mysql.com"; grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
flush privileges; flush privileges;
connect(localhost,ssl_user5,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'ssl_user5'@'localhost' (using password: NO)
SHOW STATUS LIKE 'Ssl_cipher'; SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA Ssl_cipher DHE-RSA-AES256-SHA
...@@ -39,7 +42,7 @@ f1 ...@@ -39,7 +42,7 @@ f1
delete from t1; delete from t1;
ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1' ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1'
drop user ssl_user1@localhost, ssl_user2@localhost, drop user ssl_user1@localhost, ssl_user2@localhost,
ssl_user3@localhost, ssl_user4@localhost; ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
drop table t1; drop table t1;
mysqltest: Could not open connection 'default': 2026 SSL connection error mysqltest: Could not open connection 'default': 2026 SSL connection error
mysqltest: Could not open connection 'default': 2026 SSL connection error mysqltest: Could not open connection 'default': 2026 SSL connection error
......
...@@ -689,6 +689,12 @@ select @@log_queries_not_using_indexes; ...@@ -689,6 +689,12 @@ select @@log_queries_not_using_indexes;
show variables like 'log_queries_not_using_indexes'; show variables like 'log_queries_not_using_indexes';
Variable_name Value Variable_name Value
log_queries_not_using_indexes OFF log_queries_not_using_indexes OFF
select @@"";
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '""' at line 1
select @@&;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '&' at line 1
select @@@;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@' at line 1
End of 5.0 tests End of 5.0 tests
set global binlog_cache_size =@my_binlog_cache_size; set global binlog_cache_size =@my_binlog_cache_size;
set global connect_timeout =@my_connect_timeout; set global connect_timeout =@my_connect_timeout;
......
...@@ -1384,3 +1384,27 @@ truncate table t1; -- truncate ...@@ -1384,3 +1384,27 @@ truncate table t1; -- truncate
--disable_info --disable_info
drop table t1; drop table t1;
#
# Bug #15205 Select from CSV table without the datafile causes crash
#
# NOTE: the bug is not deterministic
# The crash happens because the necessary cleanup after an error wasn't
# performed. Namely, the table share, inserted in the hash during table
# open, was not deleted from hash. At the same time the share was freed
# when an error was encountered. Thus, subsequent access to the hash
# resulted in scanning through deleted memory and we were geting a crash.
# that's why we need two tables in the bugtest
create table bug15205 (val int(11) default null) engine=csv;
create table bug15205_2 (val int(11) default null) engine=csv;
--exec rm $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
# system error (can't open the datafile)
--error ER_GET_ERRNO
select * from bug15205;
select * from bug15205_2;
--exec touch $MYSQLTEST_VARDIR/master-data/test/bug15205.CSV
select * from bug15205;
drop table bug15205;
drop table bug15205_2;
...@@ -465,7 +465,46 @@ INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ'); ...@@ -465,7 +465,46 @@ INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
SELECT id, MIN(s) FROM t1 GROUP BY id; SELECT id, MIN(s) FROM t1 GROUP BY id;
DROP TABLE t1; DROP TABLE t1;
# End of 4.1 tests
#
# Bug #20536: md5() with GROUP BY and UCS2 return different results on myisam/innodb
#
--disable_warnings
drop table if exists bug20536;
--enable_warnings
set names latin1;
create table bug20536 (id bigint not null auto_increment primary key, name
varchar(255) character set ucs2 not null);
insert into `bug20536` (`id`,`name`) values (1, _latin1 x'74657374311a'), (2, "'test\\_2'");
select md5(name) from bug20536;
select sha1(name) from bug20536;
select make_set(3, name, upper(name)) from bug20536;
select export_set(5, name, upper(name)) from bug20536;
select export_set(5, name, upper(name), ",", 5) from bug20536;
# Some broken functions: add these tests just to document current behavior.
# PASSWORD and OLD_PASSWORD don't work with UCS2 strings, but to fix it would
# not be backwards compatible in all cases, so it's best to leave it alone
select password(name) from bug20536;
select old_password(name) from bug20536;
# ENCRYPT relies on OS function crypt() which takes a NUL-terminated string; it
# doesn't return good results for strings with embedded 0 bytes. It won't be
# fixed unless we choose to re-implement the crypt() function ourselves to take
# an extra size_t string_length argument.
select encrypt(name, 'SALT') from bug20536;
# QUOTE doesn't work with UCS2 data. It would require a total rewrite
# of Item_func_quote::val_str(), which isn't worthwhile until UCS2 is
# supported fully as a client character set.
select quote(name) from bug20536;
drop table bug20536;
--echo End of 4.1 tests
# #
# Conversion from an UCS2 string to a decimal column # Conversion from an UCS2 string to a decimal column
...@@ -497,3 +536,5 @@ create table t1(a blob, b text charset utf8, c text charset ucs2); ...@@ -497,3 +536,5 @@ create table t1(a blob, b text charset utf8, c text charset ucs2);
select data_type, character_octet_length, character_maximum_length select data_type, character_octet_length, character_maximum_length
from information_schema.columns where table_name='t1'; from information_schema.columns where table_name='t1';
drop table t1; drop table t1;
--echo End of 5.0 tests
...@@ -78,7 +78,13 @@ connection default; ...@@ -78,7 +78,13 @@ connection default;
DROP TABLE t1; DROP TABLE t1;
# End of 4.1 tests #
# Bug #21531: EXPORT_SET() doesn't accept args with coercible character sets
#
select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
--echo End of 4.1 tests
# #
# Test for BUG#9535 # Test for BUG#9535
...@@ -87,7 +93,9 @@ create table t1 as select uuid(), length(uuid()); ...@@ -87,7 +93,9 @@ create table t1 as select uuid(), length(uuid());
show create table t1; show create table t1;
drop table t1; drop table t1;
#
# Bug #6760: Add SLEEP() function # Bug #6760: Add SLEEP() function
#
create table t1 (a timestamp default '2005-05-05 01:01:01', create table t1 (a timestamp default '2005-05-05 01:01:01',
b timestamp default '2005-05-05 01:01:01'); b timestamp default '2005-05-05 01:01:01');
insert into t1 set a = now(); insert into t1 set a = now();
...@@ -117,4 +125,4 @@ drop table t2; ...@@ -117,4 +125,4 @@ drop table t2;
drop table t1; drop table t1;
set global query_cache_size=default; set global query_cache_size=default;
# End of 5.0 tests --echo End of 5.0 tests
...@@ -10,14 +10,18 @@ insert into t1 values (5); ...@@ -10,14 +10,18 @@ insert into t1 values (5);
grant select on test.* to ssl_user1@localhost require SSL; grant select on test.* to ssl_user1@localhost require SSL;
grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA";
grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com"; grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/emailAddress=abstract.mysql.developer@mysql.com"; grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
flush privileges; flush privileges;
connect (con1,localhost,ssl_user1,,,,,SSL); connect (con1,localhost,ssl_user1,,,,,SSL);
connect (con2,localhost,ssl_user2,,,,,SSL); connect (con2,localhost,ssl_user2,,,,,SSL);
connect (con3,localhost,ssl_user3,,,,,SSL); connect (con3,localhost,ssl_user3,,,,,SSL);
connect (con4,localhost,ssl_user4,,,,,SSL); connect (con4,localhost,ssl_user4,,,,,SSL);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error 1045
connect (con5,localhost,ssl_user5,,,,,SSL);
connection con1; connection con1;
# Check ssl turned on # Check ssl turned on
...@@ -49,7 +53,7 @@ delete from t1; ...@@ -49,7 +53,7 @@ delete from t1;
connection default; connection default;
drop user ssl_user1@localhost, ssl_user2@localhost, drop user ssl_user1@localhost, ssl_user2@localhost,
ssl_user3@localhost, ssl_user4@localhost; ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
drop table t1; drop table t1;
......
...@@ -585,6 +585,16 @@ show variables like 'ssl%'; ...@@ -585,6 +585,16 @@ show variables like 'ssl%';
select @@log_queries_not_using_indexes; select @@log_queries_not_using_indexes;
show variables like 'log_queries_not_using_indexes'; show variables like 'log_queries_not_using_indexes';
#
# Bug#20908: Crash if select @@""
#
--error ER_PARSE_ERROR
select @@"";
--error ER_PARSE_ERROR
select @@&;
--error ER_PARSE_ERROR
select @@@;
--echo End of 5.0 tests --echo End of 5.0 tests
# This is at the very after the versioned tests, since it involves doing # This is at the very after the versioned tests, since it involves doing
...@@ -620,3 +630,4 @@ set global server_id =@my_server_id; ...@@ -620,3 +630,4 @@ set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time; set global slow_launch_time =@my_slow_launch_time;
set global storage_engine =@my_storage_engine; set global storage_engine =@my_storage_engine;
set global thread_cache_size =@my_thread_cache_size; set global thread_cache_size =@my_thread_cache_size;
...@@ -205,16 +205,18 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table) ...@@ -205,16 +205,18 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
share->table_name_length=length; share->table_name_length=length;
share->table_name=tmp_name; share->table_name=tmp_name;
strmov(share->table_name,table_name); strmov(share->table_name,table_name);
fn_format(data_file_name, table_name, "", ".CSV",MY_REPLACE_EXT|MY_UNPACK_FILENAME); fn_format(data_file_name, table_name, "", ".CSV",
MY_REPLACE_EXT | MY_UNPACK_FILENAME);
if ((share->data_file= my_open(data_file_name, O_RDWR|O_APPEND,
MYF(0))) == -1)
goto error;
if (my_hash_insert(&tina_open_tables, (byte*) share)) if (my_hash_insert(&tina_open_tables, (byte*) share))
goto error; goto error;
thr_lock_init(&share->lock); thr_lock_init(&share->lock);
pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST); pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST);
if ((share->data_file= my_open(data_file_name, O_RDWR|O_APPEND,
MYF(0))) == -1)
goto error2;
/* We only use share->data_file for writing, so we scan to the end to append */ /* We only use share->data_file for writing, so we scan to the end to append */
if (my_seek(share->data_file, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR) if (my_seek(share->data_file, 0, SEEK_END, MYF(0)) == MY_FILEPOS_ERROR)
goto error2; goto error2;
...@@ -233,6 +235,7 @@ error3: ...@@ -233,6 +235,7 @@ error3:
error2: error2:
thr_lock_delete(&share->lock); thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->mutex); pthread_mutex_destroy(&share->mutex);
hash_delete(&tina_open_tables, (byte*) share);
error: error:
pthread_mutex_unlock(&tina_mutex); pthread_mutex_unlock(&tina_mutex);
my_free((gptr) share, MYF(0)); my_free((gptr) share, MYF(0));
......
...@@ -442,13 +442,17 @@ int main(int argc,char **argv) ...@@ -442,13 +442,17 @@ int main(int argc,char **argv)
if (get_options(argc,(char **) argv)) if (get_options(argc,(char **) argv))
exit(1); exit(1);
/* Broken up to indicate that it's not advice to you, gentle reader. */
printf("/*\n\n Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
printf("/* Copyright (C) 2001-2004 MySQL AB\n\ printf("/* Copyright (C) 2001-2004 MySQL AB\n\
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
and you are welcome to modify and redistribute it under the GPL license\n\ and you are welcome to modify and redistribute it under the GPL license\n\
\n*/\n\n"); \n*/\n\n");
printf("/* This code is generated by gen_lex_hash.cc that seeks for\ /* Broken up to indicate that it's not advice to you, gentle reader. */
a perfect\nhash function */\n\n"); printf("/* Do " "not " "edit " "this " "file! This is generated by "
"gen_lex_hash.cc\nthat seeks for a perfect hash function */\n\n");
printf("#include \"lex.h\"\n\n"); printf("#include \"lex.h\"\n\n");
calc_length(); calc_length();
...@@ -468,6 +472,14 @@ static inline SYMBOL *get_hash_symbol(const char *s,\n\ ...@@ -468,6 +472,14 @@ static inline SYMBOL *get_hash_symbol(const char *s,\n\
{\n\ {\n\
register uchar *hash_map;\n\ register uchar *hash_map;\n\
register const char *cur_str= s;\n\ register const char *cur_str= s;\n\
\n\
if (len == 0) {\n\
DBUG_PRINT(\"warning\", (\"get_hash_symbol() received a request for a zero-length symbol, which is probably a mistake.\"));\
return(NULL);\n\
}\n"
);
printf("\
if (function){\n\ if (function){\n\
if (len>sql_functions_max_len) return 0;\n\ if (len>sql_functions_max_len) return 0;\n\
hash_map= sql_functions_map;\n\ hash_map= sql_functions_map;\n\
...@@ -498,7 +510,10 @@ static inline SYMBOL *get_hash_symbol(const char *s,\n\ ...@@ -498,7 +510,10 @@ static inline SYMBOL *get_hash_symbol(const char *s,\n\
cur_struct= uint4korr(hash_map+\n\ cur_struct= uint4korr(hash_map+\n\
(((uint16)cur_struct + cur_char - first_char)*4));\n\ (((uint16)cur_struct + cur_char - first_char)*4));\n\
cur_str++;\n\ cur_str++;\n\
}\n\ }\n"
);
printf("\
}else{\n\ }else{\n\
if (len>symbols_max_len) return 0;\n\ if (len>symbols_max_len) return 0;\n\
hash_map= symbols_map;\n\ hash_map= symbols_map;\n\
......
...@@ -124,6 +124,7 @@ String *Item_func_md5::val_str(String *str) ...@@ -124,6 +124,7 @@ String *Item_func_md5::val_str(String *str)
{ {
DBUG_ASSERT(fixed == 1); DBUG_ASSERT(fixed == 1);
String * sptr= args[0]->val_str(str); String * sptr= args[0]->val_str(str);
str->set_charset(&my_charset_bin);
if (sptr) if (sptr)
{ {
my_MD5_CTX context; my_MD5_CTX context;
...@@ -170,6 +171,7 @@ String *Item_func_sha::val_str(String *str) ...@@ -170,6 +171,7 @@ String *Item_func_sha::val_str(String *str)
{ {
DBUG_ASSERT(fixed == 1); DBUG_ASSERT(fixed == 1);
String * sptr= args[0]->val_str(str); String * sptr= args[0]->val_str(str);
str->set_charset(&my_charset_bin);
if (sptr) /* If we got value different from NULL */ if (sptr) /* If we got value different from NULL */
{ {
SHA1_CONTEXT context; /* Context used to generate SHA1 hash */ SHA1_CONTEXT context; /* Context used to generate SHA1 hash */
...@@ -1605,7 +1607,7 @@ String *Item_func_encrypt::val_str(String *str) ...@@ -1605,7 +1607,7 @@ String *Item_func_encrypt::val_str(String *str)
null_value= 1; null_value= 1;
return 0; return 0;
} }
str->set(tmp,(uint) strlen(tmp),res->charset()); str->set(tmp, (uint) strlen(tmp), &my_charset_bin);
str->copy(); str->copy();
pthread_mutex_unlock(&LOCK_crypt); pthread_mutex_unlock(&LOCK_crypt);
return str; return str;
...@@ -2041,7 +2043,7 @@ String *Item_func_make_set::val_str(String *str) ...@@ -2041,7 +2043,7 @@ String *Item_func_make_set::val_str(String *str)
return &my_empty_string; return &my_empty_string;
result= &tmp_str; result= &tmp_str;
} }
if (tmp_str.append(',') || tmp_str.append(*res)) if (tmp_str.append(STRING_WITH_LEN(","), &my_charset_bin) || tmp_str.append(*res))
return &my_empty_string; return &my_empty_string;
} }
} }
...@@ -2699,8 +2701,12 @@ String* Item_func_export_set::val_str(String* str) ...@@ -2699,8 +2701,12 @@ String* Item_func_export_set::val_str(String* str)
} }
break; break;
case 3: case 3:
sep_buf.set(STRING_WITH_LEN(","), default_charset()); {
/* errors is not checked - assume "," can always be converted */
uint errors;
sep_buf.copy(STRING_WITH_LEN(","), &my_charset_bin, collation.collation, &errors);
sep = &sep_buf; sep = &sep_buf;
}
break; break;
default: default:
DBUG_ASSERT(0); // cannot happen DBUG_ASSERT(0); // cannot happen
......
...@@ -43,7 +43,10 @@ class Item_func_md5 :public Item_str_func ...@@ -43,7 +43,10 @@ class Item_func_md5 :public Item_str_func
{ {
String tmp_value; String tmp_value;
public: public:
Item_func_md5(Item *a) :Item_str_func(a) {} Item_func_md5(Item *a) :Item_str_func(a)
{
collation.set(&my_charset_bin);
}
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "md5"; } const char *func_name() const { return "md5"; }
...@@ -53,7 +56,10 @@ public: ...@@ -53,7 +56,10 @@ public:
class Item_func_sha :public Item_str_func class Item_func_sha :public Item_str_func
{ {
public: public:
Item_func_sha(Item *a) :Item_str_func(a) {} Item_func_sha(Item *a) :Item_str_func(a)
{
collation.set(&my_charset_bin);
}
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "sha"; } const char *func_name() const { return "sha"; }
...@@ -325,9 +331,21 @@ public: ...@@ -325,9 +331,21 @@ public:
class Item_func_encrypt :public Item_str_func class Item_func_encrypt :public Item_str_func
{ {
String tmp_value; String tmp_value;
/* Encapsulate common constructor actions */
void constructor_helper()
{
collation.set(&my_charset_bin);
}
public: public:
Item_func_encrypt(Item *a) :Item_str_func(a) {} Item_func_encrypt(Item *a) :Item_str_func(a)
Item_func_encrypt(Item *a, Item *b): Item_str_func(a,b) {} {
constructor_helper();
}
Item_func_encrypt(Item *a, Item *b): Item_str_func(a,b)
{
constructor_helper();
}
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec() { maybe_null=1; max_length = 13; } void fix_length_and_dec() { maybe_null=1; max_length = 13; }
const char *func_name() const { return "encrypt"; } const char *func_name() const { return "encrypt"; }
......
...@@ -224,7 +224,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, ...@@ -224,7 +224,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
tmp= (char*) val + min(2, val_len); tmp= (char*) val + min(2, val_len);
l_time->day= (int) my_strtoll10(val, &tmp, &error); l_time->day= (int) my_strtoll10(val, &tmp, &error);
/* Skip 'st, 'nd, 'th .. */ /* Skip 'st, 'nd, 'th .. */
val= tmp + min((int) (end-tmp), 2); val= tmp + min((int) (val_end-tmp), 2);
break; break;
/* Hour */ /* Hour */
......
...@@ -874,6 +874,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, ...@@ -874,6 +874,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
sql_print_information("X509 issuer mismatch: should be '%s' " sql_print_information("X509 issuer mismatch: should be '%s' "
"but is '%s'", acl_user->x509_issuer, ptr); "but is '%s'", acl_user->x509_issuer, ptr);
free(ptr); free(ptr);
user_access=NO_ACCESS;
break; break;
} }
user_access= acl_user->access; user_access= acl_user->access;
...@@ -889,10 +890,12 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, ...@@ -889,10 +890,12 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
if (strcmp(acl_user->x509_subject,ptr)) if (strcmp(acl_user->x509_subject,ptr))
{ {
if (global_system_variables.log_warnings) if (global_system_variables.log_warnings)
sql_print_information("X509 subject mismatch: '%s' vs '%s'", sql_print_information("X509 subject mismatch: should be '%s' but is '%s'",
acl_user->x509_subject, ptr); acl_user->x509_subject, ptr);
free(ptr);
user_access=NO_ACCESS;
break;
} }
else
user_access= acl_user->access; user_access= acl_user->access;
free(ptr); free(ptr);
} }
...@@ -5462,8 +5465,6 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list) ...@@ -5462,8 +5465,6 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
} }
if (!find_acl_user(lex_user->host.str, lex_user->user.str, TRUE)) if (!find_acl_user(lex_user->host.str, lex_user->user.str, TRUE))
{ {
sql_print_error("REVOKE ALL PRIVILEGES, GRANT: User '%s'@'%s' does not "
"exists", lex_user->user.str, lex_user->host.str);
result= -1; result= -1;
continue; continue;
} }
......
...@@ -1040,6 +1040,8 @@ int MYSQLlex(void *arg, void *yythd) ...@@ -1040,6 +1040,8 @@ int MYSQLlex(void *arg, void *yythd)
if (c == '.') if (c == '.')
lex->next_state=MY_LEX_IDENT_SEP; lex->next_state=MY_LEX_IDENT_SEP;
length= (uint) (lex->ptr - lex->tok_start)-1; length= (uint) (lex->ptr - lex->tok_start)-1;
if (length == 0)
return(ABORT_SYM); // Names must be nonempty.
if ((tokval= find_keyword(lex,length,0))) if ((tokval= find_keyword(lex,length,0)))
{ {
yyUnget(); // Put back 'c' yyUnget(); // Put back 'c'
......
...@@ -677,6 +677,9 @@ fi ...@@ -677,6 +677,9 @@ fi
%attr(755, root, root) %{_bindir}/ndb_show_tables %attr(755, root, root) %{_bindir}/ndb_show_tables
%attr(755, root, root) %{_bindir}/ndb_test_platform %attr(755, root, root) %{_bindir}/ndb_test_platform
%attr(755, root, root) %{_bindir}/ndb_config %attr(755, root, root) %{_bindir}/ndb_config
%attr(755, root, root) %{_bindir}/ndb_error_reporter
%attr(755, root, root) %{_bindir}/ndb_size.pl
%attr(-, root, root) %{_datadir}/mysql/ndb_size.tmpl
%files ndb-extra %files ndb-extra
%defattr(-,root,root,0755) %defattr(-,root,root,0755)
......
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