[MDEV-18394] DELIMITER not working in mysqld init-file Created: 2019-01-28  Updated: 2023-11-15

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Procedure
Fix Version/s: None

Type: Task Priority: Major
Reporter: Dibyajyoti Panda Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: compat57, compat80, upstream-fixed

Issue Links:
PartOf
is part of MDEV-28906 MySQL 8.0 desired compatibility Open

 Description   

mysqld.init

DELIMITER //
select 1//
DELIMITER ;

When I run

mysqld --init-file="/tmp/mysqld.init"

I get a syntax error but the same init file doesn't give any error while run as

mysql < /tmp/mysqld.init

Here is an exact issue of mysql https://bugs.mysql.com/bug.php?id=17843

+---------------------------------+------------------------------------------+
| Variable_name                   | Value                                    |
+---------------------------------+------------------------------------------+
| innodb_version                  | 10.3.12                                  |
| protocol_version                | 10                                       |
| slave_type_conversions          |                                          |
| system_versioning_alter_history | ERROR                                    |
| system_versioning_asof          | DEFAULT                                  |
| version                         | 10.3.12-MariaDB-log                      |
| version_comment                 | MariaDB Server                           |
| version_compile_machine         | x86_64                                   |
| version_compile_os              | Linux                                    |
| version_malloc_library          | system                                   |
| version_source_revision         | faf206a848684bc0f87c93a2b47a55063bbccc6c |
| version_ssl_library             | OpenSSL 1.1.1a  20 Nov 2018              |
| wsrep_patch_version             | wsrep_25.23                              |
+---------------------------------+------------------------------------------+



 Comments   
Comment by Alice Sherepa [ 2019-01-28 ]

KB says about init_file: "a file containing SQL statements that will be executed by the server on startup. Each statement should be on a new line, and end with a semicolon."
DELIMITER is not a SQL command, it's a command of mysql client, so there are no errors here: mysql < /tmp/mysqld.init

Comment by Dibyajyoti Panda [ 2019-01-28 ]

So isn't it possible to execute an procedure inside init-file. Seems like mysql provides it here https://bugs.mysql.com/bug.php?id=17843. Can we take it as a feature request ?

Comment by Alice Sherepa [ 2019-01-28 ]

The fix there suggests that the procedure already was defined in a database and in init-file there is only call for that procedure. The same works in mariadb, I just checked.

Comment by Elena Stepanova [ 2019-01-28 ]

Converted it into a task (a.k.a feature request)

Comment by Daniel Black [ 2023-11-15 ]

retested still here

MariaDB 10.4.33-MariaDB source revision 73a38b68dc2a117642e3bddff086d075326cace6

mariadbd --init-file=/tmp/x.init
...
2023-11-15 11:44:52 0 [Note] Added new Master_info '' to hash table
ERROR: 1064  You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DELIMITER //
select 1//
DELIMITER ;' at line 1
2023-11-15 11:44:52 0 [Note] sql/mariadbd: ready for connections.
Version: '10.4.33-MariaDB'  socket: '/tmp/build-mariadb-server-10.4.sock'  port: 0  Source distribution

Generated at Thu Feb 08 08:43:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.