mirror of
https://github.com/MariaDB/server.git
synced 2025-04-08 16:25:32 +02:00

This commit introduces an additional command line option to the mariadb client. --script-dir=<directory> will cause the `source` command to look for files initially in CWD, then in <script-dir> if not found in CWD.
82 lines
4.5 KiB
Text
82 lines
4.5 KiB
Text
#
|
|
# MDEV-34704: Quick mode produces the bug for mariadb client
|
|
#
|
|
create table t1 (aaaaaaaaa char (5), aaaaa char (10), a char (127), b char(1));
|
|
insert into t1 values ("X", "X", "X", "X");
|
|
# --table --quick
|
|
+-----------+------------+---------------------------------------------------------------------------------------------------------------------------------+------+
|
|
| aaaaaaaaa | aaaaa | a | b |
|
|
+-----------+------------+---------------------------------------------------------------------------------------------------------------------------------+------+
|
|
| X | X | X | X |
|
|
+-----------+------------+---------------------------------------------------------------------------------------------------------------------------------+------+
|
|
# --table --quick --quick-max-column-width=0
|
|
+-----------+-------+------+------+
|
|
| aaaaaaaaa | aaaaa | a | b |
|
|
+-----------+-------+------+------+
|
|
| X | X | X | X |
|
|
+-----------+-------+------+------+
|
|
# --table --quick --quick-max-column-width=10
|
|
+-----------+------------+------------+------+
|
|
| aaaaaaaaa | aaaaa | a | b |
|
|
+-----------+------------+------------+------+
|
|
| X | X | X | X |
|
|
+-----------+------------+------------+------+
|
|
# --table --quick --quick-max-column-width=20
|
|
+-----------+------------+----------------------+------+
|
|
| aaaaaaaaa | aaaaa | a | b |
|
|
+-----------+------------+----------------------+------+
|
|
| X | X | X | X |
|
|
+-----------+------------+----------------------+------+
|
|
insert into t1 values ("01234", "0123456789", "01234567890123456789", "1");
|
|
# --table --quick
|
|
+-----------+------------+---------------------------------------------------------------------------------------------------------------------------------+------+
|
|
| aaaaaaaaa | aaaaa | a | b |
|
|
+-----------+------------+---------------------------------------------------------------------------------------------------------------------------------+------+
|
|
| X | X | X | X |
|
|
| 01234 | 0123456789 | 01234567890123456789 | 1 |
|
|
+-----------+------------+---------------------------------------------------------------------------------------------------------------------------------+------+
|
|
# --table --quick --quick-max-column-width=0
|
|
+-----------+-------+------+------+
|
|
| aaaaaaaaa | aaaaa | a | b |
|
|
+-----------+-------+------+------+
|
|
| X | X | X | X |
|
|
| 01234 | 0123456789 | 01234567890123456789 | 1 |
|
|
+-----------+-------+------+------+
|
|
# --table --quick --quick-max-column-width=10
|
|
+-----------+------------+------------+------+
|
|
| aaaaaaaaa | aaaaa | a | b |
|
|
+-----------+------------+------------+------+
|
|
| X | X | X | X |
|
|
| 01234 | 0123456789 | 01234567890123456789 | 1 |
|
|
+-----------+------------+------------+------+
|
|
# --table --quick --quick-max-column-width=20
|
|
+-----------+------------+----------------------+------+
|
|
| aaaaaaaaa | aaaaa | a | b |
|
|
+-----------+------------+----------------------+------+
|
|
| X | X | X | X |
|
|
| 01234 | 0123456789 | 01234567890123456789 | 1 |
|
|
+-----------+------------+----------------------+------+
|
|
drop table t1;
|
|
#
|
|
# End of 10.5 tests
|
|
#
|
|
#
|
|
# MDEV-23818: mysql option --script-dir
|
|
#
|
|
# test 1: can't find the file at all
|
|
ERROR at line 1: Failed to open file 'file1', error: 2
|
|
# test 2: file in the current working directory
|
|
1
|
|
1
|
|
# test 3: file is present in CWD and also in script-dir
|
|
hello from file1
|
|
hello from file1
|
|
# test 4: file is only present in the script-dir
|
|
hello from dir1/file1.sql
|
|
hello from dir1/file1.sql
|
|
# test 5: script-dir file has source command that references CWD
|
|
hello from file2.sql
|
|
hello from file2.sql
|
|
# test 6: script-dir file has source command that references script-dir
|
|
hello from file2.sql
|
|
hello from file2.sql
|