summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/client/mariadb-conv.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
commit06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/client/mariadb-conv.test
parentInitial commit. (diff)
downloadmariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz
mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/client/mariadb-conv.test')
-rw-r--r--mysql-test/suite/client/mariadb-conv.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/suite/client/mariadb-conv.test b/mysql-test/suite/client/mariadb-conv.test
new file mode 100644
index 00000000..2be758b6
--- /dev/null
+++ b/mysql-test/suite/client/mariadb-conv.test
@@ -0,0 +1,39 @@
+--echo #
+--echo # MDEV-17088 Provide tools to encode/decode mysql-encoded file system names
+--echo #
+
+--character_set latin1
+
+--echo # default encoding
+--exec echo "t1" | $MARIADB_CONV
+--exec echo "t1" | $MARIADB_CONV -f filename --delimiter="\r\n"
+--exec echo "t1" | $MARIADB_CONV -t filename --delimiter="\r\n"
+
+--echo # invalid option
+--replace_regex /.*mariadb-conv.*: unknown/mariadb-conv: unknown/
+--error 1
+--exec echo "t1" | $MARIADB_CONV -f filename -r latin1 2>&1 > /dev/null
+
+--echo # unknown "to" character set
+--replace_regex /.*mariadb-conv.*: unknown/mariadb-conv: unknown/
+--error 1
+--exec echo "t1" | $MARIADB_CONV -f filename -t unknown-cs 2>&1 > /dev/null
+
+--echo # unknown "from" character set
+--replace_regex /.*mariadb-conv.*: unknown/mariadb-conv: unknown/
+--error 1
+--exec echo "t1" | $MARIADB_CONV -f unknown-cs -t latin1 2>&1 > /dev/null
+
+--echo # Bad delimiter
+--error 1
+--exec echo "t1" | $MARIADB_CONV --delimiter="\x" 2>&1 > /dev/null
+
+--echo # Conversion error
+--error 1
+--exec $MARIADB_CONV -f utf8 -t latin1 < $MYSQL_TEST_DIR/std_data/mariadb-conv/file01.utf8.txt 2>&1
+--exec $MARIADB_CONV -f utf8 -t latin1 -c < $MYSQL_TEST_DIR/std_data/mariadb-conv/file01.utf8.txt 2>&1
+
+--echo # Bad input character
+--error 1
+--exec $MARIADB_CONV -f utf8 -t latin1 < $MYSQL_TEST_DIR/std_data/mariadb-conv/file02.latin1.txt 2>&1
+--exec $MARIADB_CONV -f utf8 -t latin1 -c < $MYSQL_TEST_DIR/std_data/mariadb-conv/file02.latin1.txt 2>&1