summaryrefslogtreecommitdiff
path: root/mysql-test/t/information_schema.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-11-25 18:17:28 +0100
committerSergei Golubchik <sergii@pisem.net>2010-11-25 18:17:28 +0100
commit65ca700def99289cc31a7040537f5aa6e12bf485 (patch)
tree97b3a07299b626c519da0e80c122b5b79b933914 /mysql-test/t/information_schema.test
parent2ab57de38d13d927ddff2d51aed4af34e13998f5 (diff)
parent6e5bcca7935d3c62f84bb640e5357664a210ee12 (diff)
downloadmariadb-git-65ca700def99289cc31a7040537f5aa6e12bf485.tar.gz
merge.
checkpoint. does not compile.
Diffstat (limited to 'mysql-test/t/information_schema.test')
-rw-r--r--mysql-test/t/information_schema.test79
1 files changed, 38 insertions, 41 deletions
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index f5fab966bdd..4461004c79c 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -5,6 +5,9 @@
# on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc
+# Check that InnoDB/XtraDB was compiled in as result depends on it
+-- source include/have_innodb.inc
+
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
@@ -44,14 +47,16 @@ insert into t5 values (10);
create view v1 (c) as
SELECT table_name FROM information_schema.TABLES
WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND
- table_name not like 'ndb_%' AND table_name not like 'innodb_%';
+ table_name not like 'ndb_%' AND table_name not like 'innodb_%' AND
+ table_name not like 'pbxt_%' AND table_name not like 'xtradb_%';
+--sorted_result
select * from v1;
-select c,table_name from v1
+select c,table_name from v1
inner join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
-select c,table_name from v1
+select c,table_name from v1
left join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
@@ -526,7 +531,8 @@ drop table t1;
grant select on test.* to mysqltest_4@localhost;
connect (user10261,localhost,mysqltest_4,,);
connection user10261;
-SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
+--sorted_result
+SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME='TABLE_NAME';
connection default;
disconnect user10261;
@@ -535,17 +541,6 @@ delete from mysql.db where user='mysqltest_4';
flush privileges;
#
-# Bug#9404 information_schema: Weird error messages
-# with SELECT SUM() ... GROUP BY queries
-#
-SELECT table_schema, count(*) FROM information_schema.TABLES WHERE
-table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest')
-AND table_name not like 'ndb%' AND table_name not like 'innodb_%'
-GROUP BY TABLE_SCHEMA;
-
-
-
-#
# TRIGGERS table test
#
create table t1 (i int, j int);
@@ -924,7 +919,7 @@ SELECT table_name from information_schema.tables
WHERE table_name=(SELECT MAX(table_name)
FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test'));
#
-# Bug#23037 Bug in field "Default" of query "SHOW COLUMNS FROM table"
+# Bug #23037 Bug in field "Default" of query "SHOW COLUMNS FROM table"
#
# Note, MyISAM/InnoDB can't take more that 65532 chars, because the row
# size is limited to 65535 bytes (BLOBs not counted)
@@ -991,30 +986,6 @@ drop table t1,t2;
#
-# Bug#24630 Subselect query crashes mysqld
-#
-select 1 as f1 from information_schema.tables where "CHARACTER_SETS"=
-(select cast(table_name as char) from information_schema.tables
- order by table_name limit 1) limit 1;
-
-select t.table_name, group_concat(t.table_schema, '.', t.table_name),
- count(*) as num1
-from information_schema.tables t
-inner join information_schema.columns c1
-on t.table_schema = c1.table_schema AND t.table_name = c1.table_name
-where t.table_schema = 'information_schema' and
- c1.ordinal_position =
- (select isnull(c2.column_type) -
- isnull(group_concat(c2.table_schema, '.', c2.table_name)) +
- count(*) as num
- from information_schema.columns c2 where
- c2.table_schema='information_schema' and
- (c2.column_type = 'varchar(7)' or c2.column_type = 'varchar(20)')
- group by c2.column_type order by num limit 1)
- and t.table_name not like 'innodb_%'
-group by t.table_name order by num1, t.table_name;
-
-#
# Bug#28266 IS_UPDATABLE field on VIEWS table in I_S database is wrong
#
create table t1(f1 int);
@@ -1132,6 +1103,25 @@ disconnect con3148;
drop user user3148@localhost;
#
+# `time` and `time_ms` columns of INFORMATION_SCHEMA.PROCESSLIST.
+#
+connect (pslistcon,localhost,root,,test);
+let $ID= `select connection_id()`;
+SELECT 'other connection here' AS who;
+connection default;
+sleep 2;
+--disable_query_log
+eval SET @tid=$ID;
+--enable_query_log
+SELECT IF(`time` > 0, 'OK', `time`) AS time_low,
+ IF(`time` < 1000, 'OK', `time`) AS time_high,
+ IF(time_ms >= 1000, 'OK', time_ms) AS time_ms_low,
+ IF(time_ms < 1000000, 'OK', time_ms) AS time_ms_high
+ FROM INFORMATION_SCHEMA.PROCESSLIST
+ WHERE ID=@tid;
+disconnect pslistcon;
+
+#
# Bug#26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS
# in Event (see also openssl_1.test)
#
@@ -1385,9 +1375,16 @@ DROP TABLE t1;
# Bug #22047: Time in SHOW PROCESSLIST for SQL thread in replication seems
# to become negative
#
+# Note that at the time of writing, MariaDB differs in behaviour from MySQL on
+# the `time` column. In MySQL this changes depending on the setting of
+# @TIMESTAMP, which is contrary to the documented (and sensible) behaviour.
+# In MariaDB, the `time` column is independent of @TIMESTAMP.
+# (The rationale for this is to keep `time` and `time_ms` consistent;
+# @TIMESTAMP has no microsecond precision).
+#
SET TIMESTAMP=@@TIMESTAMP + 10000000;
-SELECT 'OK' AS TEST_RESULT FROM INFORMATION_SCHEMA.PROCESSLIST WHERE time < 0;
+SELECT 'NOT_OK' AS TEST_RESULT FROM INFORMATION_SCHEMA.PROCESSLIST WHERE time < 0;
SET TIMESTAMP=DEFAULT;