Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-maint

into  salvation.intern.azundris.com:/home/tnurnberg/mysql-5.1-maint
parents 030cbd2f a21ec5db
...@@ -1957,6 +1957,9 @@ com_charset(String *buffer __attribute__((unused)), char *line) ...@@ -1957,6 +1957,9 @@ com_charset(String *buffer __attribute__((unused)), char *line)
if (new_cs) if (new_cs)
{ {
charset_info= new_cs; charset_info= new_cs;
mysql_set_character_set(&mysql, charset_info->csname);
default_charset= (char *)charset_info->csname;
default_charset_used= 1;
put_info("Charset changed", INFO_INFO); put_info("Charset changed", INFO_INFO);
} }
else put_info("Charset is not found", INFO_INFO); else put_info("Charset is not found", INFO_INFO);
......
...@@ -150,3 +150,4 @@ ...@@ -150,3 +150,4 @@
#define MD5_Init yaMD5_Init #define MD5_Init yaMD5_Init
#define MD5_Update yaMD5_Update #define MD5_Update yaMD5_Update
#define MD5_Final yaMD5_Final #define MD5_Final yaMD5_Final
#define SSL_peek yaSSL_peek
...@@ -122,6 +122,10 @@ extern "C" { ...@@ -122,6 +122,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"
......
...@@ -5140,6 +5140,16 @@ insert t1 values (1),(2),(3),(4),(5); ...@@ -5140,6 +5140,16 @@ 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;
create table t1 (v varchar(32)); create table t1 (v varchar(32));
insert into t1 values ('def'),('abc'),('hij'),('3r4f'); insert into t1 values ('def'),('abc'),('hij'),('3r4f');
select * from t1; select * from t1;
......
...@@ -59,16 +59,16 @@ database() ...@@ -59,16 +59,16 @@ database()
test test
unlock tables; unlock tables;
drop table t1; drop table t1;
\
\
c_cp932 c_cp932
\
\
\
\
\
+----------------------+------------+--------+ +----------------------+------------+--------+
| concat('>',col1,'<') | col2 | col3 | | concat('>',col1,'<') | col2 | col3 |
+----------------------+------------+--------+ +----------------------+------------+--------+
......
...@@ -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
......
...@@ -1532,6 +1532,30 @@ truncate table t1; -- truncate ...@@ -1532,6 +1532,30 @@ 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;
# #
# Some additional tests for new, faster alter table. Note that most of the # Some additional tests for new, faster alter table. Note that most of the
# whole alter table code is being tested all around the test suite already. # whole alter table code is being tested all around the test suite already.
......
...@@ -52,8 +52,8 @@ drop table t1; ...@@ -52,8 +52,8 @@ drop table t1;
--exec $MYSQL --default-character-set=cp932 test -e "charset utf8;" --exec $MYSQL --default-character-set=cp932 test -e "charset utf8;"
# its usage to switch internally in mysql to requested charset # its usage to switch internally in mysql to requested charset
--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; set @@session.character_set_client= cp932; select '\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('\'); select * from t1; drop table t1;" --exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select '\'; create table t1 (c_cp932 TEXT CHARACTER SET cp932); insert into t1 values('\'); select * from t1; drop table t1;"
--exec $MYSQL --default-character-set=utf8 test -e "charset cp932; set character_set_client= cp932; select '\'" --exec $MYSQL --default-character-set=utf8 test -e "charset cp932; select '\'"
--exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set character_set_client= cp932; select '\'" --exec $MYSQL --default-character-set=utf8 test -e "/*charset cp932 */; set character_set_client= cp932; select '\'"
--exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set character_set_client= cp932; select '\'" --exec $MYSQL --default-character-set=utf8 test -e "/*!\C cp932 */; set character_set_client= cp932; select '\'"
......
...@@ -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;
......
...@@ -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 */
......
...@@ -1006,6 +1006,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, ...@@ -1006,6 +1006,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;
...@@ -1021,10 +1022,12 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, ...@@ -1021,10 +1022,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);
} }
......
...@@ -263,6 +263,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table) ...@@ -263,6 +263,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
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));
......
...@@ -14993,8 +14993,6 @@ static void test_bug17667() ...@@ -14993,8 +14993,6 @@ static void test_bug17667()
DIE("Read error"); DIE("Read error");
} }
} }
/* Print the line */
printf("%s", line_buffer);
} while (my_memmem(line_buffer, MAX_TEST_QUERY_LENGTH*2, } while (my_memmem(line_buffer, MAX_TEST_QUERY_LENGTH*2,
statement_cursor->buffer, statement_cursor->length) == NULL); statement_cursor->buffer, statement_cursor->length) == NULL);
......
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