diff --git a/Makefile.am b/Makefile.am index 81146f9aa82..4e648dabe27 100644 --- a/Makefile.am +++ b/Makefile.am @@ -119,54 +119,37 @@ tags: # making sure each user use different ports. test: - cd mysql-test ; \ - ./mysql-test-run --mysqld=--binlog-format=statement && \ - ./mysql-test-run --ps-protocol --mysqld=--binlog-format=row - -test-full: - cd mysql-test ; \ - ./mysql-test-run --mysqld=--binlog-format=statement && \ - ./mysql-test-run --ps-protocol --mysqld=--binlog-format=statement && \ - ./mysql-test-run --mysqld=--binlog-format=row && \ - ./mysql-test-run --ps-protocol --mysqld=--binlog-format=row - -test-force: - cd mysql-test ; \ - ./mysql-test-run --force --mysqld=--binlog-format=statement && \ - ./mysql-test-run --ps-protocol --force --mysqld=--binlog-format=row - -test-force-full: - cd mysql-test ; \ - ./mysql-test-run --force --mysqld=--binlog-format=statement && \ - ./mysql-test-run --force --ps-protocol --mysqld=--binlog-format=statement && \ - ./mysql-test-run --force --mysqld=--binlog-format=row && \ - ./mysql-test-run --force --ps-protocol --mysqld=--binlog-format=row - -# We are testing a new Perl version of the test script -test-pl: cd mysql-test ; \ ./mysql-test-run.pl --mysqld=--binlog-format=statement && \ ./mysql-test-run.pl --ps-protocol --mysqld=--binlog-format=row -test-full-pl: +test-full: cd mysql-test ; \ ./mysql-test-run.pl --mysqld=--binlog-format=statement && \ ./mysql-test-run.pl --ps-protocol --mysqld=--binlog-format=statement && \ ./mysql-test-run.pl --mysqld=--binlog-format=row && \ ./mysql-test-run.pl --ps-protocol --mysqld=--binlog-format=row -test-force-pl: +test-force: cd mysql-test ; \ ./mysql-test-run.pl --force --mysqld=--binlog-format=statement && \ ./mysql-test-run.pl --ps-protocol --force --mysqld=--binlog-format=row -test-force-full-pl: +test-force-full: cd mysql-test ; \ ./mysql-test-run.pl --force --mysqld=--binlog-format=statement && \ ./mysql-test-run.pl --force --ps-protocol --mysqld=--binlog-format=statement && \ ./mysql-test-run.pl --force --mysqld=--binlog-format=row && \ ./mysql-test-run.pl --force --ps-protocol --mysqld=--binlog-format=row +# Keep these for a while +test-pl: test +test-full-pl: test-full +test-force-pl: test-force +test-force-full-pl: test-force-full + + + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/client/mysql.cc b/client/mysql.cc index 2001056dea1..077ea69c3ca 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -3212,10 +3212,9 @@ com_status(String *buffer __attribute__((unused)), mysql_free_result(result); } #ifdef HAVE_OPENSSL - if (mysql.net.vio && mysql.net.vio->ssl_arg && - SSL_get_cipher((SSL*) mysql.net.vio->ssl_arg)) + if ((status= mysql_get_ssl_cipher(&mysql))) tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n", - SSL_get_cipher((SSL*) mysql.net.vio->ssl_arg)); + status); else #endif /* HAVE_OPENSSL */ tee_puts("SSL:\t\t\tNot in use", stdout); diff --git a/include/mysql.h b/include/mysql.h index 925a4525378..6217ce631b5 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -409,6 +409,7 @@ MYSQL * STDCALL mysql_init(MYSQL *mysql); my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert, const char *ca, const char *capath, const char *cipher); +const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql); my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db); MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index a641bdf2f10..c2d98a81042 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -85,6 +85,7 @@ DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DDEFAULT_HOME_ENV=MYSQL_HOME \ -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \ + -DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs) if HAVE_YASSL diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index a469c67c466..cf45e20a697 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -65,6 +65,7 @@ EXPORTS mysql_get_proto_info mysql_get_server_info mysql_get_client_version + mysql_get_ssl_cipher mysql_info mysql_init mysql_insert_id diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 62e4aafef7e..e63db73d8f4 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -7,6 +7,18 @@ # List of failed cases (--force) backported from 4.1 by Joerg # :-) + +echo "##################################################"; +echo "This script is deprecated and will soon be removed"; +echo "Use mysql-test-run.pl instead"; +echo "Now sleeping 20 seconds..."; +echo "##################################################"; +sleep 20; +echo "continuing"; +echo; + + + #++ # Access Definitions #-- diff --git a/mysql-test/r/ndb_alter_table2.result b/mysql-test/r/ndb_alter_table2.result new file mode 100644 index 00000000000..0d2e2289f91 --- /dev/null +++ b/mysql-test/r/ndb_alter_table2.result @@ -0,0 +1,42 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +a INT NOT NULL PRIMARY KEY, +b INT NOT NULL +) ENGINE=ndbcluster; +BEGIN; +INSERT INTO t1 VALUES (9410,9412); +BEGIN; +INSERT INTO t1 VALUES (9411,9412); +BEGIN; +INSERT INTO t1 VALUES (9412,9412); +BEGIN; +INSERT INTO t1 VALUES (9413,9412); +BEGIN; +INSERT INTO t1 VALUES (9414,9412); +BEGIN; +INSERT INTO t1 VALUES (9415,9412); +ROLLBACK; +ROLLBACK; +ROLLBACK; +ROLLBACK; +ROLLBACK; +ROLLBACK; +drop table t1; +CREATE TABLE t1 ( +a INT NOT NULL PRIMARY KEY, +b INT NOT NULL, +c INT NOT NULL +) ENGINE=ndbcluster; +select * from t1; +a b c +select * from t1; +a b c +select * from t1; +a b c +select * from t1; +a b c +select * from t1; +a b c +select * from t1; +a b c +drop table t1; diff --git a/mysql-test/t/ndb_alter_table2.test b/mysql-test/t/ndb_alter_table2.test new file mode 100644 index 00000000000..4464f37a030 --- /dev/null +++ b/mysql-test/t/ndb_alter_table2.test @@ -0,0 +1,82 @@ +-- source include/have_ndb.inc +-- source include/have_multi_ndb.inc +-- source include/not_embedded.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +connect (con1,localhost,root,,test); +connect (con2,localhost,root,,test); +connect (con3,localhost,root,,test); +connect (con4,localhost,root,,test); +connect (con5,localhost,root,,test); +connect (con6,localhost,root,,test); + +CREATE TABLE t1 ( + a INT NOT NULL PRIMARY KEY, + b INT NOT NULL +) ENGINE=ndbcluster; + +connection con1; +BEGIN; +INSERT INTO t1 VALUES (9410,9412); +connection con2; +BEGIN; +--send +INSERT INTO t1 VALUES (9411,9412); +connection con3; +BEGIN; +--send +INSERT INTO t1 VALUES (9412,9412); +connection con4; +BEGIN; +--send +INSERT INTO t1 VALUES (9413,9412); +connection con5; +BEGIN; +--send +INSERT INTO t1 VALUES (9414,9412); +connection con6; +BEGIN; +--send +INSERT INTO t1 VALUES (9415,9412); +connection con1; +sleep 1; + +ROLLBACK; +connection con2; +reap; +ROLLBACK; +connection con3; +reap; +ROLLBACK; +connection con4; +reap; +ROLLBACK; +connection con5; +reap; +ROLLBACK; +connection con6; +reap; +ROLLBACK; + +connection server2; + +drop table t1; +CREATE TABLE t1 ( + a INT NOT NULL PRIMARY KEY, + b INT NOT NULL, + c INT NOT NULL +) ENGINE=ndbcluster; + +connection server1; + +select * from t1; +select * from t1; +select * from t1; +select * from t1; +select * from t1; +select * from t1; + +drop table t1; diff --git a/mysys/Makefile.am b/mysys/Makefile.am index 0d9d9c65826..7a66164b775 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -70,6 +70,7 @@ DEFS = -DDEFAULT_BASEDIR=\"$(prefix)\" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ -DDEFAULT_HOME_ENV=MYSQL_HOME \ -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \ + -DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \ @DEFS@ libmysys_a_DEPENDENCIES= @THREAD_LOBJECTS@ diff --git a/mysys/default.c b/mysys/default.c index edd02402a2a..90f8dc5f689 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -48,7 +48,7 @@ char *defaults_extra_file=0; /* Which directories are searched for options (and in which order) */ -#define MAX_DEFAULT_DIRS 6 +#define MAX_DEFAULT_DIRS 7 const char *default_directories[MAX_DEFAULT_DIRS + 1]; #ifdef __WIN__ @@ -959,11 +959,13 @@ static uint my_get_system_windows_directory(char *buffer, uint size) 4. getenv(DEFAULT_HOME_ENV) 5. Directory above where the executable is located 6. "" + 7. --sysconfdir= On Novell NetWare, this is: 1. sys:/etc/ 2. getenv(DEFAULT_HOME_ENV) 3. "" + 4. --sysconfdir= On OS/2, this is: 1. getenv(ETC) @@ -971,12 +973,14 @@ static uint my_get_system_windows_directory(char *buffer, uint size) 3. getenv(DEFAULT_HOME_ENV) 4. "" 5. "~/" + 6. --sysconfdir= Everywhere else, this is: 1. /etc/ 2. getenv(DEFAULT_HOME_ENV) 3. "" 4. "~/" + 5. --sysconfdir= */ @@ -1040,6 +1044,10 @@ static void init_default_directories() } *ptr++= (char *)&config_dir; } +#endif +#ifdef DEFAULT_SYSCONFDIR + if (DEFAULT_SYSCONFDIR != "") + *ptr++= DEFAULT_SYSCONFDIR; #endif *ptr= 0; /* end marker */ } diff --git a/sql-common/client.c b/sql-common/client.c index 84df31b7440..72745d72b12 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1535,6 +1535,27 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused))) mysql->connector_fd = 0; DBUG_VOID_RETURN; } + + +/* + Return the SSL cipher (if any) used for current + connection to the server. + + SYNOPSYS + mysql_get_ssl_cipher() + mysql pointer to the mysql connection + +*/ + +const char * STDCALL +mysql_get_ssl_cipher(MYSQL *mysql) +{ + DBUG_ENTER("mysql_get_ssl_cipher"); + if (mysql->net.vio && mysql->net.vio->ssl_arg) + DBUG_RETURN(SSL_get_cipher_name((SSL*)mysql->net.vio->ssl_arg)); + DBUG_RETURN(NULL); +} + #endif /* HAVE_OPENSSL */ diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index a4193e4eb33..32ed9b00e10 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -556,8 +556,16 @@ int ha_ndbcluster::ndb_err(NdbTransaction *trans) ERR_PRINT(err); switch (err.classification) { case NdbError::SchemaError: + { invalidate_dictionary_cache(TRUE); + /* Close other open handlers not used by any thread */ + TABLE_LIST table_list; + bzero((char*) &table_list,sizeof(table_list)); + table_list.db= m_dbname; + table_list.alias= table_list.table_name= m_tabname; + close_cached_tables(current_thd, 0, &table_list); + if (err.code==284) { /* @@ -576,6 +584,7 @@ int ha_ndbcluster::ndb_err(NdbTransaction *trans) DBUG_PRINT("info", ("Table exists but must have changed")); } break; + } default: break; }