Bug #56098 Server in bootstrap mode cannot execute arbitrarily long queries
Submitted: 18 Aug 2010 21:14 Modified: 4 Mar 2011 1:38
Reporter: Christopher Powers Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Installing Severity:S4 (Feature request)
Version:5.6.1-m4, all OS:Any
Assigned to: CPU Architecture:Any

[18 Aug 2010 21:14] Christopher Powers
Description:
Server in bootstrap mode cannot execute queries longer than MAX_BOOTSTRAP_QUERY_SIZE, currently set to 20,000.

If, during installation, a script is generated that contains a query exceeding this limit, then all tools which use the script will fail, including mysql_install_db and MTR.

How to repeat:
1) Run mysql_install_db and observe the error, or

2) Run MTR with any test and observe the error, or

3) Generate a query longer than MAX_BOOTSTRAP_QUERY_SIZE symbols, start server with --bootstrap option feeding the query to it.

Upon failure, the (non-informative) error message produced by server will be either:

100807  4:47:42 [ERROR] Aborting

or 

ERROR: 1149  You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
100807  5:21:22 [ERROR] Aborting

Suggested fix:
Modify read_bootstrap_query() in sql_bootstrap.cc to manage the bootstrap query buffer dynamically.

Also, issue a more descriptive error message upon failure.
[21 Aug 2010 9:22] Sveta Smirnova
Thank you for the report.

Verified as described.
[23 Aug 2010 15:34] Marc ALFF
The bootstrap script is not arbitrary, but generated from the source code
that is also part of the product.

If the bootstrap scripts were *changed* and the constant not increased,
yes the server will fail to start, but this is a bug in the change implemented,
not in the existing code: the change implemented is incomplete.

Also, if a single statement in the changed scripts exceeds 20,000 characters,
I think the design of the change itself is questionable,
and as a reviewer I would reject such changes.

The report title currently reads:
"Server in bootstrap mode cannot execute arbitrarily long queries"
and that is indeed correct:
the server bootstrap script can not execute *arbitrary* *long* queries,
because the content of the bootstrap script is:
- not intended to be arbitrary
- not intended to be long

The content of the bootstrap script is controlled by the server development team and not by the end user using the product.
As a result, the format of this script is more limited, to avoid un necessary complexity in the server implementation of the bootstrap code.

The current code is sufficient for the current content, and no code change is needed.

Implementing support for "arbitrary long" queries in bootstrap mode is a technical solution in search of a problem that does not exists yet.

This is not a bug.

At best, this could be considered a feature request, to have code in the server that is more resistant to later changes and requires less manual maintenance (in case changing a constant is considered too hard to do) when the content of the bootstrap script evolves.

Changing to a feature request.