diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-12-16 21:11:24 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-12-16 21:11:24 +0100 |
commit | fe7c2aaeeab289b09645748e2006a7a9409fbbfa (patch) | |
tree | 362bb915c03f593d64f5b86b5cc47752ad403593 /sql/sql_bootstrap.h | |
parent | 1679fe1c3e667f450f9737c07f3d0195bd9405cf (diff) | |
download | mariadb-git-fe7c2aaeeab289b09645748e2006a7a9409fbbfa.tar.gz |
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
Diffstat (limited to 'sql/sql_bootstrap.h')
-rw-r--r-- | sql/sql_bootstrap.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_bootstrap.h b/sql/sql_bootstrap.h index f80daf4a2f4..b8a302a8646 100644 --- a/sql/sql_bootstrap.h +++ b/sql/sql_bootstrap.h @@ -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 |