summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <iggy@rolltop.ignatz42.dyndns.org>2006-08-24 15:03:33 -0400
committerunknown <iggy@rolltop.ignatz42.dyndns.org>2006-08-24 15:03:33 -0400
commit749242b683370f5b414f85f6d6aea43a9bea0fdc (patch)
treeed7a651a050b4e7410de707fa5026cc568d6cf68
parentfd989054c728bbe830678aefedefc11e46577936 (diff)
parent37c33a0ff605e89a5336af0a9601e8b4f4eeb0a5 (diff)
downloadmariadb-git-749242b683370f5b414f85f6d6aea43a9bea0fdc.tar.gz
Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-5.0-maint_11972
into rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-5.1-new-maint_11972 BitKeeper/etc/ignore: auto-union client/mysql.cc: Auto merged client/mysql_upgrade.c: Auto merged include/config-netware.h: Auto merged mysql-test/r/func_time.result: Auto merged mysql-test/r/variables.result: Auto merged mysql-test/t/func_time.test: Auto merged mysql-test/t/mysql.test: Auto merged mysql-test/t/variables.test: Auto merged sql/gen_lex_hash.cc: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/item_timefunc.cc: Auto merged sql/slave.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_lex.cc: Auto merged support-files/mysql.spec.sh: Auto merged tests/mysql_client_test.c: Auto merged mysql-test/r/csv.result: manual merge mysql-test/t/csv.test: manual merge storage/csv/ha_tina.cc: manual merge
-rw-r--r--client/mysql.cc3
-rw-r--r--extra/yassl/include/openssl/prefix_ssl.h1
-rw-r--r--include/config-netware.h4
-rw-r--r--mysql-test/r/csv.result10
-rw-r--r--mysql-test/r/mysql.result14
-rw-r--r--mysql-test/r/openssl_1.result9
-rw-r--r--mysql-test/t/csv.test24
-rw-r--r--mysql-test/t/mysql.test4
-rw-r--r--mysql-test/t/openssl_1.test10
-rw-r--r--sql/item_timefunc.cc2
-rw-r--r--sql/sql_acl.cc9
-rw-r--r--storage/csv/ha_tina.cc1
-rw-r--r--tests/mysql_client_test.c2
13 files changed, 72 insertions, 21 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 2f1efc3b02a..772601d8874 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1957,6 +1957,9 @@ com_charset(String *buffer __attribute__((unused)), char *line)
if (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);
}
else put_info("Charset is not found", INFO_INFO);
diff --git a/extra/yassl/include/openssl/prefix_ssl.h b/extra/yassl/include/openssl/prefix_ssl.h
index 7f815156f47..0d740b6b97e 100644
--- a/extra/yassl/include/openssl/prefix_ssl.h
+++ b/extra/yassl/include/openssl/prefix_ssl.h
@@ -150,3 +150,4 @@
#define MD5_Init yaMD5_Init
#define MD5_Update yaMD5_Update
#define MD5_Final yaMD5_Final
+#define SSL_peek yaSSL_peek
diff --git a/include/config-netware.h b/include/config-netware.h
index e2fc75ab90d..c30fc099985 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -122,6 +122,10 @@ extern "C" {
/* On NetWare, to fix the problem with the deletion of open files */
#define CANT_DELETE_OPEN_FILES 1
+#define FN_LIBCHAR '\\'
+#define FN_ROOTDIR "\\"
+#define FN_DEVCHAR ':'
+
/* default directory information */
#define DEFAULT_MYSQL_HOME "sys:/mysql"
#define PACKAGE "mysql"
diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result
index 04f0636d400..85cb5c9b1b8 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5140,6 +5140,16 @@ insert t1 values (1),(2),(3),(4),(5);
truncate table t1;
affected rows: 0
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));
insert into t1 values ('def'),('abc'),('hij'),('3r4f');
select * from t1;
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index ba4e9daf7cb..99633f5e12a 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -59,16 +59,16 @@ database()
test
unlock tables;
drop table t1;
-ソ
-ソ
+ƒ\
+ƒ\
c_cp932
+ƒ\
+ƒ\
+ƒ\
ソ
ソ
-ソ
-ソ
-ソ
-ソ
-ソ
+ƒ\
+ƒ\
+----------------------+------------+--------+
| concat('>',col1,'<') | col2 | col3 |
+----------------------+------------+--------+
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index 1fcfb11525e..8f9fd50eced 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -3,9 +3,12 @@ create table t1(f1 int);
insert into t1 values (5);
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_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_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_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/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;
+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';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
@@ -39,7 +42,7 @@ f1
delete from t1;
ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1'
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;
mysqltest: Could not open connection 'default': 2026 SSL connection error
mysqltest: Could not open connection 'default': 2026 SSL connection error
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test
index 9ba99167ab9..6b4cd34da06 100644
--- a/mysql-test/t/csv.test
+++ b/mysql-test/t/csv.test
@@ -1533,6 +1533,30 @@ truncate table t1; -- truncate
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
# whole alter table code is being tested all around the test suite already.
#
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index 385c59d1503..cf4e6f4047c 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -52,8 +52,8 @@ drop table t1;
--exec $MYSQL --default-character-set=cp932 test -e "charset utf8;"
# 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; set character_set_client= cp932; select 'ƒ\'"
+--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; 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 'ƒ\'"
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index afee381f5b7..49f8fc4d7d4 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -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_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_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_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/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;
connect (con1,localhost,ssl_user1,,,,,SSL);
connect (con2,localhost,ssl_user2,,,,,SSL);
connect (con3,localhost,ssl_user3,,,,,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;
# Check ssl turned on
@@ -49,7 +53,7 @@ delete from t1;
connection default;
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;
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index f603cafd89d..a259fd90485 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -224,7 +224,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
tmp= (char*) val + min(2, val_len);
l_time->day= (int) my_strtoll10(val, &tmp, &error);
/* Skip 'st, 'nd, 'th .. */
- val= tmp + min((int) (end-tmp), 2);
+ val= tmp + min((int) (val_end-tmp), 2);
break;
/* Hour */
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index a232406f723..1b2ab853ec7 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1006,6 +1006,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
sql_print_information("X509 issuer mismatch: should be '%s' "
"but is '%s'", acl_user->x509_issuer, ptr);
free(ptr);
+ user_access=NO_ACCESS;
break;
}
user_access= acl_user->access;
@@ -1021,11 +1022,13 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
if (strcmp(acl_user->x509_subject,ptr))
{
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);
+ free(ptr);
+ user_access=NO_ACCESS;
+ break;
}
- else
- user_access= acl_user->access;
+ user_access= acl_user->access;
free(ptr);
}
break;
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index bec236becd0..6d770aedd10 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -263,6 +263,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table)
error2:
thr_lock_delete(&share->lock);
pthread_mutex_destroy(&share->mutex);
+ hash_delete(&tina_open_tables, (byte*) share);
error:
pthread_mutex_unlock(&tina_mutex);
my_free((gptr) share, MYF(0));
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 0b57e5a555b..5273bf1667b 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -14993,8 +14993,6 @@ static void test_bug17667()
DIE("Read error");
}
}
- /* Print the line */
- printf("%s", line_buffer);
} while (my_memmem(line_buffer, MAX_TEST_QUERY_LENGTH*2,
statement_cursor->buffer, statement_cursor->length) == NULL);