Commit 823d0cda authored by Paul McCullagh's avatar Paul McCullagh

Fixed references

parent e5e979cb
...@@ -185,10 +185,10 @@ my $opt_mark_progress; ...@@ -185,10 +185,10 @@ my $opt_mark_progress;
my $opt_sleep; my $opt_sleep;
my $opt_testcase_timeout= 15; # 15 minutes my $opt_testcase_timeout= 15000; # 15 minutes
my $opt_suite_timeout = 360; # 6 hours my $opt_suite_timeout = 3600; # 6 hours
my $opt_shutdown_timeout= 10; # 10 seconds my $opt_shutdown_timeout= 10000; # 10 seconds
my $opt_start_timeout = 180; # 180 seconds my $opt_start_timeout = 18000; # 180 seconds
sub testcase_timeout { return $opt_testcase_timeout * 60; }; sub testcase_timeout { return $opt_testcase_timeout * 60; };
sub suite_timeout { return $opt_suite_timeout * 60; }; sub suite_timeout { return $opt_suite_timeout * 60; };
......
DROP TABLE IF EXISTS t1,T1;
CREATE TABLE t1 (a int);
SELECT * from T1;
ERROR 42S02: Table 'test.T1' doesn't exist
drop table t1;
flush tables;
CREATE TABLE t1 (a int) ENGINE=INNODB;
SELECT * from T1;
ERROR 42S02: Table 'test.T1' doesn't exist
drop table t1;
...@@ -119,7 +119,7 @@ create table t1Aa (col1 int); ...@@ -119,7 +119,7 @@ create table t1Aa (col1 int);
create view v1Aa as select col1 from t1Aa as AaA; create view v1Aa as select col1 from t1Aa as AaA;
show create view v1AA; show create view v1AA;
View Create View character_set_client collation_connection View Create View character_set_client collation_connection
v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `aaa` latin1 latin1_swedish_ci v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `AaA`.`col1` AS `col1` from `t1aa` `AaA` latin1 latin1_swedish_ci
drop view v1AA; drop view v1AA;
select Aaa.col1 from t1Aa as AaA; select Aaa.col1 from t1Aa as AaA;
col1 col1
...@@ -128,7 +128,7 @@ drop view v1AA; ...@@ -128,7 +128,7 @@ drop view v1AA;
create view v1Aa as select AaA.col1 from t1Aa as AaA; create view v1Aa as select AaA.col1 from t1Aa as AaA;
show create view v1AA; show create view v1AA;
View Create View character_set_client collation_connection View Create View character_set_client collation_connection
v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `aaa`.`col1` AS `col1` from `t1aa` `aaa` latin1 latin1_swedish_ci v1aa CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1aa` AS select `AaA`.`col1` AS `col1` from `t1aa` `AaA` latin1 latin1_swedish_ci
drop view v1AA; drop view v1AA;
drop table t1Aa; drop table t1Aa;
CREATE TABLE t1 (a int, b int); CREATE TABLE t1 (a int, b int);
...@@ -142,7 +142,7 @@ CREATE OR REPLACE VIEW v1 AS ...@@ -142,7 +142,7 @@ CREATE OR REPLACE VIEW v1 AS
select X.a from t1 AS X group by X.b having (X.a = 1); select X.a from t1 AS X group by X.b having (X.a = 1);
SHOW CREATE VIEW v1; SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `x`.`a` AS `a` from `t1` `x` group by `x`.`b` having (`x`.`a` = 1) latin1 latin1_swedish_ci v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `X`.`a` AS `a` from `t1` `X` group by `X`.`b` having (`X`.`a` = 1) latin1 latin1_swedish_ci
SELECT * FROM v1; SELECT * FROM v1;
a a
DROP VIEW v1; DROP VIEW v1;
......
...@@ -652,13 +652,13 @@ create table t2 (s1 int, foreign key (s1) references t1 (s1)) engine = pbxt; ...@@ -652,13 +652,13 @@ create table t2 (s1 int, foreign key (s1) references t1 (s1)) engine = pbxt;
insert into t2 values (1); insert into t2 values (1);
truncate table t1; truncate table t1;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (Constraint: `FOREIGN_1`) ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (Constraint: `FOREIGN_1`)
alter table t1 engine maria; alter table t1 engine myisam;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`s1` int(11) NOT NULL, `s1` int(11) NOT NULL,
PRIMARY KEY (`s1`) PRIMARY KEY (`s1`)
) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table if exists t1, t2; drop table if exists t1, t2;
create table t1 (s1 int primary key, s2 int unique not null) engine = pbxt; create table t1 (s1 int primary key, s2 int unique not null) engine = pbxt;
create table t2 (s1 int, foreign key (s1) references t1 (s1)) engine = pbxt; create table t2 (s1 int, foreign key (s1) references t1 (s1)) engine = pbxt;
......
#
# Test of force of lower-case-table-names=0
# (User has case insensitive file system and wants to preserve case of
# table names)
#
--source include/have_innodb.inc
--source include/have_lowercase0.inc
--source include/not_windows.inc
--disable_warnings
DROP TABLE IF EXISTS t1,T1;
--enable_warnings
#
# This is actually an error, but ok as the user has forced this
# by using --lower-case-table-names=0
CREATE TABLE t1 (a int);
--error 1146 # PBXT will generate an error (is better than hanging in the drop)
SELECT * from T1;
drop table t1;
flush tables;
#
# InnoDB should in this case be case sensitive
# Note that this is not true on windows as no this OS, InnoDB is always
# storing things in lower case.
#
CREATE TABLE t1 (a int) ENGINE=INNODB;
--error 1146
SELECT * from T1;
drop table t1;
--disable_query_log
drop database pbxt;
--enable_query_log
# End of 4.1 tests
...@@ -88,10 +88,6 @@ INSERT INTO t1 (d) values (null),(null); ...@@ -88,10 +88,6 @@ INSERT INTO t1 (d) values (null),(null);
select * from t1; select * from t1;
drop table t1; drop table t1;
--disable_query_log
drop database pbxt;
--enable_query_log
# #
# Test to check elimination of IS NULL predicate for a non-nullable attribute # Test to check elimination of IS NULL predicate for a non-nullable attribute
# (bug #1990) # (bug #1990)
......
...@@ -406,7 +406,7 @@ insert into t2 values (1); ...@@ -406,7 +406,7 @@ insert into t2 values (1);
--error 1451 --error 1451
truncate table t1; truncate table t1;
# this caused a crash # this caused a crash
alter table t1 engine maria; alter table t1 engine myisam;
show create table t1; show create table t1;
# BUG: Foreign Keys: missing row in table_constraints # BUG: Foreign Keys: missing row in table_constraints
......
...@@ -434,6 +434,7 @@ select count(*) from t1 where x = 18446744073709551601; ...@@ -434,6 +434,7 @@ select count(*) from t1 where x = 18446744073709551601;
drop table t1; drop table t1;
#create table fuuu (c1 int);
# #
# Bug #11185 incorrect comparison of unsigned int to signed constant # Bug #11185 incorrect comparison of unsigned int to signed constant
# #
...@@ -451,6 +452,9 @@ select * from t1 where a > -1; ...@@ -451,6 +452,9 @@ select * from t1 where a > -1;
explain select * from t1 where a < -1; explain select * from t1 where a < -1;
select * from t1 where a < -1; select * from t1 where a < -1;
#create table fuuu2 (c1 int);
#check table fuuu2;
drop table t1; drop table t1;
# #
......
...@@ -406,4 +406,3 @@ select ExtractValue(@xml, "/entry[(50>pt)]/id"); ...@@ -406,4 +406,3 @@ select ExtractValue(@xml, "/entry[(50>pt)]/id");
select ExtractValue(@xml, "/entry[(50>=pt)]/id"); select ExtractValue(@xml, "/entry[(50>=pt)]/id");
select ExtractValue(@xml, "/entry[(50<pt)]/id"); select ExtractValue(@xml, "/entry[(50<pt)]/id");
select ExtractValue(@xml, "/entry[(50<=pt)]/id"); select ExtractValue(@xml, "/entry[(50<=pt)]/id");
...@@ -79,11 +79,11 @@ xtPublic void xt_heap_reference(XTThreadPtr, XTHeapPtr hp) ...@@ -79,11 +79,11 @@ xtPublic void xt_heap_reference(XTThreadPtr, XTHeapPtr hp)
#endif #endif
{ {
xt_spinlock_lock(&hp->h_lock); xt_spinlock_lock(&hp->h_lock);
hp->h_ref_count++;
#ifdef DEBUG #ifdef DEBUG
if (hp->h_track) if (hp->h_track)
printf("HEAP: +1 %2d %s:%d\n", (int) hp->h_ref_count, file, (int) line); printf("HEAP: +1 %d->%d %s:%d\n", (int) hp->h_ref_count, (int) hp->h_ref_count+1, file, (int) line);
#endif #endif
hp->h_ref_count++;
xt_spinlock_unlock(&hp->h_lock); xt_spinlock_unlock(&hp->h_lock);
} }
...@@ -102,7 +102,7 @@ xtPublic void xt_heap_release(XTThreadPtr self, XTHeapPtr hp) ...@@ -102,7 +102,7 @@ xtPublic void xt_heap_release(XTThreadPtr self, XTHeapPtr hp)
if (hp->h_ref_count > 0) { if (hp->h_ref_count > 0) {
#ifdef DEBUG #ifdef DEBUG
if (hp->h_track) if (hp->h_track)
printf("HEAP: -1 %2d\n", (int) hp->h_ref_count); printf("HEAP: -1 %d->%d\n", (int) hp->h_ref_count, (int) hp->h_ref_count-1);
#endif #endif
hp->h_ref_count--; hp->h_ref_count--;
if (hp->h_ref_count == 0) { if (hp->h_ref_count == 0) {
......
...@@ -1246,7 +1246,7 @@ xtPublic void xt_create_table(XTThreadPtr self, XTPathStrPtr name, XTDictionaryP ...@@ -1246,7 +1246,7 @@ xtPublic void xt_create_table(XTThreadPtr self, XTPathStrPtr name, XTDictionaryP
XTDatabaseHPtr db = self->st_database; XTDatabaseHPtr db = self->st_database;
XTOpenTablePoolPtr table_pool; XTOpenTablePoolPtr table_pool;
XTTableHPtr tab; XTTableHPtr tab;
XTTableHPtr old_tab = 0; XTTableHPtr old_tab = NULL;
xtTableID old_tab_id = 0; xtTableID old_tab_id = 0;
xtTableID tab_id = 0; xtTableID tab_id = 0;
XTTabRowHeadDRec row_head; XTTabRowHeadDRec row_head;
...@@ -1271,6 +1271,7 @@ xtPublic void xt_create_table(XTThreadPtr self, XTPathStrPtr name, XTDictionaryP ...@@ -1271,6 +1271,7 @@ xtPublic void xt_create_table(XTThreadPtr self, XTPathStrPtr name, XTDictionaryP
pushr_(xt_db_unlock_table_pool, table_pool); pushr_(xt_db_unlock_table_pool, table_pool);
xt_ht_lock(self, db->db_tables); xt_ht_lock(self, db->db_tables);
pushr_(xt_ht_unlock, db->db_tables); pushr_(xt_ht_unlock, db->db_tables);
pushr_(xt_heap_release, old_tab);
/* This must be done before we remove the old table /* This must be done before we remove the old table
* from the directory, or we will not be able * from the directory, or we will not be able
...@@ -1285,7 +1286,7 @@ xtPublic void xt_create_table(XTThreadPtr self, XTPathStrPtr name, XTDictionaryP ...@@ -1285,7 +1286,7 @@ xtPublic void xt_create_table(XTThreadPtr self, XTPathStrPtr name, XTDictionaryP
if (old_tab) { if (old_tab) {
old_tab_id = old_tab->tab_id; old_tab_id = old_tab->tab_id;
xt_dl_delete_ext_data(self, old_tab, FALSE, TRUE); xt_dl_delete_ext_data(self, old_tab, FALSE, TRUE);
xt_heap_release(self, old_tab); freer_(); // xt_heap_release(self, old_tab)
/* For the Windows version this must be done before we /* For the Windows version this must be done before we
* start to delete the underlying files! * start to delete the underlying files!
...@@ -1305,6 +1306,9 @@ xtPublic void xt_create_table(XTThreadPtr self, XTPathStrPtr name, XTDictionaryP ...@@ -1305,6 +1306,9 @@ xtPublic void xt_create_table(XTThreadPtr self, XTPathStrPtr name, XTDictionaryP
*/ */
xt_ht_del(self, db->db_tables, name); xt_ht_del(self, db->db_tables, name);
} }
else {
freer_(); // xt_heap_release(self, old_tab)
}
/* Add the table to the directory, well remove on error! */ /* Add the table to the directory, well remove on error! */
li_undo.li_sl = db->db_table_by_id; li_undo.li_sl = db->db_table_by_id;
...@@ -1572,7 +1576,7 @@ xtPublic void xt_drop_table(XTThreadPtr self, XTPathStrPtr tab_name) ...@@ -1572,7 +1576,7 @@ xtPublic void xt_drop_table(XTThreadPtr self, XTPathStrPtr tab_name)
{ {
XTDatabaseHPtr db = self->st_database; XTDatabaseHPtr db = self->st_database;
XTOpenTablePoolPtr table_pool; XTOpenTablePoolPtr table_pool;
XTTableHPtr tab; XTTableHPtr tab = NULL;
xtTableID tab_id = 0; xtTableID tab_id = 0;
xtBool can_drop = TRUE; xtBool can_drop = TRUE;
...@@ -1586,6 +1590,7 @@ xtPublic void xt_drop_table(XTThreadPtr self, XTPathStrPtr tab_name) ...@@ -1586,6 +1590,7 @@ xtPublic void xt_drop_table(XTThreadPtr self, XTPathStrPtr tab_name)
pushr_(xt_db_unlock_table_pool, table_pool); pushr_(xt_db_unlock_table_pool, table_pool);
xt_ht_lock(self, db->db_tables); xt_ht_lock(self, db->db_tables);
pushr_(xt_ht_unlock, db->db_tables); pushr_(xt_ht_unlock, db->db_tables);
pushr_(xt_heap_release, tab);
if (table_pool) { if (table_pool) {
tab_id = tab->tab_id; /* tab is not null if returned table_pool is not null */ tab_id = tab->tab_id; /* tab is not null if returned table_pool is not null */
...@@ -1599,7 +1604,7 @@ xtPublic void xt_drop_table(XTThreadPtr self, XTPathStrPtr tab_name) ...@@ -1599,7 +1604,7 @@ xtPublic void xt_drop_table(XTThreadPtr self, XTPathStrPtr tab_name)
XTTableEntryPtr te_ptr; XTTableEntryPtr te_ptr;
xt_dl_delete_ext_data(self, tab, FALSE, TRUE); xt_dl_delete_ext_data(self, tab, FALSE, TRUE);
xt_heap_release(self, tab); freer_(); // xt_heap_release(self, tab)
/* For the Windows version this must be done before we /* For the Windows version this must be done before we
* start to delete the underlying files! * start to delete the underlying files!
...@@ -1617,6 +1622,9 @@ xtPublic void xt_drop_table(XTThreadPtr self, XTPathStrPtr tab_name) ...@@ -1617,6 +1622,9 @@ xtPublic void xt_drop_table(XTThreadPtr self, XTPathStrPtr tab_name)
xt_sl_delete(self, db->db_table_by_id, &tab_id); xt_sl_delete(self, db->db_table_by_id, &tab_id);
} }
} }
else {
freer_(); // xt_heap_release(self, tab)
}
xt_ht_del(self, db->db_tables, tab_name); xt_ht_del(self, db->db_tables, tab_name);
} }
...@@ -1957,7 +1965,7 @@ xtPublic void xt_rename_table(XTThreadPtr self, XTPathStrPtr old_name, XTPathStr ...@@ -1957,7 +1965,7 @@ xtPublic void xt_rename_table(XTThreadPtr self, XTPathStrPtr old_name, XTPathStr
{ {
XTDatabaseHPtr db = self->st_database; XTDatabaseHPtr db = self->st_database;
XTOpenTablePoolPtr table_pool; XTOpenTablePoolPtr table_pool;
XTTableHPtr tab; XTTableHPtr tab = NULL;
char table_name[XT_MAX_TABLE_FILE_NAME_SIZE]; char table_name[XT_MAX_TABLE_FILE_NAME_SIZE];
char *postfix; char *postfix;
XTFilesOfTableRec ft; XTFilesOfTableRec ft;
...@@ -2004,6 +2012,7 @@ xtPublic void xt_rename_table(XTThreadPtr self, XTPathStrPtr old_name, XTPathStr ...@@ -2004,6 +2012,7 @@ xtPublic void xt_rename_table(XTThreadPtr self, XTPathStrPtr old_name, XTPathStr
tab_id = tab->tab_id; tab_id = tab->tab_id;
myxt_move_dictionary(&dic, &tab->tab_dic); myxt_move_dictionary(&dic, &tab->tab_dic);
pushr_(myxt_free_dictionary, &dic); pushr_(myxt_free_dictionary, &dic);
pushr_(xt_heap_release, tab);
/* Unmap the memory mapped table files: /* Unmap the memory mapped table files:
* For windows this must be done before we * For windows this must be done before we
...@@ -2011,7 +2020,7 @@ xtPublic void xt_rename_table(XTThreadPtr self, XTPathStrPtr old_name, XTPathStr ...@@ -2011,7 +2020,7 @@ xtPublic void xt_rename_table(XTThreadPtr self, XTPathStrPtr old_name, XTPathStr
*/ */
tab_close_mapped_files(self, tab); tab_close_mapped_files(self, tab);
xt_heap_release(self, tab); freer_(); // xt_heap_release(self, old_tab)
/* Create the new name and path: */ /* Create the new name and path: */
te_new_name = xt_dup_string(self, xt_last_name_of_path(new_name->ps_path)); te_new_name = xt_dup_string(self, xt_last_name_of_path(new_name->ps_path));
......
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