Loading innobase/dict/dict0dict.c +16 −6 Original line number Diff line number Diff line Loading @@ -2189,7 +2189,7 @@ dict_foreign_error_report( dict_foreign_error_report_low(file, fk->foreign_table_name); fputs(msg, file); fputs(" Constraint:\n", file); dict_print_info_on_foreign_key_in_create_format(file, NULL, fk); dict_print_info_on_foreign_key_in_create_format(file, NULL, fk, TRUE); if (fk->foreign_index) { fputs("\nThe index in the foreign key in table is ", file); ut_print_name(file, NULL, fk->foreign_index->name); Loading Loading @@ -4332,7 +4332,8 @@ dict_print_info_on_foreign_key_in_create_format( /*============================================*/ FILE* file, /* in: file where to print */ trx_t* trx, /* in: transaction */ dict_foreign_t* foreign)/* in: foreign key constraint */ dict_foreign_t* foreign, /* in: foreign key constraint */ ibool add_newline) /* in: whether to add a newline */ { const char* stripped_id; ulint i; Loading @@ -4345,7 +4346,16 @@ dict_print_info_on_foreign_key_in_create_format( stripped_id = foreign->id; } fputs(",\n CONSTRAINT ", file); putc(',', file); if (add_newline) { /* SHOW CREATE TABLE wants constraints each printed nicely on its own line, while error messages want no newlines inserted. */ fputs("\n ", file); } fputs(" CONSTRAINT ", file); ut_print_name(file, trx, stripped_id); fputs(" FOREIGN KEY (", file); Loading Loading @@ -4447,7 +4457,7 @@ dict_print_info_on_foreign_keys( while (foreign != NULL) { if (create_table_format) { dict_print_info_on_foreign_key_in_create_format( file, trx, foreign); file, trx, foreign, TRUE); } else { ulint i; fputs("; (", file); Loading innobase/include/dict0dict.h +4 −3 Original line number Diff line number Diff line Loading @@ -377,7 +377,8 @@ dict_print_info_on_foreign_key_in_create_format( /*============================================*/ FILE* file, /* in: file where to print */ trx_t* trx, /* in: transaction */ dict_foreign_t* foreign);/* in: foreign key constraint */ dict_foreign_t* foreign, /* in: foreign key constraint */ ibool add_newline); /* in: whether to add a newline */ /************************************************************************ Displays the names of the index and the table. */ void Loading innobase/include/os0file.h +11 −0 Original line number Diff line number Diff line Loading @@ -432,6 +432,17 @@ os_file_read( offset */ ulint n); /* in: number of bytes to read */ /*********************************************************************** Rewind file to its start, read at most size - 1 bytes from it to str, and NUL-terminate str. All errors are silently ignored. This function is mostly meant to be used with temporary files. */ void os_file_read_string( /*================*/ FILE* file, /* in: file to read from */ char* str, /* in: buffer where to read */ ulint size); /* in: size of buffer */ /*********************************************************************** Requests a synchronous positioned read operation. This function does not do any error handling. In case of error it returns FALSE. */ Loading innobase/include/trx0trx.h +19 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,22 @@ void trx_search_latch_release_if_reserved( /*=================================*/ trx_t* trx); /* in: transaction */ /********************************************************************** Set detailed error message for the transaction. */ void trx_set_detailed_error( /*===================*/ trx_t* trx, /* in: transaction struct */ char* msg); /* in: detailed error message */ /***************************************************************** Set detailed error message for the transaction from a file. Note that the file is rewinded before reading from it. */ void trx_set_detailed_error_from_file( /*=============================*/ trx_t* trx, /* in: transaction struct */ FILE* file); /* in: file to read message from */ /******************************************************************** Retrieves the error_info field from a trx. */ Loading Loading @@ -649,6 +665,9 @@ struct trx_struct{ trx_undo_arr_t* undo_no_arr; /* array of undo numbers of undo log records which are currently processed by a rollback operation */ /*------------------------------*/ char detailed_error[256]; /* detailed error message for last error, or empty. */ }; #define TRX_MAX_N_THREADS 32 /* maximum number of concurrent Loading innobase/include/ut0mem.h +12 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,18 @@ UNIV_INLINE int ut_strcmp(const void* str1, const void* str2); /************************************************************************** Copies up to size - 1 characters from the NUL-terminated string src to dst, NUL-terminating the result. Returns strlen(src), so truncation occurred if the return value >= size. */ ulint ut_strlcpy( /*=======*/ /* out: strlen(src) */ char* dst, /* in: destination buffer */ const char* src, /* in: source buffer */ ulint size); /* in: size of destination buffer */ /************************************************************************** Compute strlen(ut_strcpyq(str, q)). */ UNIV_INLINE Loading Loading
innobase/dict/dict0dict.c +16 −6 Original line number Diff line number Diff line Loading @@ -2189,7 +2189,7 @@ dict_foreign_error_report( dict_foreign_error_report_low(file, fk->foreign_table_name); fputs(msg, file); fputs(" Constraint:\n", file); dict_print_info_on_foreign_key_in_create_format(file, NULL, fk); dict_print_info_on_foreign_key_in_create_format(file, NULL, fk, TRUE); if (fk->foreign_index) { fputs("\nThe index in the foreign key in table is ", file); ut_print_name(file, NULL, fk->foreign_index->name); Loading Loading @@ -4332,7 +4332,8 @@ dict_print_info_on_foreign_key_in_create_format( /*============================================*/ FILE* file, /* in: file where to print */ trx_t* trx, /* in: transaction */ dict_foreign_t* foreign)/* in: foreign key constraint */ dict_foreign_t* foreign, /* in: foreign key constraint */ ibool add_newline) /* in: whether to add a newline */ { const char* stripped_id; ulint i; Loading @@ -4345,7 +4346,16 @@ dict_print_info_on_foreign_key_in_create_format( stripped_id = foreign->id; } fputs(",\n CONSTRAINT ", file); putc(',', file); if (add_newline) { /* SHOW CREATE TABLE wants constraints each printed nicely on its own line, while error messages want no newlines inserted. */ fputs("\n ", file); } fputs(" CONSTRAINT ", file); ut_print_name(file, trx, stripped_id); fputs(" FOREIGN KEY (", file); Loading Loading @@ -4447,7 +4457,7 @@ dict_print_info_on_foreign_keys( while (foreign != NULL) { if (create_table_format) { dict_print_info_on_foreign_key_in_create_format( file, trx, foreign); file, trx, foreign, TRUE); } else { ulint i; fputs("; (", file); Loading
innobase/include/dict0dict.h +4 −3 Original line number Diff line number Diff line Loading @@ -377,7 +377,8 @@ dict_print_info_on_foreign_key_in_create_format( /*============================================*/ FILE* file, /* in: file where to print */ trx_t* trx, /* in: transaction */ dict_foreign_t* foreign);/* in: foreign key constraint */ dict_foreign_t* foreign, /* in: foreign key constraint */ ibool add_newline); /* in: whether to add a newline */ /************************************************************************ Displays the names of the index and the table. */ void Loading
innobase/include/os0file.h +11 −0 Original line number Diff line number Diff line Loading @@ -432,6 +432,17 @@ os_file_read( offset */ ulint n); /* in: number of bytes to read */ /*********************************************************************** Rewind file to its start, read at most size - 1 bytes from it to str, and NUL-terminate str. All errors are silently ignored. This function is mostly meant to be used with temporary files. */ void os_file_read_string( /*================*/ FILE* file, /* in: file to read from */ char* str, /* in: buffer where to read */ ulint size); /* in: size of buffer */ /*********************************************************************** Requests a synchronous positioned read operation. This function does not do any error handling. In case of error it returns FALSE. */ Loading
innobase/include/trx0trx.h +19 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,22 @@ void trx_search_latch_release_if_reserved( /*=================================*/ trx_t* trx); /* in: transaction */ /********************************************************************** Set detailed error message for the transaction. */ void trx_set_detailed_error( /*===================*/ trx_t* trx, /* in: transaction struct */ char* msg); /* in: detailed error message */ /***************************************************************** Set detailed error message for the transaction from a file. Note that the file is rewinded before reading from it. */ void trx_set_detailed_error_from_file( /*=============================*/ trx_t* trx, /* in: transaction struct */ FILE* file); /* in: file to read message from */ /******************************************************************** Retrieves the error_info field from a trx. */ Loading Loading @@ -649,6 +665,9 @@ struct trx_struct{ trx_undo_arr_t* undo_no_arr; /* array of undo numbers of undo log records which are currently processed by a rollback operation */ /*------------------------------*/ char detailed_error[256]; /* detailed error message for last error, or empty. */ }; #define TRX_MAX_N_THREADS 32 /* maximum number of concurrent Loading
innobase/include/ut0mem.h +12 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,18 @@ UNIV_INLINE int ut_strcmp(const void* str1, const void* str2); /************************************************************************** Copies up to size - 1 characters from the NUL-terminated string src to dst, NUL-terminating the result. Returns strlen(src), so truncation occurred if the return value >= size. */ ulint ut_strlcpy( /*=======*/ /* out: strlen(src) */ char* dst, /* in: destination buffer */ const char* src, /* in: source buffer */ ulint size); /* in: size of destination buffer */ /************************************************************************** Compute strlen(ut_strcpyq(str, q)). */ UNIV_INLINE Loading