summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <gshchepa/uchum@gleb.loc>2007-07-07 20:14:06 +0500
committerunknown <gshchepa/uchum@gleb.loc>2007-07-07 20:14:06 +0500
commita0336ad7d8f28b8de5a2b01ec285634952692abb (patch)
treea95fb8d593c69b8db4fa05ae09a5b11c223c117c /mysql-test
parentbc52d1d6e306e5fa915d5ebd4db673f2ca552329 (diff)
parent8195a213c2fadfb185e755ce6dda2162df1a5529 (diff)
downloadmariadb-git-a0336ad7d8f28b8de5a2b01ec285634952692abb.tar.gz
Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into gleb.loc:/home/uchum/work/bk/5.1-opt mysql-test/r/gis.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/t/gis.test: Auto merged mysql-test/t/loaddata.test: Auto merged sql/item.h: Auto merged sql/spatial.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged mysql-test/r/loaddata.result: Merge with 5.0-opt. mysql-test/t/view.test: Merge with 5.0-opt.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/gis.result3
-rw-r--r--mysql-test/r/loaddata.result14
-rw-r--r--mysql-test/r/view.result47
-rw-r--r--mysql-test/t/gis.test20
-rw-r--r--mysql-test/t/loaddata.test25
-rw-r--r--mysql-test/t/view.test54
6 files changed, 163 insertions, 0 deletions
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 1529fe77ac4..f68559fa8ea 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -886,6 +886,9 @@ AsText(a)
POINT(1 1)
LINESTRING(0 0,1 1,2 2)
drop table t1, t2;
+SELECT 1;
+1
+1
End of 5.0 tests
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
create view v1 as select * from t1;
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 67665427f9f..98e221b0dea 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -247,6 +247,20 @@ f1
1
2
drop table t1,t2;
+CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE);
+INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100);
+SELECT * FROM t1;
+c1 c2 c3 c4
+10 1970-02-01 01:02:03 1.1e-100 1.1e+100
+SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
+-10- -1970\-02\-01 01:02:03- -1.1e\-100- -1.1e+100-
+EOF
+TRUNCATE t1;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-';
+SELECT * FROM t1;
+c1 c2 c3 c4
+10 1970-02-01 01:02:03 1.1e-100 1.1e+100
+DROP TABLE t1;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1);
SET NAMES latin1;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index cfad70a9bb5..06da93a9cc4 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3497,6 +3497,53 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
DROP VIEW v1;
DROP TABLE t1;
+CREATE TABLE t1 (
+person_id int NOT NULL PRIMARY KEY,
+username varchar(40) default NULL,
+status_flg char(1) NOT NULL default 'A'
+);
+CREATE TABLE t2 (
+person_role_id int NOT NULL auto_increment PRIMARY KEY,
+role_id int NOT NULL,
+person_id int NOT NULL,
+INDEX idx_person_id (person_id),
+INDEX idx_role_id (role_id)
+);
+CREATE TABLE t3 (
+role_id int NOT NULL auto_increment PRIMARY KEY,
+role_name varchar(100) default NULL,
+app_name varchar(40) NOT NULL,
+INDEX idx_app_name(app_name)
+);
+CREATE VIEW v1 AS
+SELECT profile.person_id AS person_id
+FROM t1 profile, t2 userrole, t3 role
+WHERE userrole.person_id = profile.person_id AND
+role.role_id = userrole.role_id AND
+profile.status_flg = 'A'
+ ORDER BY profile.person_id,role.app_name,role.role_name;
+INSERT INTO t1 VALUES
+(6,'Sw','A'), (-1136332546,'ols','e'), (0,' *\n','0'),
+(-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0');
+INSERT INTO t2 VALUES
+(1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10);
+INSERT INTO t3 VALUES
+(1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'),
+(3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'),
+(5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'),
+(7,'SOC_USER','SOCCANS'),(8,'CAYIT_USER','CAYITCANS'),
+(9,'RTOS_DCFSPOS_SUPERVISOR','RTOS');
+EXPLAIN SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE profile const PRIMARY PRIMARY 4 const 1 Using temporary; Using filesort
+1 SIMPLE userrole ref idx_person_id,idx_role_id idx_person_id 4 const 2
+1 SIMPLE role eq_ref PRIMARY PRIMARY 4 test.userrole.role_id 1
+SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+a b
+6 6
+6 6
+DROP VIEW v1;
+DROP TABLE t1,t2,t3;
End of 5.0 tests.
DROP DATABASE IF EXISTS `d-1`;
CREATE DATABASE `d-1`;
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 426eec4be6d..d7182e36e3a 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -571,6 +571,26 @@ create table t2 as select f2 as a from t1 union select f3 from t1;
desc t2;
select AsText(a) from t2;
drop table t1, t2;
+
+#
+# Bug #29166: MYsql crash when query is run
+#
+
+# The test query itself is not logged : too large output.
+# The real test is the second query : see if the first hasn't crashed the
+# server
+--disable_query_log
+--disable_result_log
+SELECT AsText(GeometryFromText(CONCAT(
+ 'MULTIPOLYGON(((',
+ REPEAT ('-0.00000000001234567890123456789012 -0.123456789012345678,', 1000),
+ '-0.00000000001234567890123456789012 -0.123456789012345678',
+ ')))'
+))) AS a;
+--enable_result_log
+--enable_query_log
+SELECT 1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index 82fafbf6e73..4a4f667d3ea 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -217,6 +217,31 @@ select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1;
--exec rm $MYSQLTEST_VARDIR/tmp/t2
drop table t1,t2;
+#
+# Bug#29442: SELECT INTO OUTFILE FIELDS ENCLOSED BY digit, minus sign etc
+# corrupts non-string fields containing this character.
+#
+
+CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE);
+
+INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100);
+SELECT * FROM t1;
+
+--exec rm -f $MYSQLTEST_VARDIR/tmp/t1
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
+--exec cat $MYSQLTEST_VARDIR/tmp/t1
+--exec echo EOF
+
+TRUNCATE t1;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-';
+SELECT * FROM t1;
+
+--exec rm $MYSQLTEST_VARDIR/tmp/t1
+DROP TABLE t1;
+
# End of 5.0 tests
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index ee807a1ae25..68b2a38aa27 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3348,6 +3348,60 @@ EXPLAIN SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a;
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug #29392: SELECT over a multi-table view with ORDER BY
+# selecting the same view column with two different aliases
+#
+
+CREATE TABLE t1 (
+ person_id int NOT NULL PRIMARY KEY,
+ username varchar(40) default NULL,
+ status_flg char(1) NOT NULL default 'A'
+);
+
+CREATE TABLE t2 (
+ person_role_id int NOT NULL auto_increment PRIMARY KEY,
+ role_id int NOT NULL,
+ person_id int NOT NULL,
+ INDEX idx_person_id (person_id),
+ INDEX idx_role_id (role_id)
+);
+
+CREATE TABLE t3 (
+ role_id int NOT NULL auto_increment PRIMARY KEY,
+ role_name varchar(100) default NULL,
+ app_name varchar(40) NOT NULL,
+ INDEX idx_app_name(app_name)
+);
+
+CREATE VIEW v1 AS
+SELECT profile.person_id AS person_id
+ FROM t1 profile, t2 userrole, t3 role
+ WHERE userrole.person_id = profile.person_id AND
+ role.role_id = userrole.role_id AND
+ profile.status_flg = 'A'
+ ORDER BY profile.person_id,role.app_name,role.role_name;
+
+INSERT INTO t1 VALUES
+ (6,'Sw','A'), (-1136332546,'ols','e'), (0,' *\n','0'),
+ (-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0');
+
+INSERT INTO t2 VALUES
+ (1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10);
+
+INSERT INTO t3 VALUES
+ (1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'),
+ (3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'),
+ (5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'),
+ (7,'SOC_USER','SOCCANS'),(8,'CAYIT_USER','CAYITCANS'),
+ (9,'RTOS_DCFSPOS_SUPERVISOR','RTOS');
+
+EXPLAIN SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6;
+
+DROP VIEW v1;
+DROP TABLE t1,t2,t3;
+
--echo End of 5.0 tests.
#