Skip to content

Commit

Permalink
Add multiple parsing protection to include/mysqld_error.h
Browse files Browse the repository at this point in the history
  • Loading branch information
montywi committed Apr 18, 2017
1 parent a30c225 commit 634f918
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions extra/comp_err.c
Expand Up @@ -267,6 +267,7 @@ static int create_header_files(struct errors *error_head)
fprintf(sql_statef, "/* Autogenerated file, please don't edit */\n\n");
fprintf(er_namef, "/* Autogenerated file, please don't edit */\n\n");

fprintf(er_definef, "#ifndef ER_ERROR_FIRST\n");
fprintf(er_definef, "#define ER_ERROR_FIRST %d\n", error_head->d_code);

current_d_code= error_head->d_code -1;
Expand Down Expand Up @@ -314,6 +315,7 @@ static int create_header_files(struct errors *error_head)
}
/* finishing off with mysqld_error.h */
fprintf(er_definef, "#define ER_ERROR_LAST %d\n", er_last);
fprintf(er_definef, "#endif /* ER_ERROR_FIRST */\n");
my_fclose(er_definef, MYF(0));
my_fclose(sql_statef, MYF(0));
my_fclose(er_namef, MYF(0));
Expand Down

0 comments on commit 634f918

Please sign in to comment.