diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2021-03-03 10:24:16 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2021-03-18 08:02:48 +0100 |
commit | 9186ff88dad674ba4c335a47e9657e5b54efbf69 (patch) | |
tree | a68edc5fd765a782cfb13d40f3e1be58b1ae217a /sql/sql_parse.cc | |
parent | 601c577142639d7bde947d071ca944c16920340c (diff) | |
download | mariadb-git-9186ff88dad674ba4c335a47e9657e5b54efbf69.tar.gz |
MDEV-9077 - sys schema preparation
- increase MAX_BOOTSTRAP_QUERY_SIZE (sys.schema has SP over 50K large)
don't allocate bootstrap query on heap anymore.
- support DELIMITER in bootstrap
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 807bde840df..a574cb927eb 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -978,6 +978,7 @@ int bootstrap(MYSQL_FILE *file) DBUG_ENTER("handle_bootstrap"); THD *thd= new THD(next_thread_id()); + char *buffer= new char[MAX_BOOTSTRAP_QUERY_SIZE]; #ifdef WITH_WSREP thd->variables.wsrep_on= 0; #endif @@ -1011,12 +1012,12 @@ int bootstrap(MYSQL_FILE *file) for ( ; ; ) { - char buffer[MAX_BOOTSTRAP_QUERY_SIZE] = ""; + buffer[0]= 0; int rc, length; char *query; int error= 0; - rc= read_bootstrap_query(buffer, &length, file, fgets_fn, &error); + rc= read_bootstrap_query(buffer, &length, file, fgets_fn, 0, &error); if (rc == READ_BOOTSTRAP_EOF) break; @@ -1099,6 +1100,7 @@ int bootstrap(MYSQL_FILE *file) thd->lex->restore_set_statement_var(); } delete thd; + delete[] buffer; DBUG_RETURN(bootstrap_error); } |