summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/client_xml.test
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/client_xml.test
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/client_xml.test')
-rw-r--r--mysql-test/main/client_xml.test45
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/main/client_xml.test b/mysql-test/main/client_xml.test
new file mode 100644
index 00000000..d39659a3
--- /dev/null
+++ b/mysql-test/main/client_xml.test
@@ -0,0 +1,45 @@
+# Can't run with embedded server
+-- source include/not_embedded.inc
+-- source include/no_view_protocol.inc
+
+# Disable concurrent inserts to avoid test failures when reading
+# data from concurrent connections (insert might return before
+# the data is actually in the table).
+set @old_concurrent_insert= @@global.concurrent_insert;
+set @@global.concurrent_insert= 0;
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+# Test of the xml output of the 'mysql' and 'mysqldump' clients -- makes
+# sure that basic encoding issues are handled properly
+create table t1 (
+ `a&b` int,
+ `a<b` int NOT NULL,
+ `a>b` text
+);
+insert into t1 values (1, 2, 'a&b a<b a>b');
+
+# Determine the number of open sessions
+--source include/count_sessions.inc
+
+--exec $MYSQL --xml test -e "select * from t1"
+--exec $MYSQL_DUMP --xml --skip-create-options test
+
+--exec $MYSQL --xml test -e "select count(*) from t1"
+--exec $MYSQL --xml test -e "select 1 < 2 from dual"
+--exec $MYSQL --xml test -e "select 1 > 2 from dual"
+--exec $MYSQL --xml test -e "select 1 & 3 from dual"
+--exec $MYSQL --xml test -e "select null from dual"
+--exec $MYSQL --xml test -e "select 1 limit 0"
+--exec $MYSQL --xml test -vv -e "select 1 limit 0"
+
+drop table t1;
+
+# Restore global concurrent_insert value
+set @@global.concurrent_insert= @old_concurrent_insert;
+
+# Wait till the number of open sessions is <= the number before the runs with
+# $MYSQL and $MYSQL_DUMP
+# = The session caused by mysql and mysqldump have finished their disconnect
+--source include/wait_until_count_sessions.inc