1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-3816 init-file stops getting executed if a long enough line is encountered; on a debug version, assertion `! is_set() || can_overwrite_status' fails

backport improved bootstrap error handling from 5.6

Was:
  revno: 3768.1.1
  committer: Christopher Powers <chris.powers@oracle.com>
  timestamp: Wed 2012-05-02 22:16:40 -0500
  message:
    Bug#11766342 INITIAL DB CREATION FAILS ON WINDOWS WITH AN ASSERT IN SQL_ERROR.CC
    Improved bootstrap error handling:
    - Detect and report file i/o errors
    - Report query size errors with nearest query text
This commit is contained in:
Sergei Golubchik
2012-12-16 21:11:24 +01:00
parent 1679fe1c3e
commit fe7c2aaeea
9 changed files with 127 additions and 30 deletions

View File

@ -29,15 +29,18 @@
Do not increase this size, use the multiline syntax instead.
*/
#define MAX_BOOTSTRAP_LINE_SIZE 20000
#define MAX_BOOTSTRAP_ERROR_LEN 256
#define READ_BOOTSTRAP_EOF 1
#define READ_BOOTSTRAP_ERROR 2
#define READ_BOOTSTRAP_SUCCESS 0
#define READ_BOOTSTRAP_EOF 1
#define READ_BOOTSTRAP_ERROR 2
#define READ_BOOTSTRAP_QUERY_SIZE 3
typedef void *fgets_input_t;
typedef char * (*fgets_fn_t)(char *, size_t, fgets_input_t);
typedef char * (*fgets_fn_t)(char *, size_t, fgets_input_t, int *error);
int read_bootstrap_query(char *query, int *query_length,
fgets_input_t input, fgets_fn_t fgets_fn);
fgets_input_t input, fgets_fn_t fgets_fn, int *error);
#endif