summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/func_system.result
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/func_system.result
parentInitial commit. (diff)
downloadmariadb-3f619478f796eddbba6e39502fe941b285dd97b1.tar.xz
mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/func_system.result')
-rw-r--r--mysql-test/main/func_system.result115
1 files changed, 115 insertions, 0 deletions
diff --git a/mysql-test/main/func_system.result b/mysql-test/main/func_system.result
new file mode 100644
index 00000000..fd99c81a
--- /dev/null
+++ b/mysql-test/main/func_system.result
@@ -0,0 +1,115 @@
+select database();
+database()
+test
+select charset(database());
+charset(database())
+utf8mb3
+select database() = "test";
+database() = "test"
+1
+select database() = _utf8"test";
+database() = _utf8"test"
+1
+select database() = _latin1"test";
+database() = _latin1"test"
+1
+select user() like "%@%";
+user() like "%@%"
+1
+select user() like _utf8"%@%";
+user() like _utf8"%@%"
+1
+select user() like _latin1"%@%";
+user() like _latin1"%@%"
+1
+select charset(user());
+charset(user())
+utf8mb3
+select version()>="03.23.29";
+version()>="03.23.29"
+1
+select version()>=_utf8"03.23.29";
+version()>=_utf8"03.23.29"
+1
+select version()>=_latin1"03.23.29";
+version()>=_latin1"03.23.29"
+1
+select charset(version());
+charset(version())
+utf8mb3
+explain extended select database(), user();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 select database() AS `database()`,user() AS `user()`
+create table t1 (version char(60)) select database(), user(), version() as 'version';
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `database()` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
+ `user()` varchar(384) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
+ `version` char(60) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+drop table t1;
+select charset(charset(_utf8'a')), charset(collation(_utf8'a'));
+charset(charset(_utf8'a')) charset(collation(_utf8'a'))
+utf8mb3 utf8mb3
+select collation(charset(_utf8'a')), collation(collation(_utf8'a'));
+collation(charset(_utf8'a')) collation(collation(_utf8'a'))
+utf8mb3_general_ci utf8mb3_general_ci
+create table t1 select charset(_utf8'a'), collation(_utf8'a');
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `charset(_utf8'a')` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
+ `collation(_utf8'a')` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+drop table t1;
+select TRUE,FALSE,NULL;
+TRUE FALSE NULL
+1 0 NULL
+create table t1 (c1 char(5)) character set=latin1;
+insert into t1 values('row 1');
+insert into t1 values('row 2');
+insert into t1 values('row 3');
+select concat(user(), '--', c1) from t1;
+concat(user(), '--', c1)
+root@localhost--row 1
+root@localhost--row 2
+root@localhost--row 3
+select concat(database(), '--', c1) from t1;
+concat(database(), '--', c1)
+test--row 1
+test--row 2
+test--row 3
+drop table t1;
+create table t1 (a char(10)) character set latin1;
+select * from t1 where a=version();
+a
+select * from t1 where a=database();
+a
+select * from t1 where a=user();
+a
+insert into t1 values ('a');
+select left(concat(a,version()),1) from t1;
+left(concat(a,version()),1)
+a
+drop table t1;
+#
+# Start of 10.2 tests
+#
+
+MDEV-27544 database() function under UNION ALL truncates results to 34 characters
+
+
+SET NAMES utf8;
+create database betäubungsmittelverschreibungsverordnung;
+use betäubungsmittelverschreibungsverordnung;
+select database() as "database" union all select database();
+database
+betäubungsmittelverschreibungsverordnung
+betäubungsmittelverschreibungsverordnung
+drop database betäubungsmittelverschreibungsverordnung;
+#
+# End of 10.2 tests
+#