File: init_file_one_line_multiple_statements.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (47 lines) | stat: -rw-r--r-- 1,457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--echo #
--echo # Bug# 37559598 - Unexpected incorrect syntax reported for statement in init file
--echo #

--source include/linux.inc

let BOOTSTRAP_SQL= $MYSQL_TMP_DIR/tiny_bootstrap.sql;

let $MYSQLD_LOG= $MYSQLTEST_VARDIR/log/init_file_bootstrap.log;
let ENV_MYSQLD_LOG= $MYSQLD_LOG;

--echo # Create the bootstrap file.
write_file $BOOTSTRAP_SQL;
  SET character_set_client = 'cp850';
  SET sql_log_bin = OFF; ALTER USER 'test'@'localhost' IDENTIFIED BY 'FAArxtw*e8sDnSl:V)u>Z/QLY;IvfC)o'; CREATE DATABASE foo;
EOF

--echo # Create a test user.
CREATE USER 'test'@'localhost';

--let $restart_parameters=restart:--log_error_verbosity=3 --init-file=$BOOTSTRAP_SQL --log-error=$MYSQLD_LOG
--let $do_not_echo_parameters = 1
--source include/restart_mysqld.inc

--echo # There should be no syntax error during the execution of init-file
perl;
  use strict;
  my $log= $ENV{'ENV_MYSQLD_LOG'} or die;
  open(FILE, "$log") or die;
  my $c_w= grep(/You have an error in your SQL syntax/gi,<FILE>);
  print "#     You have an error in your SQL syntax - found $c_w times.\n";
  close(FILE);
EOF

--echo # 'foo' schema must exist.
SHOW DATABASES;

--echo # 'test'@'localhost' user should be able to log in using new password
--connect(changed_pass_conn, localhost, test, 'FAArxtw*e8sDnSl:V)u>Z/QLY;IvfC)o')
SELECT USER();
connection default;

--echo # Clean up
DROP DATABASE foo;
DROP USER 'test'@'localhost';
remove_file $BOOTSTRAP_SQL;
remove_file $MYSQLD_LOG;