Commit 5ea224b8 authored by ingo@mysql.com's avatar ingo@mysql.com

Merge mysql.com:/home/mydev/mysql-4.1

into mysql.com:/home/mydev/mysql-4.1-4100
parents 88c434a9 7084b494
...@@ -1004,3 +1004,6 @@ vio/test-sslserver ...@@ -1004,3 +1004,6 @@ vio/test-sslserver
vio/viotest-ssl vio/viotest-ssl
tests/mysql_client_test tests/mysql_client_test
tests/mysql_client_test tests/mysql_client_test
libmysqld/examples/mysql_client_test.c
libmysqld/examples/mysql_client_test_embedded
libmysqld/examples/mysqltest_embedded
#!/bin/sh
if ! test -f sql/mysqld.cc if ! test -f sql/mysqld.cc
then then
echo "You must run this script from the MySQL top-level directory" echo "You must run this script from the MySQL top-level directory"
...@@ -49,6 +51,7 @@ max_configs="$max_no_es_configs --with-embedded-server" ...@@ -49,6 +51,7 @@ max_configs="$max_no_es_configs --with-embedded-server"
alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet
amd64_cflags="-DBIG_TABLES" amd64_cflags="-DBIG_TABLES"
pentium_cflags="-mcpu=pentiumpro" pentium_cflags="-mcpu=pentiumpro"
pentium64_cflags="-mcpu=nocona -m64"
ppc_cflags="-mpowerpc -mcpu=powerpc" ppc_cflags="-mpowerpc -mcpu=powerpc"
sparc_cflags="" sparc_cflags=""
......
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $debug_cflags"
c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs $static_link"
extra_configs="$extra_configs "
. "$path/FINISH.sh"
...@@ -687,7 +687,7 @@ static int parse_args(int *argc, char*** argv) ...@@ -687,7 +687,7 @@ static int parse_args(int *argc, char*** argv)
static MYSQL* safe_connect() static MYSQL* safe_connect()
{ {
MYSQL *local_mysql = mysql_init(NULL); MYSQL *local_mysql= mysql_init(NULL);
if (!local_mysql) if (!local_mysql)
die("Failed on mysql_init"); die("Failed on mysql_init");
...@@ -695,8 +695,12 @@ static MYSQL* safe_connect() ...@@ -695,8 +695,12 @@ static MYSQL* safe_connect()
if (opt_protocol) if (opt_protocol)
mysql_options(local_mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); mysql_options(local_mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0)) if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0))
die("failed on connect: %s", mysql_error(local_mysql)); {
char errmsg[256];
strmake(errmsg, mysql_error(local_mysql), sizeof(errmsg)-1);
mysql_close(local_mysql);
die("failed on connect: %s", errmsg);
}
return local_mysql; return local_mysql;
} }
...@@ -717,7 +721,12 @@ static int check_master_version(MYSQL* mysql) ...@@ -717,7 +721,12 @@ static int check_master_version(MYSQL* mysql)
if (mysql_query(mysql, "SELECT VERSION()") || if (mysql_query(mysql, "SELECT VERSION()") ||
!(res = mysql_store_result(mysql))) !(res = mysql_store_result(mysql)))
die("Error checking master version: %s", mysql_error(mysql)); {
char errmsg[256];
strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1);
mysql_close(mysql);
die("Error checking master version: %s", errmsg);
}
if (!(row = mysql_fetch_row(res))) if (!(row = mysql_fetch_row(res)))
{ {
mysql_free_result(res); mysql_free_result(res);
......
...@@ -205,8 +205,6 @@ eval_node_copy_and_alloc_val( ...@@ -205,8 +205,6 @@ eval_node_copy_and_alloc_val(
{ {
byte* data; byte* data;
ut_ad(UNIV_SQL_NULL > ULINT_MAX);
if (len == UNIV_SQL_NULL) { if (len == UNIV_SQL_NULL) {
dfield_set_len(que_node_get_val(node), len); dfield_set_len(que_node_get_val(node), len);
......
...@@ -241,6 +241,7 @@ USE_EMBEDDED_SERVER="" ...@@ -241,6 +241,7 @@ USE_EMBEDDED_SERVER=""
RESULT_EXT="" RESULT_EXT=""
TEST_MODE="default" TEST_MODE="default"
NDB_MGM_EXTRA_OPTS=
NDB_MGMD_EXTRA_OPTS= NDB_MGMD_EXTRA_OPTS=
NDBD_EXTRA_OPTS= NDBD_EXTRA_OPTS=
...@@ -264,6 +265,8 @@ while test $# -gt 0; do ...@@ -264,6 +265,8 @@ while test $# -gt 0; do
--ndb-connectstring=*) --ndb-connectstring=*)
USE_NDBCLUSTER="--ndbcluster" ; USE_NDBCLUSTER="--ndbcluster" ;
USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;; USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;;
--ndb_mgm-extra-opts=*)
NDB_MGM_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgm-extra-opts=;;"` ;;
--ndb_mgmd-extra-opts=*) --ndb_mgmd-extra-opts=*)
NDB_MGMD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgmd-extra-opts=;;"` ;; NDB_MGMD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgmd-extra-opts=;;"` ;;
--ndbd-extra-opts=*) --ndbd-extra-opts=*)
...@@ -467,7 +470,8 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M" ...@@ -467,7 +470,8 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M"
export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1 export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1
NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2` NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2`
NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgmd-extra-opts=\"$NDB_MGMD_EXTRA_OPTS\" --ndbd-extra-opts=\"$NDBD_EXTRA_OPTS\"" NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgm-extra-opts=$NDB_MGM_EXTRA_OPTS --ndb_mgmd-extra-opts=$NDB_MGMD_EXTRA_OPTS --ndbd-extra-opts=$NDBD_EXTRA_OPTS"
NDB_BACKUP_DIR=$MYSQL_TEST_DIR/var/ndbcluster-$NDBCLUSTER_PORT
if [ x$SOURCE_DIST = x1 ] ; then if [ x$SOURCE_DIST = x1 ] ; then
MY_BASEDIR=$MYSQL_TEST_DIR MY_BASEDIR=$MYSQL_TEST_DIR
...@@ -632,6 +636,7 @@ export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES ...@@ -632,6 +636,7 @@ export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES
export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR
export NDB_TOOLS_DIR export NDB_TOOLS_DIR
export NDB_MGM export NDB_MGM
export NDB_BACKUP_DIR
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
--user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
......
...@@ -58,6 +58,7 @@ ndb_con_op=105000 ...@@ -58,6 +58,7 @@ ndb_con_op=105000
ndb_dmem=80M ndb_dmem=80M
ndb_imem=24M ndb_imem=24M
NDB_MGM_EXTRA_OPTS=
NDB_MGMD_EXTRA_OPTS= NDB_MGMD_EXTRA_OPTS=
NDBD_EXTRA_OPTS= NDBD_EXTRA_OPTS=
...@@ -97,6 +98,9 @@ while test $# -gt 0; do ...@@ -97,6 +98,9 @@ while test $# -gt 0; do
--port-base=*) --port-base=*)
port_base=`echo "$1" | sed -e "s;--port-base=;;"` port_base=`echo "$1" | sed -e "s;--port-base=;;"`
;; ;;
--ndb_mgm-extra-opts=*)
NDB_MGM_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgm-extra-opts=;;"`
;;
--ndb_mgmd-extra-opts=*) --ndb_mgmd-extra-opts=*)
NDB_MGMD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgmd-extra-opts=;;"` NDB_MGMD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgmd-extra-opts=;;"`
;; ;;
...@@ -130,7 +134,7 @@ if [ ! -x "$exec_waiter" ]; then ...@@ -130,7 +134,7 @@ if [ ! -x "$exec_waiter" ]; then
exit 1 exit 1
fi fi
exec_mgmtclient="$exec_mgmtclient --no-defaults" exec_mgmtclient="$exec_mgmtclient --no-defaults $NDB_MGM_EXTRA_OPTS"
exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $NDB_MGMD_EXTRA_OPTS" exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $NDB_MGMD_EXTRA_OPTS"
exec_ndb="$exec_ndb --no-defaults $NDBD_EXTRA_OPTS" exec_ndb="$exec_ndb --no-defaults $NDBD_EXTRA_OPTS"
exec_waiter="$exec_waiter --no-defaults" exec_waiter="$exec_waiter --no-defaults"
...@@ -178,8 +182,8 @@ fi ...@@ -178,8 +182,8 @@ fi
# Edit file system path and ports in config file # Edit file system path and ports in config file
if [ $initial_ndb ] ; then if [ $initial_ndb ] ; then
rm -f $fs_ndb/ndb_* rm -f $fs_ndb/ndb_* 2>&1 | cat > /dev/null
sed \ sed \
-e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \ -e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \
-e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \ -e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \
-e s,"CHOOSE_DataMemory","$ndb_dmem",g \ -e s,"CHOOSE_DataMemory","$ndb_dmem",g \
......
DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3; DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3,tT;
DROP DATABASE IF EXISTS `TEST_$1`; DROP DATABASE IF EXISTS `TEST_$1`;
DROP DATABASE IF EXISTS `test_$1`; DROP DATABASE IF EXISTS `test_$1`;
CREATE TABLE T1 (a int); CREATE TABLE T1 (a int);
...@@ -131,3 +131,13 @@ show tables like 't1%'; ...@@ -131,3 +131,13 @@ show tables like 't1%';
Tables_in_test (t1%) Tables_in_test (t1%)
t1 t1
drop table t1; drop table t1;
create temporary table tT(a int(11), b varchar(8));
insert into tT values (1, 'abc');
select * from tT;
a b
1 abc
alter table tT add index (a);
select * from tT;
a b
1 abc
drop table tT;
use test;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
CREATE TABLE `t1` (
`capgoaledatta` smallint(5) unsigned NOT NULL auto_increment,
`goaledatta` char(2) NOT NULL default '',
`maturegarbagefa` varchar(32) NOT NULL default '',
PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t1` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt');
CREATE TABLE `t2` (
`capgotod` smallint(5) unsigned NOT NULL auto_increment,
`gotod` smallint(5) unsigned NOT NULL default '0',
`goaledatta` char(2) default NULL,
`maturegarbagefa` varchar(32) default NULL,
`descrpooppo` varchar(64) default NULL,
`svcutonsa` varchar(64) NOT NULL default '',
PRIMARY KEY (`capgotod`),
KEY `i_quadaddsvr` (`gotod`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t2` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
CREATE TABLE `t3` (
`CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
`capgotod` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`capgotod`,`CapGoaledatta`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t3` VALUES (5,3),(2,4),(5,4),(1,3);
CREATE TABLE `t4` (
`capfa` bigint(20) unsigned NOT NULL auto_increment,
`realm` varchar(32) NOT NULL default '',
`authpwchap` varchar(32) default NULL,
`fa` varchar(32) NOT NULL default '',
`payyingatta` tinyint(4) NOT NULL default '0',
`status` char(1) default NULL,
PRIMARY KEY (`fa`,`realm`),
KEY `capfa` (`capfa`),
KEY `i_quadentity` (`fa`,`realm`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t4` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(22,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL);
CREATE TABLE `t5` (
`capfa` bigint(20) unsigned NOT NULL default '0',
`gotod` smallint(5) unsigned NOT NULL default '0',
`orderutonsa` varchar(64) NOT NULL default '',
PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t5` VALUES (21,2,''),(21,1,''),(22,4,'');
CREATE TABLE `t6` (
`capfa_parent` bigint(20) unsigned NOT NULL default '0',
`capfa_child` bigint(20) unsigned NOT NULL default '0',
`relatta` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t6` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0);
CREATE TABLE `t7` (
`dardpo` char(15) NOT NULL default '',
`dardtestard` tinyint(3) unsigned NOT NULL default '0',
`FastFA` char(5) NOT NULL default '',
`FastCode` char(6) NOT NULL default '',
`Fastca` char(1) NOT NULL default '',
`Fastmag` char(1) NOT NULL default '',
`Beareratta` char(2) NOT NULL default '',
PRIMARY KEY (`dardpo`,`dardtestard`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t7` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3');
CREATE TABLE `t8` (
`kattjame` varchar(32) NOT NULL default '',
`realm` varchar(32) NOT NULL default '',
`realm_entered` varchar(32) NOT NULL default '',
`maturegarbagefa` varchar(32) NOT NULL default '',
`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
`kattjame_entered` varchar(32) NOT NULL default '',
`hunderaaarbagefa` varchar(32) NOT NULL default '',
`gest` varchar(16) default NULL,
`hassetino` varchar(16) NOT NULL default '',
`aaaproxysessfa` varchar(255) default NULL,
`autologonallowed` char(1) default NULL,
`squardporoot` varchar(15) NOT NULL default '',
`naspo` varchar(15) default NULL,
`beareratta` char(2) default NULL,
`fastCode` varchar(6) default NULL,
`fastFA` varchar(5) default NULL,
`fastca` char(1) default NULL,
`fastmag` char(1) default NULL,
`lastupdate` datetime default NULL,
`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
`accthassetitime` int(10) unsigned default NULL,
`acctoutputoctets` bigint(20) unsigned default NULL,
`acctinputoctets` bigint(20) unsigned default NULL,
PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`),
KEY `squardporoot` (`squardporoot`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t8` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565);
CREATE TABLE `t9` (
`kattjame` varchar(32) NOT NULL default '',
`kattjame_entered` varchar(32) NOT NULL default '',
`realm` varchar(32) NOT NULL default '',
`realm_entered` varchar(32) NOT NULL default '',
`maturegarbagefa` varchar(32) NOT NULL default '',
`hunderaaarbagefa` varchar(32) NOT NULL default '',
`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
`gest` varchar(16) default NULL,
`hassetino` varchar(16) NOT NULL default '',
`squardporoot` varchar(15) NOT NULL default '',
`naspo` varchar(15) default NULL,
`beareratta` char(2) default NULL,
`fastCode` varchar(6) default NULL,
`fastFA` varchar(5) default NULL,
`fastca` char(1) default NULL,
`fastmag` char(1) default NULL,
`lastupdate` datetime default NULL,
`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
`accthassetitime` int(10) unsigned default NULL,
`actcoutpuocttets` bigint(20) unsigned default NULL,
`actinputocctets` bigint(20) unsigned default NULL,
`terminateraste` tinyint(3) unsigned default NULL,
PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t9` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3);
create table t1_c engine=ndbcluster as select * from t1;
create table t2_c engine=ndbcluster as select * from t2;
create table t3_c engine=ndbcluster as select * from t3;
create table t4_c engine=ndbcluster as select * from t4;
create table t5_c engine=ndbcluster as select * from t5;
create table t6_c engine=ndbcluster as select * from t6;
create table t7_c engine=ndbcluster as select * from t7;
create table t8_c engine=ndbcluster as select * from t8;
create table t9_c engine=ndbcluster as select * from t9;
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
show tables;
Tables_in_test
t1
t2
t3
t4
t5
t6
t7
t8
t9
t8_c
t9_c
t1_c
t7_c
t6_c
t5_c
t4_c
t3_c
t2_c
select count(*) from t1;
count(*)
5
select count(*) from t1_c;
count(*)
5
select count(*)
from (select * from t1 union
select * from t1_c) a;
count(*)
5
select count(*) from t2;
count(*)
6
select count(*) from t2_c;
count(*)
6
select count(*)
from (select * from t2 union
select * from t2_c) a;
count(*)
6
select count(*) from t3;
count(*)
4
select count(*) from t3_c;
count(*)
4
select count(*)
from (select * from t3 union
select * from t3_c) a;
count(*)
4
select count(*) from t4;
count(*)
22
select count(*) from t4_c;
count(*)
22
select count(*)
from (select * from t4 union
select * from t4_c) a;
count(*)
22
select count(*) from t5;
count(*)
3
select count(*) from t5_c;
count(*)
3
select count(*)
from (select * from t5 union
select * from t5_c) a;
count(*)
3
select count(*) from t6;
count(*)
8
select count(*) from t6_c;
count(*)
8
select count(*)
from (select * from t6 union
select * from t6_c) a;
count(*)
8
select count(*) from t7;
count(*)
5
select count(*) from t7_c;
count(*)
5
select count(*)
from (select * from t7 union
select * from t7_c) a;
count(*)
5
select count(*) from t8;
count(*)
3
select count(*) from t8_c;
count(*)
3
select count(*)
from (select * from t8 union
select * from t8_c) a;
count(*)
3
select count(*) from t9;
count(*)
3
select count(*) from t9_c;
count(*)
3
select count(*)
from (select * from t9 union
select * from t9_c) a;
count(*)
3
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
...@@ -10,7 +10,7 @@ show variables like "lower_case_table_names"; ...@@ -10,7 +10,7 @@ show variables like "lower_case_table_names";
enable_query_log; enable_query_log;
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3; DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3,tT;
DROP DATABASE IF EXISTS `TEST_$1`; DROP DATABASE IF EXISTS `TEST_$1`;
DROP DATABASE IF EXISTS `test_$1`; DROP DATABASE IF EXISTS `test_$1`;
--enable_warnings --enable_warnings
...@@ -100,3 +100,14 @@ show tables like 'T1%'; ...@@ -100,3 +100,14 @@ show tables like 'T1%';
alter table t1 add index (A); alter table t1 add index (A);
show tables like 't1%'; show tables like 't1%';
drop table t1; drop table t1;
#
# Bug #7261: Alter table loses temp table
#
create temporary table tT(a int(11), b varchar(8));
insert into tT values (1, 'abc');
select * from tT;
alter table tT add index (a);
select * from tT;
drop table tT;
-- source include/have_ndb.inc
--disable_warnings
use test;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
--enable_warnings
CREATE TABLE `t1` (
`capgoaledatta` smallint(5) unsigned NOT NULL auto_increment,
`goaledatta` char(2) NOT NULL default '',
`maturegarbagefa` varchar(32) NOT NULL default '',
PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t1` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt');
CREATE TABLE `t2` (
`capgotod` smallint(5) unsigned NOT NULL auto_increment,
`gotod` smallint(5) unsigned NOT NULL default '0',
`goaledatta` char(2) default NULL,
`maturegarbagefa` varchar(32) default NULL,
`descrpooppo` varchar(64) default NULL,
`svcutonsa` varchar(64) NOT NULL default '',
PRIMARY KEY (`capgotod`),
KEY `i_quadaddsvr` (`gotod`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t2` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
CREATE TABLE `t3` (
`CapGoaledatta` smallint(5) unsigned NOT NULL default '0',
`capgotod` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`capgotod`,`CapGoaledatta`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t3` VALUES (5,3),(2,4),(5,4),(1,3);
CREATE TABLE `t4` (
`capfa` bigint(20) unsigned NOT NULL auto_increment,
`realm` varchar(32) NOT NULL default '',
`authpwchap` varchar(32) default NULL,
`fa` varchar(32) NOT NULL default '',
`payyingatta` tinyint(4) NOT NULL default '0',
`status` char(1) default NULL,
PRIMARY KEY (`fa`,`realm`),
KEY `capfa` (`capfa`),
KEY `i_quadentity` (`fa`,`realm`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t4` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(22,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL);
CREATE TABLE `t5` (
`capfa` bigint(20) unsigned NOT NULL default '0',
`gotod` smallint(5) unsigned NOT NULL default '0',
`orderutonsa` varchar(64) NOT NULL default '',
PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t5` VALUES (21,2,''),(21,1,''),(22,4,'');
CREATE TABLE `t6` (
`capfa_parent` bigint(20) unsigned NOT NULL default '0',
`capfa_child` bigint(20) unsigned NOT NULL default '0',
`relatta` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t6` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0);
CREATE TABLE `t7` (
`dardpo` char(15) NOT NULL default '',
`dardtestard` tinyint(3) unsigned NOT NULL default '0',
`FastFA` char(5) NOT NULL default '',
`FastCode` char(6) NOT NULL default '',
`Fastca` char(1) NOT NULL default '',
`Fastmag` char(1) NOT NULL default '',
`Beareratta` char(2) NOT NULL default '',
PRIMARY KEY (`dardpo`,`dardtestard`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t7` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3');
CREATE TABLE `t8` (
`kattjame` varchar(32) NOT NULL default '',
`realm` varchar(32) NOT NULL default '',
`realm_entered` varchar(32) NOT NULL default '',
`maturegarbagefa` varchar(32) NOT NULL default '',
`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
`kattjame_entered` varchar(32) NOT NULL default '',
`hunderaaarbagefa` varchar(32) NOT NULL default '',
`gest` varchar(16) default NULL,
`hassetino` varchar(16) NOT NULL default '',
`aaaproxysessfa` varchar(255) default NULL,
`autologonallowed` char(1) default NULL,
`squardporoot` varchar(15) NOT NULL default '',
`naspo` varchar(15) default NULL,
`beareratta` char(2) default NULL,
`fastCode` varchar(6) default NULL,
`fastFA` varchar(5) default NULL,
`fastca` char(1) default NULL,
`fastmag` char(1) default NULL,
`lastupdate` datetime default NULL,
`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
`accthassetitime` int(10) unsigned default NULL,
`acctoutputoctets` bigint(20) unsigned default NULL,
`acctinputoctets` bigint(20) unsigned default NULL,
PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`),
KEY `squardporoot` (`squardporoot`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t8` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565);
CREATE TABLE `t9` (
`kattjame` varchar(32) NOT NULL default '',
`kattjame_entered` varchar(32) NOT NULL default '',
`realm` varchar(32) NOT NULL default '',
`realm_entered` varchar(32) NOT NULL default '',
`maturegarbagefa` varchar(32) NOT NULL default '',
`hunderaaarbagefa` varchar(32) NOT NULL default '',
`hunderaaarbagefa_parent` varchar(32) NOT NULL default '',
`gest` varchar(16) default NULL,
`hassetino` varchar(16) NOT NULL default '',
`squardporoot` varchar(15) NOT NULL default '',
`naspo` varchar(15) default NULL,
`beareratta` char(2) default NULL,
`fastCode` varchar(6) default NULL,
`fastFA` varchar(5) default NULL,
`fastca` char(1) default NULL,
`fastmag` char(1) default NULL,
`lastupdate` datetime default NULL,
`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00',
`accthassetitime` int(10) unsigned default NULL,
`actcoutpuocttets` bigint(20) unsigned default NULL,
`actinputocctets` bigint(20) unsigned default NULL,
`terminateraste` tinyint(3) unsigned default NULL,
PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
INSERT INTO `t9` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3);
create table t1_c engine=ndbcluster as select * from t1;
create table t2_c engine=ndbcluster as select * from t2;
create table t3_c engine=ndbcluster as select * from t3;
create table t4_c engine=ndbcluster as select * from t4;
create table t5_c engine=ndbcluster as select * from t5;
create table t6_c engine=ndbcluster as select * from t6;
create table t7_c engine=ndbcluster as select * from t7;
create table t8_c engine=ndbcluster as select * from t8;
create table t9_c engine=ndbcluster as select * from t9;
--exec $NDB_MGM --no-defaults -e "start backup" > /dev/null
drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 > /tmp/ndb_restore.out
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 > /tmp/ndb_restore.out
show tables;
select count(*) from t1;
select count(*) from t1_c;
select count(*)
from (select * from t1 union
select * from t1_c) a;
select count(*) from t2;
select count(*) from t2_c;
select count(*)
from (select * from t2 union
select * from t2_c) a;
select count(*) from t3;
select count(*) from t3_c;
select count(*)
from (select * from t3 union
select * from t3_c) a;
select count(*) from t4;
select count(*) from t4_c;
select count(*)
from (select * from t4 union
select * from t4_c) a;
select count(*) from t5;
select count(*) from t5_c;
select count(*)
from (select * from t5 union
select * from t5_c) a;
select count(*) from t6;
select count(*) from t6_c;
select count(*)
from (select * from t6 union
select * from t6_c) a;
select count(*) from t7;
select count(*) from t7_c;
select count(*)
from (select * from t7 union
select * from t7_c) a;
select count(*) from t8;
select count(*) from t8_c;
select count(*)
from (select * from t8 union
select * from t8_c) a;
select count(*) from t9;
select count(*) from t9_c;
select count(*)
from (select * from t9 union
select * from t9_c) a;
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
--enable_warnings
...@@ -5,8 +5,8 @@ p=`pwd` ...@@ -5,8 +5,8 @@ p=`pwd`
cd $MYSQL_BASE_DIR/mysql-test cd $MYSQL_BASE_DIR/mysql-test
./mysql-test-run --with-ndbcluster --ndb-connectstring=$NDB_CONNECTSTRING $* | tee $p/output.txt ./mysql-test-run --with-ndbcluster --ndb-connectstring=$NDB_CONNECTSTRING $* | tee $p/output.txt
f=`grep -c fail $p/output.txt` f=`grep -c '\[ fail \]' $p/output.txt`
o=`grep -c pass $p/output.txt` o=`grep -c '\[ pass \]' $p/output.txt`
if [ $o -gt 0 -a $f -eq 0 ] if [ $o -gt 0 -a $f -eq 0 ]
then then
......
max-time: 25000
cmd: atrt-mysql-test-run
args: --force
max-time: 600
cmd: atrt-testBackup
args: -n BackupOne T1 T6 T3 I3
# BASIC FUNCTIONALITY # BASIC FUNCTIONALITY
max-time: 500 max-time: 500
cmd: testBasic cmd: testBasic
......
max-time: 2500
cmd: atrt-mysql-test-run
args: --do-test=ndb --force
# #
# INDEX # INDEX
# #
...@@ -22,10 +18,6 @@ args: -n CreateLoadDrop T1 T10 ...@@ -22,10 +18,6 @@ args: -n CreateLoadDrop T1 T10
# #
# BACKUP # BACKUP
# #
max-time: 600
cmd: atrt-testBackup
args: -n BackupOne T1 T6 T3 I3
max-time: 1000 max-time: 1000
cmd: atrt-testBackup cmd: atrt-testBackup
args: -n BackupBank T6 args: -n BackupBank T6
......
...@@ -377,13 +377,14 @@ Item *create_func_space(Item *a) ...@@ -377,13 +377,14 @@ Item *create_func_space(Item *a)
{ {
uint dummy_errors; uint dummy_errors;
sp= new Item_string("",0,cs); sp= new Item_string("",0,cs);
if (sp)
sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors);
} }
else else
{ {
sp= new Item_string(" ",1,cs); sp= new Item_string(" ",1,cs);
} }
return new Item_func_repeat(sp, a); return sp ? new Item_func_repeat(sp, a) : 0;
} }
Item *create_func_soundex(Item* a) Item *create_func_soundex(Item* a)
......
...@@ -2915,12 +2915,11 @@ You should consider changing lower_case_table_names to 1 or 2", ...@@ -2915,12 +2915,11 @@ You should consider changing lower_case_table_names to 1 or 2",
(test_if_case_insensitive(mysql_real_data_home) == 1))) (test_if_case_insensitive(mysql_real_data_home) == 1)))
{ {
if (global_system_variables.log_warnings) if (global_system_variables.log_warnings)
sql_print_warning("\ sql_print_warning("lower_case_table_names was set to 2, even though your "
You have forced lower_case_table_names to 2 through a command-line \ "the file system '%s' is case sensitive. Now setting "
option, even though your file system '%s' is case sensitive. This means \ "lower_case_table_names to 0 to avoid future problems.",
that you can create a table that you can then no longer access. \
You should consider changing lower_case_table_names to 0.",
mysql_real_data_home); mysql_real_data_home);
lower_case_table_names= 0;
} }
select_thread=pthread_self(); select_thread=pthread_self();
......
...@@ -241,7 +241,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -241,7 +241,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
error=0; error=0;
id=0; id=0;
thd->proc_info="update"; thd->proc_info="update";
if (duplic != DUP_ERROR) if (duplic != DUP_ERROR || ignore)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
/* /*
let's *try* to start bulk inserts. It won't necessary let's *try* to start bulk inserts. It won't necessary
...@@ -380,7 +380,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -380,7 +380,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
table->next_number_field=0; table->next_number_field=0;
thd->count_cuted_fields= CHECK_FIELD_IGNORE; thd->count_cuted_fields= CHECK_FIELD_IGNORE;
thd->next_insert_id=0; // Reset this if wrongly used thd->next_insert_id=0; // Reset this if wrongly used
if (duplic != DUP_ERROR) if (duplic != DUP_ERROR || ignore)
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
/* Reset value of LAST_INSERT_ID if no rows where inserted */ /* Reset value of LAST_INSERT_ID if no rows where inserted */
...@@ -1345,7 +1345,7 @@ bool delayed_insert::handle_inserts(void) ...@@ -1345,7 +1345,7 @@ bool delayed_insert::handle_inserts(void)
info.ignore= row->ignore; info.ignore= row->ignore;
info.handle_duplicates= row->dup; info.handle_duplicates= row->dup;
if (info.ignore || if (info.ignore ||
info.handle_duplicates == DUP_REPLACE) info.handle_duplicates != DUP_ERROR)
{ {
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
using_ignore=1; using_ignore=1;
...@@ -1463,7 +1463,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u) ...@@ -1463,7 +1463,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
table->next_number_field=table->found_next_number_field; table->next_number_field=table->found_next_number_field;
thd->cuted_fields=0; thd->cuted_fields=0;
if (info.ignore || if (info.ignore ||
info.handle_duplicates == DUP_REPLACE) info.handle_duplicates != DUP_ERROR)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
table->file->start_bulk_insert((ha_rows) 0); table->file->start_bulk_insert((ha_rows) 0);
DBUG_RETURN(0); DBUG_RETURN(0);
...@@ -1649,7 +1649,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) ...@@ -1649,7 +1649,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
restore_record(table,default_values); // Get empty record restore_record(table,default_values); // Get empty record
thd->cuted_fields=0; thd->cuted_fields=0;
if (info.ignore || if (info.ignore ||
info.handle_duplicates == DUP_REPLACE) info.handle_duplicates != DUP_ERROR)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
table->file->start_bulk_insert((ha_rows) 0); table->file->start_bulk_insert((ha_rows) 0);
DBUG_RETURN(0); DBUG_RETURN(0);
......
...@@ -2844,16 +2844,9 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count, ...@@ -2844,16 +2844,9 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
x = used key parts (1 <= x <= c) x = used key parts (1 <= x <= c)
*/ */
double rec_per_key; double rec_per_key;
#if 0
if (!(rec_per_key=(double)
keyinfo->rec_per_key[keyinfo->key_parts-1]))
rec_per_key=(double) s->records/rec+1;
#else
rec_per_key= keyinfo->rec_per_key[keyinfo->key_parts-1] ? rec_per_key= keyinfo->rec_per_key[keyinfo->key_parts-1] ?
(double) keyinfo->rec_per_key[keyinfo->key_parts-1] : (double) keyinfo->rec_per_key[keyinfo->key_parts-1] :
(double) s->records/rec+1; (double) s->records/rec+1;
#endif
if (!s->records) if (!s->records)
tmp=0; tmp=0;
else if (rec_per_key/(double) s->records >= 0.01) else if (rec_per_key/(double) s->records >= 0.01)
......
...@@ -3231,7 +3231,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -3231,7 +3231,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
} }
/* Remove link to old table and rename the new one */ /* Remove link to old table and rename the new one */
close_temporary_table(thd,table->table_cache_key,table_name); close_temporary_table(thd,table->table_cache_key,table_name);
if (rename_temporary_table(thd, new_table, new_db, new_alias)) /* Should pass the 'new_name' as we store table name in the cache */
if (rename_temporary_table(thd, new_table, new_db, new_name))
{ // Fatal error { // Fatal error
close_temporary_table(thd,new_db,tmp_name); close_temporary_table(thd,new_db,tmp_name);
my_free((gptr) new_table,MYF(0)); my_free((gptr) new_table,MYF(0));
......
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