summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2001-12-26 16:49:10 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2001-12-26 16:49:10 +0200
commit71ce58a3b1f0b2d4ec776bc7864076603b3170f4 (patch)
tree1924b9282a4aed314ccafcecea76220ffcee2576 /mysql-test
parent1baa552749eab973ce7814a47d4f3826ffd71bfe (diff)
downloadmariadb-git-71ce58a3b1f0b2d4ec776bc7864076603b3170f4.tar.gz
This is a large push. Included are :
* multi-table updates * new paid feature for limiting number of queries per hour for users * optional syntax for multi-table deletes * optimization for SQL_CALC_FOUND_ROWS * a small addition for CREATE .. SELECT that will be of future use I know that all this will require many additions to documentation, which I have not done, but I am at Arjen's disposal to help him document all this. libmysqld/lib_sql.cc: This is a small change required due to new paid feature of limiting number of queries per hour for each user. mysql-test/r/multi_update.result: Change of the result to accomodate multi-table updates mysql-test/t/multi_update.test: Change in multi-table tests to accomodate multi-table updates BitKeeper/etc/ignore: Added 50 sql/new.cc to the ignore list scripts/mysql_install_db.sh: This is a small change required due to new paid feature of limiting number of queries per hour for each user. sql/item_timefunc.h: This is a small feature that will be of use later in the proper creation of the tables out of CREATE ... SELECT... Further changes will come after this resolve/push/test passes .. sql/lex.h: This is a small change required due to new paid feature of limiting number of queries per hour for each user. sql/mysql_priv.h: This is a small change required due to new paid feature of limiting number of queries per hour for each user. sql/mysqld.cc: This is a small change required due to new paid feature of limiting number of queries per hour for each user. sql/sql_acl.cc: This is a small change required due to new paid feature of limiting number of queries per hour for each user. sql/sql_acl.h: This is a small change required due to new paid feature of limiting number of queries per hour for each user. sql/sql_class.h: These are changes required for multi-table updates. sql/sql_lex.h: Changes required for both multi-table updates and limiting number of queries per hour (paid feature). sql/sql_parse.cc: Ha ! So many changes. * multi-table updates * limiting number of queries per hour for users sql/sql_select.cc: Optimisation for SQL_CALC_FOUND_ROWS, when a query involves a single table, without WHERE or GROUP clause sql/sql_update.cc: multi-table updates sql/sql_yacc.yy: Many things : * multi-table updates * limiting number of queries per hour for users * new optional syntax for multi-table deletes. This one is different from the one demanded by user. USING clause MUST include ALL tables, not just the ones that are used and not deleted from.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/multi_update.result19
-rw-r--r--mysql-test/t/multi_update.test25
2 files changed, 23 insertions, 21 deletions
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index f8bc19dd065..b1423667c44 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -2,32 +2,33 @@ drop table if exists t1,t2,t3;
create table t1(id1 int not null auto_increment primary key, t char(12));
create table t2(id2 int not null, t char(12));
create table t3(id3 int not null, t char(12), index(id3));
-delete t1.*, t2.*, t3.* from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 9500;
+update t1,t2,t3 set t1.t="aaa", t2.t="bbb", t3.t="cc" where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 90;
+delete t1.*, t2.*, t3.* from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 95;
check table t1, t2, t3;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t2 check status OK
test.t3 check status OK
-select count(*) from t1 where id1 > 9500;
+select count(*) from t1 where id1 > 95;
count(*)
0
-select count(*) from t2 where id2 > 9500;
+select count(*) from t2 where id2 > 95;
count(*)
0
-select count(*) from t3 where id3 > 9500;
+select count(*) from t3 where id3 > 95;
count(*)
0
-delete t1, t2, t3 from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 500;
-select count(*) from t1 where id1 > 500;
+delete t1, t2, t3 from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 5;
+select count(*) from t1 where id1 > 5;
count(*)
0
-select count(*) from t2 where id2 > 500;
+select count(*) from t2 where id2 > 5;
count(*)
0
-select count(*) from t3 where id3 > 500;
+select count(*) from t3 where id3 > 5;
count(*)
0
-delete t1, t2, t3 from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 0;
+delete from t1, t2, t3 using t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 0;
select count(*) from t1 where id1;
count(*)
0
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 0fc4d923469..11697f794a9 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -2,15 +2,15 @@
# Only run the test if we are using --big-test, because this test takes a
# long time
#
--- require r/big_test.require
-eval select $BIG_TEST as using_big_test;
+#-- require r/big_test.require
+#eval select $BIG_TEST as using_big_test;
drop table if exists t1,t2,t3;
create table t1(id1 int not null auto_increment primary key, t char(12));
create table t2(id2 int not null, t char(12));
create table t3(id3 int not null, t char(12), index(id3));
disable_query_log;
-let $1 = 10000;
+let $1 = 100;
while ($1)
{
let $2 = 5;
@@ -29,20 +29,21 @@ while ($1)
dec $1;
}
enable_query_log;
-delete t1.*, t2.*, t3.* from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 9500;
+update t1,t2,t3 set t1.t="aaa", t2.t="bbb", t3.t="cc" where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 90;
+delete t1.*, t2.*, t3.* from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 95;
check table t1, t2, t3;
-select count(*) from t1 where id1 > 9500;
-select count(*) from t2 where id2 > 9500;
-select count(*) from t3 where id3 > 9500;
+select count(*) from t1 where id1 > 95;
+select count(*) from t2 where id2 > 95;
+select count(*) from t3 where id3 > 95;
-delete t1, t2, t3 from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 500;
-select count(*) from t1 where id1 > 500;
-select count(*) from t2 where id2 > 500;
-select count(*) from t3 where id3 > 500;
+delete t1, t2, t3 from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 5;
+select count(*) from t1 where id1 > 5;
+select count(*) from t2 where id2 > 5;
+select count(*) from t3 where id3 > 5;
-delete t1, t2, t3 from t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 0;
+delete from t1, t2, t3 using t1,t2,t3 where t1.id1 = t2.id2 and t2.id2 = t3.id3 and t1.id1 > 0;
# These queries will force a scan of the table
select count(*) from t1 where id1;