From df5d7a5b91c2f4f4a04d0774e3ecb76d8d209ebe Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Fri, 23 Aug 2002 10:52:24 +0300 Subject: [PATCH 1/6] row0mysql.c, ha_innobase.cc: Improved error message for out-of-sync frm files --- innobase/row/row0mysql.c | 12 +++++++++--- sql/ha_innobase.cc | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index bb33f7c1485..d7b685c7f9d 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1348,7 +1348,9 @@ row_create_table_for_mysql( "InnoDB: creating an InnoDB table with the same name in another\n" "InnoDB: database and moving the .frm file to the current database.\n" "InnoDB: Then MySQL thinks the table exists, and DROP TABLE will\n" - "InnoDB: succeed.\n"); + "InnoDB: succeed.\n" + "InnoDB: You can look further help from section 15.1 of\n" + "InnoDB: http://www.innodb.com/ibman.html\n"); } trx->error_state = DB_SUCCESS; @@ -1867,7 +1869,9 @@ row_drop_table_for_mysql( " InnoDB: Error: table %s does not exist in the InnoDB internal\n" "InnoDB: data dictionary though MySQL is trying to drop it.\n" "InnoDB: Have you copied the .frm file of the table to the\n" - "InnoDB: MySQL database directory from another database?\n", + "InnoDB: MySQL database directory from another database?\n" + "InnoDB: You can look further help from section 15.1 of\n" + "InnoDB: http://www.innodb.com/ibman.html\n", name); goto funct_exit; } @@ -2189,7 +2193,9 @@ row_rename_table_for_mysql( fprintf(stderr, " InnoDB: Error: table %s exists in the InnoDB internal data\n" "InnoDB: dictionary though MySQL is trying rename table %s to it.\n" - "InnoDB: Have you deleted the .frm file and not used DROP TABLE?\n", + "InnoDB: Have you deleted the .frm file and not used DROP TABLE?\n" + "InnoDB: You can look further help from section 15.1 of\n" + "InnoDB: http://www.innodb.com/ibman.html\n", new_name, old_name); fprintf(stderr, diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc index b69cbfa2c48..7beecda0f3d 100644 --- a/sql/ha_innobase.cc +++ b/sql/ha_innobase.cc @@ -971,7 +971,9 @@ Cannot find table %s from the internal data dictionary\n\ of InnoDB though the .frm file for the table exists. Maybe you\n\ have deleted and recreated InnoDB data files but have forgotten\n\ to delete the corresponding .frm files of InnoDB tables, or you\n\ -have moved .frm files to another database?", +have moved .frm files to another database?\n\ +Look from section 15.1 of http://www.innodb.com/ibman.html\n\ +how you can resolve the problem.\n", norm_name); free_share(share); From 8b637ac4063949fe4aaf0cd8d611a745eac09963 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Sat, 24 Aug 2002 01:07:50 +0300 Subject: [PATCH 2/6] lexyy.c, pars0grm.c, pars0lex.l, pars0grm.y: Remove potential memory leak caused by redefined alloca, remove include of unistd.h to allow compilation on Windows --- innobase/pars/lexyy.c | 321 +++++++++++++++++++++------------------ innobase/pars/pars0grm.c | 308 ++++++++++++++++++------------------- innobase/pars/pars0grm.y | 4 +- innobase/pars/pars0lex.l | 2 + 4 files changed, 331 insertions(+), 304 deletions(-) diff --git a/innobase/pars/lexyy.c b/innobase/pars/lexyy.c index 0f35a5661a1..0a333c726ff 100644 --- a/innobase/pars/lexyy.c +++ b/innobase/pars/lexyy.c @@ -583,8 +583,33 @@ SQL parser lexical analyzer: input file for the GNU Flex lexer generator Created 12/14/1997 Heikki Tuuri Published under the GPL version 2 + +The InnoDB parser is frozen because MySQL takes care of SQL parsing. +Therefore we normally keep the InnoDB parser C files as they are, and do +not automatically generate them from pars0grm.y and pars0lex.l. + +How to make the InnoDB parser and lexer C files: + +1. First do + bison -d pars0grm.y + That generates pars0grm.tab.c and pars0grm.tab.h. + +2. Rename pars0grm.tab.c to pars0grm.c and pars0grm.tab.h to pars0grm.h. + +3. Copy pars0grm.h also to /innobase/include + +4. Do + flex pars0lex.l + That generates lex.yy.c. + +5. Rename lex.yy.c to lexyy.c. + +6. Remove the #include of unistd.h from about line 2500 of lexyy.c + +These instructions seem to work at least with bison-1.28 and flex-2.5.4 on +Linux. *******************************************************/ -#line 11 "pars0lex.l" +#line 36 "pars0lex.l" #define YYSTYPE que_node_t* #include "univ.i" @@ -603,7 +628,7 @@ Published under the GPL version 2 #define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size) #define comment 1 -#line 607 "lex.yy.c" +#line 632 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -754,10 +779,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 32 "pars0lex.l" +#line 57 "pars0lex.l" -#line 761 "lex.yy.c" +#line 786 "lex.yy.c" if ( yy_init ) { @@ -842,7 +867,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 34 "pars0lex.l" +#line 59 "pars0lex.l" { yylval = sym_tab_add_int_lit(pars_sym_tab_global, atoi(yytext)); @@ -851,7 +876,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 40 "pars0lex.l" +#line 65 "pars0lex.l" { ut_error; /* not implemented */ @@ -860,7 +885,7 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 46 "pars0lex.l" +#line 71 "pars0lex.l" { /* Remove the single quotes around the string */ @@ -872,7 +897,7 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 55 "pars0lex.l" +#line 80 "pars0lex.l" { yylval = sym_tab_add_null_lit(pars_sym_tab_global); @@ -881,7 +906,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 61 "pars0lex.l" +#line 86 "pars0lex.l" { /* Implicit cursor name */ yylval = sym_tab_add_str_lit(pars_sym_tab_global, @@ -891,511 +916,511 @@ YY_RULE_SETUP YY_BREAK case 6: YY_RULE_SETUP -#line 68 "pars0lex.l" +#line 93 "pars0lex.l" { return(PARS_AND_TOKEN); } YY_BREAK case 7: YY_RULE_SETUP -#line 72 "pars0lex.l" +#line 97 "pars0lex.l" { return(PARS_OR_TOKEN); } YY_BREAK case 8: YY_RULE_SETUP -#line 76 "pars0lex.l" +#line 101 "pars0lex.l" { return(PARS_NOT_TOKEN); } YY_BREAK case 9: YY_RULE_SETUP -#line 80 "pars0lex.l" +#line 105 "pars0lex.l" { return(PARS_PROCEDURE_TOKEN); } YY_BREAK case 10: YY_RULE_SETUP -#line 84 "pars0lex.l" +#line 109 "pars0lex.l" { return(PARS_IN_TOKEN); } YY_BREAK case 11: YY_RULE_SETUP -#line 88 "pars0lex.l" +#line 113 "pars0lex.l" { return(PARS_OUT_TOKEN); } YY_BREAK case 12: YY_RULE_SETUP -#line 92 "pars0lex.l" +#line 117 "pars0lex.l" { return(PARS_INT_TOKEN); } YY_BREAK case 13: YY_RULE_SETUP -#line 96 "pars0lex.l" +#line 121 "pars0lex.l" { return(PARS_INT_TOKEN); } YY_BREAK case 14: YY_RULE_SETUP -#line 100 "pars0lex.l" +#line 125 "pars0lex.l" { return(PARS_FLOAT_TOKEN); } YY_BREAK case 15: YY_RULE_SETUP -#line 104 "pars0lex.l" +#line 129 "pars0lex.l" { return(PARS_CHAR_TOKEN); } YY_BREAK case 16: YY_RULE_SETUP -#line 108 "pars0lex.l" +#line 133 "pars0lex.l" { return(PARS_IS_TOKEN); } YY_BREAK case 17: YY_RULE_SETUP -#line 112 "pars0lex.l" +#line 137 "pars0lex.l" { return(PARS_BEGIN_TOKEN); } YY_BREAK case 18: YY_RULE_SETUP -#line 116 "pars0lex.l" +#line 141 "pars0lex.l" { return(PARS_END_TOKEN); } YY_BREAK case 19: YY_RULE_SETUP -#line 120 "pars0lex.l" +#line 145 "pars0lex.l" { return(PARS_IF_TOKEN); } YY_BREAK case 20: YY_RULE_SETUP -#line 124 "pars0lex.l" +#line 149 "pars0lex.l" { return(PARS_THEN_TOKEN); } YY_BREAK case 21: YY_RULE_SETUP -#line 128 "pars0lex.l" +#line 153 "pars0lex.l" { return(PARS_ELSE_TOKEN); } YY_BREAK case 22: YY_RULE_SETUP -#line 132 "pars0lex.l" +#line 157 "pars0lex.l" { return(PARS_ELSIF_TOKEN); } YY_BREAK case 23: YY_RULE_SETUP -#line 136 "pars0lex.l" +#line 161 "pars0lex.l" { return(PARS_LOOP_TOKEN); } YY_BREAK case 24: YY_RULE_SETUP -#line 140 "pars0lex.l" +#line 165 "pars0lex.l" { return(PARS_WHILE_TOKEN); } YY_BREAK case 25: YY_RULE_SETUP -#line 144 "pars0lex.l" +#line 169 "pars0lex.l" { return(PARS_RETURN_TOKEN); } YY_BREAK case 26: YY_RULE_SETUP -#line 148 "pars0lex.l" +#line 173 "pars0lex.l" { return(PARS_SELECT_TOKEN); } YY_BREAK case 27: YY_RULE_SETUP -#line 152 "pars0lex.l" +#line 177 "pars0lex.l" { return(PARS_SUM_TOKEN); } YY_BREAK case 28: YY_RULE_SETUP -#line 156 "pars0lex.l" +#line 181 "pars0lex.l" { return(PARS_COUNT_TOKEN); } YY_BREAK case 29: YY_RULE_SETUP -#line 160 "pars0lex.l" +#line 185 "pars0lex.l" { return(PARS_DISTINCT_TOKEN); } YY_BREAK case 30: YY_RULE_SETUP -#line 164 "pars0lex.l" +#line 189 "pars0lex.l" { return(PARS_FROM_TOKEN); } YY_BREAK case 31: YY_RULE_SETUP -#line 168 "pars0lex.l" +#line 193 "pars0lex.l" { return(PARS_WHERE_TOKEN); } YY_BREAK case 32: YY_RULE_SETUP -#line 172 "pars0lex.l" +#line 197 "pars0lex.l" { return(PARS_FOR_TOKEN); } YY_BREAK case 33: YY_RULE_SETUP -#line 176 "pars0lex.l" +#line 201 "pars0lex.l" { return(PARS_CONSISTENT_TOKEN); } YY_BREAK case 34: YY_RULE_SETUP -#line 180 "pars0lex.l" +#line 205 "pars0lex.l" { return(PARS_READ_TOKEN); } YY_BREAK case 35: YY_RULE_SETUP -#line 184 "pars0lex.l" +#line 209 "pars0lex.l" { return(PARS_ORDER_TOKEN); } YY_BREAK case 36: YY_RULE_SETUP -#line 188 "pars0lex.l" +#line 213 "pars0lex.l" { return(PARS_BY_TOKEN); } YY_BREAK case 37: YY_RULE_SETUP -#line 192 "pars0lex.l" +#line 217 "pars0lex.l" { return(PARS_ASC_TOKEN); } YY_BREAK case 38: YY_RULE_SETUP -#line 196 "pars0lex.l" +#line 221 "pars0lex.l" { return(PARS_DESC_TOKEN); } YY_BREAK case 39: YY_RULE_SETUP -#line 200 "pars0lex.l" +#line 225 "pars0lex.l" { return(PARS_INSERT_TOKEN); } YY_BREAK case 40: YY_RULE_SETUP -#line 204 "pars0lex.l" +#line 229 "pars0lex.l" { return(PARS_INTO_TOKEN); } YY_BREAK case 41: YY_RULE_SETUP -#line 208 "pars0lex.l" +#line 233 "pars0lex.l" { return(PARS_VALUES_TOKEN); } YY_BREAK case 42: YY_RULE_SETUP -#line 212 "pars0lex.l" +#line 237 "pars0lex.l" { return(PARS_UPDATE_TOKEN); } YY_BREAK case 43: YY_RULE_SETUP -#line 216 "pars0lex.l" +#line 241 "pars0lex.l" { return(PARS_SET_TOKEN); } YY_BREAK case 44: YY_RULE_SETUP -#line 220 "pars0lex.l" +#line 245 "pars0lex.l" { return(PARS_DELETE_TOKEN); } YY_BREAK case 45: YY_RULE_SETUP -#line 224 "pars0lex.l" +#line 249 "pars0lex.l" { return(PARS_CURRENT_TOKEN); } YY_BREAK case 46: YY_RULE_SETUP -#line 228 "pars0lex.l" +#line 253 "pars0lex.l" { return(PARS_OF_TOKEN); } YY_BREAK case 47: YY_RULE_SETUP -#line 232 "pars0lex.l" +#line 257 "pars0lex.l" { return(PARS_CREATE_TOKEN); } YY_BREAK case 48: YY_RULE_SETUP -#line 236 "pars0lex.l" +#line 261 "pars0lex.l" { return(PARS_TABLE_TOKEN); } YY_BREAK case 49: YY_RULE_SETUP -#line 240 "pars0lex.l" +#line 265 "pars0lex.l" { return(PARS_INDEX_TOKEN); } YY_BREAK case 50: YY_RULE_SETUP -#line 244 "pars0lex.l" +#line 269 "pars0lex.l" { return(PARS_UNIQUE_TOKEN); } YY_BREAK case 51: YY_RULE_SETUP -#line 248 "pars0lex.l" +#line 273 "pars0lex.l" { return(PARS_CLUSTERED_TOKEN); } YY_BREAK case 52: YY_RULE_SETUP -#line 252 "pars0lex.l" +#line 277 "pars0lex.l" { return(PARS_DOES_NOT_FIT_IN_MEM_TOKEN); } YY_BREAK case 53: YY_RULE_SETUP -#line 256 "pars0lex.l" +#line 281 "pars0lex.l" { return(PARS_ON_TOKEN); } YY_BREAK case 54: YY_RULE_SETUP -#line 260 "pars0lex.l" +#line 285 "pars0lex.l" { return(PARS_DECLARE_TOKEN); } YY_BREAK case 55: YY_RULE_SETUP -#line 264 "pars0lex.l" +#line 289 "pars0lex.l" { return(PARS_CURSOR_TOKEN); } YY_BREAK case 56: YY_RULE_SETUP -#line 268 "pars0lex.l" +#line 293 "pars0lex.l" { return(PARS_OPEN_TOKEN); } YY_BREAK case 57: YY_RULE_SETUP -#line 272 "pars0lex.l" +#line 297 "pars0lex.l" { return(PARS_FETCH_TOKEN); } YY_BREAK case 58: YY_RULE_SETUP -#line 276 "pars0lex.l" +#line 301 "pars0lex.l" { return(PARS_CLOSE_TOKEN); } YY_BREAK case 59: YY_RULE_SETUP -#line 280 "pars0lex.l" +#line 305 "pars0lex.l" { return(PARS_NOTFOUND_TOKEN); } YY_BREAK case 60: YY_RULE_SETUP -#line 284 "pars0lex.l" +#line 309 "pars0lex.l" { return(PARS_TO_CHAR_TOKEN); } YY_BREAK case 61: YY_RULE_SETUP -#line 288 "pars0lex.l" +#line 313 "pars0lex.l" { return(PARS_TO_NUMBER_TOKEN); } YY_BREAK case 62: YY_RULE_SETUP -#line 292 "pars0lex.l" +#line 317 "pars0lex.l" { return(PARS_TO_BINARY_TOKEN); } YY_BREAK case 63: YY_RULE_SETUP -#line 296 "pars0lex.l" +#line 321 "pars0lex.l" { return(PARS_BINARY_TO_NUMBER_TOKEN); } YY_BREAK case 64: YY_RULE_SETUP -#line 300 "pars0lex.l" +#line 325 "pars0lex.l" { return(PARS_SUBSTR_TOKEN); } YY_BREAK case 65: YY_RULE_SETUP -#line 304 "pars0lex.l" +#line 329 "pars0lex.l" { return(PARS_REPLSTR_TOKEN); } YY_BREAK case 66: YY_RULE_SETUP -#line 308 "pars0lex.l" +#line 333 "pars0lex.l" { return(PARS_CONCAT_TOKEN); } YY_BREAK case 67: YY_RULE_SETUP -#line 312 "pars0lex.l" +#line 337 "pars0lex.l" { return(PARS_INSTR_TOKEN); } YY_BREAK case 68: YY_RULE_SETUP -#line 316 "pars0lex.l" +#line 341 "pars0lex.l" { return(PARS_LENGTH_TOKEN); } YY_BREAK case 69: YY_RULE_SETUP -#line 320 "pars0lex.l" +#line 345 "pars0lex.l" { return(PARS_SYSDATE_TOKEN); } YY_BREAK case 70: YY_RULE_SETUP -#line 324 "pars0lex.l" +#line 349 "pars0lex.l" { return(PARS_PRINTF_TOKEN); } YY_BREAK case 71: YY_RULE_SETUP -#line 328 "pars0lex.l" +#line 353 "pars0lex.l" { return(PARS_ASSERT_TOKEN); } YY_BREAK case 72: YY_RULE_SETUP -#line 332 "pars0lex.l" +#line 357 "pars0lex.l" { return(PARS_RND_TOKEN); } YY_BREAK case 73: YY_RULE_SETUP -#line 336 "pars0lex.l" +#line 361 "pars0lex.l" { return(PARS_RND_STR_TOKEN); } YY_BREAK case 74: YY_RULE_SETUP -#line 340 "pars0lex.l" +#line 365 "pars0lex.l" { return(PARS_ROW_PRINTF_TOKEN); } YY_BREAK case 75: YY_RULE_SETUP -#line 344 "pars0lex.l" +#line 369 "pars0lex.l" { return(PARS_COMMIT_TOKEN); } YY_BREAK case 76: YY_RULE_SETUP -#line 348 "pars0lex.l" +#line 373 "pars0lex.l" { return(PARS_ROLLBACK_TOKEN); } YY_BREAK case 77: YY_RULE_SETUP -#line 352 "pars0lex.l" +#line 377 "pars0lex.l" { return(PARS_WORK_TOKEN); } YY_BREAK case 78: YY_RULE_SETUP -#line 356 "pars0lex.l" +#line 381 "pars0lex.l" { yylval = sym_tab_add_id(pars_sym_tab_global, (byte*)yytext, @@ -1405,88 +1430,48 @@ YY_RULE_SETUP YY_BREAK case 79: YY_RULE_SETUP -#line 363 "pars0lex.l" +#line 388 "pars0lex.l" { return(PARS_DDOT_TOKEN); } YY_BREAK case 80: YY_RULE_SETUP -#line 367 "pars0lex.l" +#line 392 "pars0lex.l" { return(PARS_ASSIGN_TOKEN); } YY_BREAK case 81: YY_RULE_SETUP -#line 371 "pars0lex.l" +#line 396 "pars0lex.l" { return(PARS_LE_TOKEN); } YY_BREAK case 82: YY_RULE_SETUP -#line 375 "pars0lex.l" +#line 400 "pars0lex.l" { return(PARS_GE_TOKEN); } YY_BREAK case 83: YY_RULE_SETUP -#line 379 "pars0lex.l" +#line 404 "pars0lex.l" { return(PARS_NE_TOKEN); } YY_BREAK case 84: YY_RULE_SETUP -#line 383 "pars0lex.l" -{ - - return((int)(*yytext)); -} - YY_BREAK -case 85: -YY_RULE_SETUP -#line 388 "pars0lex.l" -{ - - return((int)(*yytext)); -} - YY_BREAK -case 86: -YY_RULE_SETUP -#line 393 "pars0lex.l" -{ - - return((int)(*yytext)); -} - YY_BREAK -case 87: -YY_RULE_SETUP -#line 398 "pars0lex.l" -{ - - return((int)(*yytext)); -} - YY_BREAK -case 88: -YY_RULE_SETUP -#line 403 "pars0lex.l" -{ - - return((int)(*yytext)); -} - YY_BREAK -case 89: -YY_RULE_SETUP #line 408 "pars0lex.l" { return((int)(*yytext)); } YY_BREAK -case 90: +case 85: YY_RULE_SETUP #line 413 "pars0lex.l" { @@ -1494,7 +1479,7 @@ YY_RULE_SETUP return((int)(*yytext)); } YY_BREAK -case 91: +case 86: YY_RULE_SETUP #line 418 "pars0lex.l" { @@ -1502,7 +1487,7 @@ YY_RULE_SETUP return((int)(*yytext)); } YY_BREAK -case 92: +case 87: YY_RULE_SETUP #line 423 "pars0lex.l" { @@ -1510,7 +1495,7 @@ YY_RULE_SETUP return((int)(*yytext)); } YY_BREAK -case 93: +case 88: YY_RULE_SETUP #line 428 "pars0lex.l" { @@ -1518,7 +1503,7 @@ YY_RULE_SETUP return((int)(*yytext)); } YY_BREAK -case 94: +case 89: YY_RULE_SETUP #line 433 "pars0lex.l" { @@ -1526,7 +1511,7 @@ YY_RULE_SETUP return((int)(*yytext)); } YY_BREAK -case 95: +case 90: YY_RULE_SETUP #line 438 "pars0lex.l" { @@ -1534,7 +1519,7 @@ YY_RULE_SETUP return((int)(*yytext)); } YY_BREAK -case 96: +case 91: YY_RULE_SETUP #line 443 "pars0lex.l" { @@ -1542,7 +1527,7 @@ YY_RULE_SETUP return((int)(*yytext)); } YY_BREAK -case 97: +case 92: YY_RULE_SETUP #line 448 "pars0lex.l" { @@ -1550,7 +1535,7 @@ YY_RULE_SETUP return((int)(*yytext)); } YY_BREAK -case 98: +case 93: YY_RULE_SETUP #line 453 "pars0lex.l" { @@ -1558,44 +1543,84 @@ YY_RULE_SETUP return((int)(*yytext)); } YY_BREAK -case 99: +case 94: YY_RULE_SETUP #line 458 "pars0lex.l" +{ + + return((int)(*yytext)); +} + YY_BREAK +case 95: +YY_RULE_SETUP +#line 463 "pars0lex.l" +{ + + return((int)(*yytext)); +} + YY_BREAK +case 96: +YY_RULE_SETUP +#line 468 "pars0lex.l" +{ + + return((int)(*yytext)); +} + YY_BREAK +case 97: +YY_RULE_SETUP +#line 473 "pars0lex.l" +{ + + return((int)(*yytext)); +} + YY_BREAK +case 98: +YY_RULE_SETUP +#line 478 "pars0lex.l" +{ + + return((int)(*yytext)); +} + YY_BREAK +case 99: +YY_RULE_SETUP +#line 483 "pars0lex.l" BEGIN(comment); /* eat up comment */ YY_BREAK case 100: YY_RULE_SETUP -#line 460 "pars0lex.l" +#line 485 "pars0lex.l" YY_BREAK case 101: YY_RULE_SETUP -#line 461 "pars0lex.l" +#line 486 "pars0lex.l" YY_BREAK case 102: YY_RULE_SETUP -#line 462 "pars0lex.l" +#line 487 "pars0lex.l" YY_BREAK case 103: YY_RULE_SETUP -#line 463 "pars0lex.l" +#line 488 "pars0lex.l" YY_BREAK case 104: YY_RULE_SETUP -#line 464 "pars0lex.l" +#line 489 "pars0lex.l" BEGIN(INITIAL); YY_BREAK case 105: YY_RULE_SETUP -#line 466 "pars0lex.l" +#line 491 "pars0lex.l" /* eat up whitespace */ YY_BREAK case 106: YY_RULE_SETUP -#line 469 "pars0lex.l" +#line 494 "pars0lex.l" { printf("Unrecognized character: %s\n", yytext); @@ -1606,10 +1631,10 @@ YY_RULE_SETUP YY_BREAK case 107: YY_RULE_SETUP -#line 477 "pars0lex.l" +#line 502 "pars0lex.l" ECHO; YY_BREAK -#line 1613 "lex.yy.c" +#line 1638 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(comment): yyterminate(); @@ -2176,7 +2201,7 @@ YY_BUFFER_STATE b; #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE -#include + #endif #endif @@ -2496,5 +2521,5 @@ int main() return 0; } #endif -#line 477 "pars0lex.l" +#line 502 "pars0lex.l" diff --git a/innobase/pars/pars0grm.c b/innobase/pars/pars0grm.c index 560a3fa6400..1b7b31f6443 100644 --- a/innobase/pars/pars0grm.c +++ b/innobase/pars/pars0grm.c @@ -89,12 +89,10 @@ #define PARS_WORK_TOKEN 339 #define NEG 340 -#line 10 "pars0grm.y" +#line 13 "pars0grm.y" /* The value of the semantic attribute is a pointer to a query tree node que_node_t */ -#define YYSTYPE que_node_t* -#define alloca mem_alloc #include @@ -105,6 +103,8 @@ que_node_t */ #include "que0que.h" #include "row0sel.h" +#define YYSTYPE que_node_t* + /* #define __STDC__ */ int @@ -242,22 +242,22 @@ static const short yyrhs[] = { 162, #if YYDEBUG != 0 static const short yyrline[] = { 0, - 126, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 151, 153, 157, 159, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 183, 187, 189, - 190, 191, 193, 194, 195, 196, 197, 198, 199, 202, - 204, 205, 208, 213, 218, 220, 221, 224, 226, 230, - 232, 233, 237, 239, 240, 243, 245, 250, 256, 262, - 264, 265, 269, 272, 274, 277, 279, 282, 284, 288, - 290, 294, 296, 297, 300, 302, 306, 316, 321, 324, - 328, 332, 334, 338, 344, 351, 356, 361, 367, 372, - 377, 382, 387, 393, 395, 399, 401, 403, 406, 413, - 419, 427, 431, 437, 443, 448, 452, 454, 458, 460, - 465, 471, 473, 477, 479, 482, 484, 487, 495, 500, - 505, 507, 510, 514, 519, 521, 522, 526, 531, 533, - 534, 537, 543, 545, 546, 549 + 129, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 154, 156, 160, 162, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 186, 190, 192, + 193, 194, 196, 197, 198, 199, 200, 201, 202, 205, + 207, 208, 211, 216, 221, 223, 224, 227, 229, 233, + 235, 236, 240, 242, 243, 246, 248, 253, 259, 265, + 267, 268, 272, 275, 277, 280, 282, 285, 287, 291, + 293, 297, 299, 300, 303, 305, 309, 319, 324, 327, + 331, 335, 337, 341, 347, 354, 359, 364, 370, 375, + 380, 385, 390, 396, 398, 402, 404, 406, 409, 416, + 422, 430, 434, 440, 446, 451, 455, 457, 461, 463, + 468, 474, 476, 480, 482, 485, 487, 490, 498, 503, + 508, 510, 513, 517, 522, 524, 525, 529, 534, 536, + 537, 540, 546, 548, 549, 552 }; #endif @@ -1122,218 +1122,218 @@ yyreduce: switch (yyn) { case 23: -#line 152 "pars0grm.y" +#line 155 "pars0grm.y" { yyval = que_node_list_add_last(NULL, yyvsp[0]); ; break;} case 24: -#line 154 "pars0grm.y" +#line 157 "pars0grm.y" { yyval = que_node_list_add_last(yyvsp[-1], yyvsp[0]); ; break;} case 25: -#line 158 "pars0grm.y" -{ yyval = yyvsp[0];; - break;} -case 26: -#line 160 "pars0grm.y" -{ yyval = pars_func(yyvsp[-3], yyvsp[-1]); ; - break;} -case 27: #line 161 "pars0grm.y" { yyval = yyvsp[0];; break;} -case 28: -#line 162 "pars0grm.y" -{ yyval = yyvsp[0];; - break;} -case 29: +case 26: #line 163 "pars0grm.y" -{ yyval = yyvsp[0];; +{ yyval = pars_func(yyvsp[-3], yyvsp[-1]); ; break;} -case 30: +case 27: #line 164 "pars0grm.y" { yyval = yyvsp[0];; break;} -case 31: +case 28: #line 165 "pars0grm.y" { yyval = yyvsp[0];; break;} -case 32: +case 29: #line 166 "pars0grm.y" +{ yyval = yyvsp[0];; + break;} +case 30: +#line 167 "pars0grm.y" +{ yyval = yyvsp[0];; + break;} +case 31: +#line 168 "pars0grm.y" +{ yyval = yyvsp[0];; + break;} +case 32: +#line 169 "pars0grm.y" { yyval = pars_op('+', yyvsp[-2], yyvsp[0]); ; break;} case 33: -#line 167 "pars0grm.y" +#line 170 "pars0grm.y" { yyval = pars_op('-', yyvsp[-2], yyvsp[0]); ; break;} case 34: -#line 168 "pars0grm.y" +#line 171 "pars0grm.y" { yyval = pars_op('*', yyvsp[-2], yyvsp[0]); ; break;} case 35: -#line 169 "pars0grm.y" +#line 172 "pars0grm.y" { yyval = pars_op('/', yyvsp[-2], yyvsp[0]); ; break;} case 36: -#line 170 "pars0grm.y" +#line 173 "pars0grm.y" { yyval = pars_op('-', yyvsp[0], NULL); ; break;} case 37: -#line 171 "pars0grm.y" +#line 174 "pars0grm.y" { yyval = yyvsp[-1]; ; break;} case 38: -#line 172 "pars0grm.y" +#line 175 "pars0grm.y" { yyval = pars_op('=', yyvsp[-2], yyvsp[0]); ; break;} case 39: -#line 173 "pars0grm.y" +#line 176 "pars0grm.y" { yyval = pars_op('<', yyvsp[-2], yyvsp[0]); ; break;} case 40: -#line 174 "pars0grm.y" +#line 177 "pars0grm.y" { yyval = pars_op('>', yyvsp[-2], yyvsp[0]); ; break;} case 41: -#line 175 "pars0grm.y" +#line 178 "pars0grm.y" { yyval = pars_op(PARS_GE_TOKEN, yyvsp[-2], yyvsp[0]); ; break;} case 42: -#line 176 "pars0grm.y" +#line 179 "pars0grm.y" { yyval = pars_op(PARS_LE_TOKEN, yyvsp[-2], yyvsp[0]); ; break;} case 43: -#line 177 "pars0grm.y" +#line 180 "pars0grm.y" { yyval = pars_op(PARS_NE_TOKEN, yyvsp[-2], yyvsp[0]); ; break;} case 44: -#line 178 "pars0grm.y" +#line 181 "pars0grm.y" { yyval = pars_op(PARS_AND_TOKEN, yyvsp[-2], yyvsp[0]); ; break;} case 45: -#line 179 "pars0grm.y" +#line 182 "pars0grm.y" { yyval = pars_op(PARS_OR_TOKEN, yyvsp[-2], yyvsp[0]); ; break;} case 46: -#line 180 "pars0grm.y" +#line 183 "pars0grm.y" { yyval = pars_op(PARS_NOT_TOKEN, yyvsp[0], NULL); ; break;} case 47: -#line 182 "pars0grm.y" +#line 185 "pars0grm.y" { yyval = pars_op(PARS_NOTFOUND_TOKEN, yyvsp[-2], NULL); ; break;} case 48: -#line 184 "pars0grm.y" +#line 187 "pars0grm.y" { yyval = pars_op(PARS_NOTFOUND_TOKEN, yyvsp[-2], NULL); ; break;} case 49: -#line 188 "pars0grm.y" +#line 191 "pars0grm.y" { yyval = &pars_to_char_token; ; break;} case 50: -#line 189 "pars0grm.y" +#line 192 "pars0grm.y" { yyval = &pars_to_number_token; ; break;} case 51: -#line 190 "pars0grm.y" +#line 193 "pars0grm.y" { yyval = &pars_to_binary_token; ; break;} case 52: -#line 192 "pars0grm.y" +#line 195 "pars0grm.y" { yyval = &pars_binary_to_number_token; ; break;} case 53: -#line 193 "pars0grm.y" +#line 196 "pars0grm.y" { yyval = &pars_substr_token; ; break;} case 54: -#line 194 "pars0grm.y" +#line 197 "pars0grm.y" { yyval = &pars_concat_token; ; break;} case 55: -#line 195 "pars0grm.y" +#line 198 "pars0grm.y" { yyval = &pars_instr_token; ; break;} case 56: -#line 196 "pars0grm.y" +#line 199 "pars0grm.y" { yyval = &pars_length_token; ; break;} case 57: -#line 197 "pars0grm.y" +#line 200 "pars0grm.y" { yyval = &pars_sysdate_token; ; break;} case 58: -#line 198 "pars0grm.y" +#line 201 "pars0grm.y" { yyval = &pars_rnd_token; ; break;} case 59: -#line 199 "pars0grm.y" +#line 202 "pars0grm.y" { yyval = &pars_rnd_str_token; ; break;} case 63: -#line 210 "pars0grm.y" +#line 213 "pars0grm.y" { yyval = pars_stored_procedure_call(yyvsp[-4]); ; break;} case 64: -#line 215 "pars0grm.y" +#line 218 "pars0grm.y" { yyval = pars_procedure_call(yyvsp[-3], yyvsp[-1]); ; break;} case 65: -#line 219 "pars0grm.y" +#line 222 "pars0grm.y" { yyval = &pars_replstr_token; ; break;} case 66: -#line 220 "pars0grm.y" +#line 223 "pars0grm.y" { yyval = &pars_printf_token; ; break;} case 67: -#line 221 "pars0grm.y" +#line 224 "pars0grm.y" { yyval = &pars_assert_token; ; break;} case 68: -#line 225 "pars0grm.y" +#line 228 "pars0grm.y" { yyval = que_node_list_add_last(NULL, yyvsp[0]); ; break;} case 69: -#line 227 "pars0grm.y" +#line 230 "pars0grm.y" { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ; break;} case 70: -#line 231 "pars0grm.y" +#line 234 "pars0grm.y" { yyval = NULL; ; break;} case 71: -#line 232 "pars0grm.y" +#line 235 "pars0grm.y" { yyval = que_node_list_add_last(NULL, yyvsp[0]); ; break;} case 72: -#line 234 "pars0grm.y" +#line 237 "pars0grm.y" { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ; break;} case 73: -#line 238 "pars0grm.y" +#line 241 "pars0grm.y" { yyval = NULL; ; break;} case 74: -#line 239 "pars0grm.y" +#line 242 "pars0grm.y" { yyval = que_node_list_add_last(NULL, yyvsp[0]);; break;} case 75: -#line 240 "pars0grm.y" +#line 243 "pars0grm.y" { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ; break;} case 76: -#line 244 "pars0grm.y" +#line 247 "pars0grm.y" { yyval = yyvsp[0]; ; break;} case 77: -#line 246 "pars0grm.y" +#line 249 "pars0grm.y" { yyval = pars_func(&pars_count_token, que_node_list_add_last(NULL, sym_tab_add_int_lit( pars_sym_tab_global, 1))); ; break;} case 78: -#line 251 "pars0grm.y" +#line 254 "pars0grm.y" { yyval = pars_func(&pars_count_token, que_node_list_add_last(NULL, pars_func(&pars_distinct_token, @@ -1341,302 +1341,302 @@ case 78: NULL, yyvsp[-1])))); ; break;} case 79: -#line 257 "pars0grm.y" +#line 260 "pars0grm.y" { yyval = pars_func(&pars_sum_token, que_node_list_add_last(NULL, yyvsp[-1])); ; break;} case 80: -#line 263 "pars0grm.y" +#line 266 "pars0grm.y" { yyval = NULL; ; break;} case 81: -#line 264 "pars0grm.y" +#line 267 "pars0grm.y" { yyval = que_node_list_add_last(NULL, yyvsp[0]); ; break;} case 82: -#line 266 "pars0grm.y" +#line 269 "pars0grm.y" { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ; break;} case 83: -#line 270 "pars0grm.y" +#line 273 "pars0grm.y" { yyval = pars_select_list(&pars_star_denoter, NULL); ; break;} case 84: -#line 273 "pars0grm.y" +#line 276 "pars0grm.y" { yyval = pars_select_list(yyvsp[-2], yyvsp[0]); ; break;} case 85: -#line 274 "pars0grm.y" +#line 277 "pars0grm.y" { yyval = pars_select_list(yyvsp[0], NULL); ; break;} case 86: -#line 278 "pars0grm.y" +#line 281 "pars0grm.y" { yyval = NULL; ; break;} case 87: -#line 279 "pars0grm.y" +#line 282 "pars0grm.y" { yyval = yyvsp[0]; ; break;} case 88: -#line 283 "pars0grm.y" +#line 286 "pars0grm.y" { yyval = NULL; ; break;} case 89: -#line 285 "pars0grm.y" +#line 288 "pars0grm.y" { yyval = &pars_update_token; ; break;} case 90: -#line 289 "pars0grm.y" +#line 292 "pars0grm.y" { yyval = NULL; ; break;} case 91: -#line 291 "pars0grm.y" +#line 294 "pars0grm.y" { yyval = &pars_consistent_token; ; break;} case 92: -#line 295 "pars0grm.y" +#line 298 "pars0grm.y" { yyval = &pars_asc_token; ; break;} case 93: -#line 296 "pars0grm.y" +#line 299 "pars0grm.y" { yyval = &pars_asc_token; ; break;} case 94: -#line 297 "pars0grm.y" +#line 300 "pars0grm.y" { yyval = &pars_desc_token; ; break;} case 95: -#line 301 "pars0grm.y" +#line 304 "pars0grm.y" { yyval = NULL; ; break;} case 96: -#line 303 "pars0grm.y" +#line 306 "pars0grm.y" { yyval = pars_order_by(yyvsp[-1], yyvsp[0]); ; break;} case 97: -#line 312 "pars0grm.y" +#line 315 "pars0grm.y" { yyval = pars_select_statement(yyvsp[-6], yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ; break;} case 98: -#line 318 "pars0grm.y" +#line 321 "pars0grm.y" { yyval = yyvsp[0]; ; break;} case 99: -#line 323 "pars0grm.y" +#line 326 "pars0grm.y" { yyval = pars_insert_statement(yyvsp[-4], yyvsp[-1], NULL); ; break;} case 100: -#line 325 "pars0grm.y" +#line 328 "pars0grm.y" { yyval = pars_insert_statement(yyvsp[-1], NULL, yyvsp[0]); ; break;} case 101: -#line 329 "pars0grm.y" +#line 332 "pars0grm.y" { yyval = pars_column_assignment(yyvsp[-2], yyvsp[0]); ; break;} case 102: -#line 333 "pars0grm.y" +#line 336 "pars0grm.y" { yyval = que_node_list_add_last(NULL, yyvsp[0]); ; break;} case 103: -#line 335 "pars0grm.y" +#line 338 "pars0grm.y" { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ; break;} case 104: -#line 341 "pars0grm.y" +#line 344 "pars0grm.y" { yyval = yyvsp[0]; ; break;} case 105: -#line 347 "pars0grm.y" +#line 350 "pars0grm.y" { yyval = pars_update_statement_start(FALSE, yyvsp[-2], yyvsp[0]); ; break;} case 106: -#line 353 "pars0grm.y" +#line 356 "pars0grm.y" { yyval = pars_update_statement(yyvsp[-1], NULL, yyvsp[0]); ; break;} case 107: -#line 358 "pars0grm.y" +#line 361 "pars0grm.y" { yyval = pars_update_statement(yyvsp[-1], yyvsp[0], NULL); ; break;} case 108: -#line 363 "pars0grm.y" +#line 366 "pars0grm.y" { yyval = pars_update_statement_start(TRUE, yyvsp[0], NULL); ; break;} case 109: -#line 369 "pars0grm.y" +#line 372 "pars0grm.y" { yyval = pars_update_statement(yyvsp[-1], NULL, yyvsp[0]); ; break;} case 110: -#line 374 "pars0grm.y" +#line 377 "pars0grm.y" { yyval = pars_update_statement(yyvsp[-1], yyvsp[0], NULL); ; break;} case 111: -#line 379 "pars0grm.y" +#line 382 "pars0grm.y" { yyval = pars_row_printf_statement(yyvsp[0]); ; break;} case 112: -#line 384 "pars0grm.y" +#line 387 "pars0grm.y" { yyval = pars_assignment_statement(yyvsp[-2], yyvsp[0]); ; break;} case 113: -#line 390 "pars0grm.y" +#line 393 "pars0grm.y" { yyval = pars_elsif_element(yyvsp[-2], yyvsp[0]); ; break;} case 114: -#line 394 "pars0grm.y" +#line 397 "pars0grm.y" { yyval = que_node_list_add_last(NULL, yyvsp[0]); ; break;} case 115: -#line 396 "pars0grm.y" +#line 399 "pars0grm.y" { yyval = que_node_list_add_last(yyvsp[-1], yyvsp[0]); ; break;} case 116: -#line 400 "pars0grm.y" +#line 403 "pars0grm.y" { yyval = NULL; ; break;} case 117: -#line 402 "pars0grm.y" +#line 405 "pars0grm.y" { yyval = yyvsp[0]; ; break;} case 118: -#line 403 "pars0grm.y" +#line 406 "pars0grm.y" { yyval = yyvsp[0]; ; break;} case 119: -#line 410 "pars0grm.y" +#line 413 "pars0grm.y" { yyval = pars_if_statement(yyvsp[-5], yyvsp[-3], yyvsp[-2]); ; break;} case 120: -#line 416 "pars0grm.y" +#line 419 "pars0grm.y" { yyval = pars_while_statement(yyvsp[-4], yyvsp[-2]); ; break;} case 121: -#line 424 "pars0grm.y" +#line 427 "pars0grm.y" { yyval = pars_for_statement(yyvsp[-8], yyvsp[-6], yyvsp[-4], yyvsp[-2]); ; break;} case 122: -#line 428 "pars0grm.y" +#line 431 "pars0grm.y" { yyval = pars_return_statement(); ; break;} case 123: -#line 433 "pars0grm.y" +#line 436 "pars0grm.y" { yyval = pars_open_statement( ROW_SEL_OPEN_CURSOR, yyvsp[0]); ; break;} case 124: -#line 439 "pars0grm.y" +#line 442 "pars0grm.y" { yyval = pars_open_statement( ROW_SEL_CLOSE_CURSOR, yyvsp[0]); ; break;} case 125: -#line 445 "pars0grm.y" +#line 448 "pars0grm.y" { yyval = pars_fetch_statement(yyvsp[-2], yyvsp[0]); ; break;} case 126: -#line 449 "pars0grm.y" +#line 452 "pars0grm.y" { yyval = pars_column_def(yyvsp[-1], yyvsp[0]); ; break;} case 127: -#line 453 "pars0grm.y" +#line 456 "pars0grm.y" { yyval = que_node_list_add_last(NULL, yyvsp[0]); ; break;} case 128: -#line 455 "pars0grm.y" +#line 458 "pars0grm.y" { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ; break;} case 129: -#line 459 "pars0grm.y" +#line 462 "pars0grm.y" { yyval = NULL; ; break;} case 130: -#line 461 "pars0grm.y" +#line 464 "pars0grm.y" { yyval = &pars_int_token; /* pass any non-NULL pointer */ ; break;} case 131: -#line 468 "pars0grm.y" +#line 471 "pars0grm.y" { yyval = pars_create_table(yyvsp[-4], yyvsp[-2], yyvsp[0]); ; break;} case 132: -#line 472 "pars0grm.y" +#line 475 "pars0grm.y" { yyval = que_node_list_add_last(NULL, yyvsp[0]); ; break;} case 133: -#line 474 "pars0grm.y" +#line 477 "pars0grm.y" { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ; break;} case 134: -#line 478 "pars0grm.y" +#line 481 "pars0grm.y" { yyval = NULL; ; break;} case 135: -#line 479 "pars0grm.y" +#line 482 "pars0grm.y" { yyval = &pars_unique_token; ; break;} case 136: -#line 483 "pars0grm.y" +#line 486 "pars0grm.y" { yyval = NULL; ; break;} case 137: -#line 484 "pars0grm.y" +#line 487 "pars0grm.y" { yyval = &pars_clustered_token; ; break;} case 138: -#line 492 "pars0grm.y" +#line 495 "pars0grm.y" { yyval = pars_create_index(yyvsp[-8], yyvsp[-7], yyvsp[-5], yyvsp[-3], yyvsp[-1]); ; break;} case 139: -#line 497 "pars0grm.y" +#line 500 "pars0grm.y" { yyval = pars_commit_statement(); ; break;} case 140: -#line 502 "pars0grm.y" +#line 505 "pars0grm.y" { yyval = pars_rollback_statement(); ; break;} case 141: -#line 506 "pars0grm.y" +#line 509 "pars0grm.y" { yyval = &pars_int_token; ; break;} case 142: -#line 507 "pars0grm.y" +#line 510 "pars0grm.y" { yyval = &pars_char_token; ; break;} case 143: -#line 512 "pars0grm.y" +#line 515 "pars0grm.y" { yyval = pars_parameter_declaration(yyvsp[-2], PARS_INPUT, yyvsp[0]); ; break;} case 144: -#line 515 "pars0grm.y" +#line 518 "pars0grm.y" { yyval = pars_parameter_declaration(yyvsp[-2], PARS_OUTPUT, yyvsp[0]); ; break;} case 145: -#line 520 "pars0grm.y" +#line 523 "pars0grm.y" { yyval = NULL; ; break;} case 146: -#line 521 "pars0grm.y" +#line 524 "pars0grm.y" { yyval = que_node_list_add_last(NULL, yyvsp[0]); ; break;} case 147: -#line 523 "pars0grm.y" +#line 526 "pars0grm.y" { yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ; break;} case 148: -#line 528 "pars0grm.y" +#line 531 "pars0grm.y" { yyval = pars_variable_declaration(yyvsp[-2], yyvsp[-1]); ; break;} case 152: -#line 540 "pars0grm.y" +#line 543 "pars0grm.y" { yyval = pars_cursor_declaration(yyvsp[-3], yyvsp[-1]); ; break;} case 156: -#line 556 "pars0grm.y" +#line 559 "pars0grm.y" { yyval = pars_procedure_definition(yyvsp[-9], yyvsp[-7], yyvsp[-1]); ; break;} @@ -1866,5 +1866,5 @@ yyerrhandle: #endif return 1; } -#line 560 "pars0grm.y" +#line 563 "pars0grm.y" diff --git a/innobase/pars/pars0grm.y b/innobase/pars/pars0grm.y index 2d84ee296cd..67289222594 100644 --- a/innobase/pars/pars0grm.y +++ b/innobase/pars/pars0grm.y @@ -13,8 +13,6 @@ the InnoDB parser. %{ /* The value of the semantic attribute is a pointer to a query tree node que_node_t */ -#define YYSTYPE que_node_t* -#define alloca mem_alloc #include @@ -25,6 +23,8 @@ que_node_t */ #include "que0que.h" #include "row0sel.h" +#define YYSTYPE que_node_t* + /* #define __STDC__ */ int diff --git a/innobase/pars/pars0lex.l b/innobase/pars/pars0lex.l index 7abb8b1d74e..e9b39861dd2 100644 --- a/innobase/pars/pars0lex.l +++ b/innobase/pars/pars0lex.l @@ -26,6 +26,8 @@ How to make the InnoDB parser and lexer C files: 5. Rename lex.yy.c to lexyy.c. +6. Remove the #include of unistd.h from about line 2500 of lexyy.c + These instructions seem to work at least with bison-1.28 and flex-2.5.4 on Linux. *******************************************************/ From 42d46eb9eef3170622794a36646e9d1c57ecf6d2 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Sun, 25 Aug 2002 10:26:40 +0300 Subject: [PATCH 3/6] os0file.c: Put 'last millisecond' test to make sure page checksum errors do not result from memory corruption in InnoDB os0thread.c, configure.in: Make sure stack size in InnoDB threads in AIX is at least 32 kB --- innobase/configure.in | 2 ++ innobase/os/os0file.c | 25 +++++++++++++++++++++++++ innobase/os/os0thread.c | 20 ++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/innobase/configure.in b/innobase/configure.in index e4e5d839246..51782579720 100644 --- a/innobase/configure.in +++ b/innobase/configure.in @@ -89,6 +89,8 @@ case "$target_os" in CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";; hp*) CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";; + aix*) + CFLAGS="$CFLAGS -DUNIV_AIX";; irix*) CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";; osf*) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 10bb9bb66d7..c37b0585dd3 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -11,6 +11,7 @@ Created 10/21/1995 Heikki Tuuri #include "ut0mem.h" #include "srv0srv.h" #include "fil0fil.h" +#include "buf0buf.h" #undef HAVE_FDATASYNC @@ -2108,6 +2109,7 @@ os_aio_simulated_handle( ibool ret; ulint n; ulint i; + ulint len2; segment = os_aio_get_array_and_local_segment(&array, global_segment); @@ -2263,6 +2265,29 @@ consecutive_loop: /* Do the i/o with ordinary, synchronous i/o functions: */ if (slot->type == OS_FILE_WRITE) { + if (array == os_aio_write_array) { + + /* Do a 'last millisecond' check that the page end + is sensible; reported page checksum errors from + Linux seem to wipe over the page end */ + + for (len2 = 0; len2 + UNIV_PAGE_SIZE <= total_len; + len2 += UNIV_PAGE_SIZE) { + if (mach_read_from_4(combined_buf + len2 + + FIL_PAGE_LSN + 4) + != mach_read_from_4(combined_buf + len2 + + UNIV_PAGE_SIZE + - FIL_PAGE_END_LSN + 4)) { + ut_print_timestamp(stderr); + fprintf(stderr, +" InnoDB: ERROR: The page to be written seems corrupt!\n"); + page_print(combined_buf + len2); + fprintf(stderr, +"InnoDB: ERROR: The page to be written seems corrupt!\n"); + } + } + } + ret = os_file_write(slot->name, slot->file, combined_buf, slot->offset, slot->offset_high, total_len); } else { diff --git a/innobase/os/os0thread.c b/innobase/os/os0thread.c index d137014a6af..ad6b66a1dc2 100644 --- a/innobase/os/os0thread.c +++ b/innobase/os/os0thread.c @@ -128,8 +128,28 @@ os_thread_create( pthread_attr_init(&attr); +#ifdef UNIV_AIX + /* We must make sure a thread stack is at least 32 kB, otherwise + InnoDB might crash; we do not know if the default stack size on + AIX is always big enough. An empirical test on AIX-4.3 suggested + the size was 96 kB, though. */ + + ret = pthread_attr_setstacksize(&attr, + (size_t)(PTHREAD_STACK_MIN + 32 * 1024)); + if (ret) { + fprintf(stderr, + "InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret); + exit(1); + } +#endif ret = pthread_create(&pthread, &attr, start_f, arg); + if (ret) { + fprintf(stderr, + "InnoDB: Error: pthread_create returned %d\n", ret); + exit(1); + } + pthread_attr_destroy(&attr); if (srv_set_thread_priorities) { From 54594ebca18eff6a4a699788c3f801bad1fb5063 Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Wed, 28 Aug 2002 16:41:23 +0300 Subject: [PATCH 4/6] Little but nasty bug with BDB and alter table --- Docs/manual.texi | 3 +++ mysql-test/r/bdb-alter-table-1.result | 4 ++++ mysql-test/r/bdb-alter-table-2.result | 4 ++++ mysql-test/t/bdb-alter-table-1.test | 12 ++++++++++++ mysql-test/t/bdb-alter-table-2.test | 3 +++ sql/sql_table.cc | 13 ++++++++----- 6 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 mysql-test/r/bdb-alter-table-1.result create mode 100644 mysql-test/r/bdb-alter-table-2.result create mode 100644 mysql-test/t/bdb-alter-table-1.test create mode 100644 mysql-test/t/bdb-alter-table-2.test diff --git a/Docs/manual.texi b/Docs/manual.texi index 77122dce2d8..9bbb9fa0c5a 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46929,6 +46929,9 @@ not yet 100% confident in this code. @appendixsubsec Changes in release 3.23.53 @itemize @bullet @item +Fixed a bug with BDB @code[ALTER TABLE] with dropping column, and shutdown +immediately thereafter. +@item Fixed problem with @code{UNSIGNED BIGINT} on AIX (again). @item Fixed bug in pthread_mutex_trylock() on HPUX 11.0 diff --git a/mysql-test/r/bdb-alter-table-1.result b/mysql-test/r/bdb-alter-table-1.result new file mode 100644 index 00000000000..3742f45eb7a --- /dev/null +++ b/mysql-test/r/bdb-alter-table-1.result @@ -0,0 +1,4 @@ +objid tablename oid test +1 t1 4 9 +2 metatable 1 9 +3 metaindex 1 9 diff --git a/mysql-test/r/bdb-alter-table-2.result b/mysql-test/r/bdb-alter-table-2.result new file mode 100644 index 00000000000..19c6d5e1ff9 --- /dev/null +++ b/mysql-test/r/bdb-alter-table-2.result @@ -0,0 +1,4 @@ +objid tablename oid +1 t1 4 +2 metatable 1 +3 metaindex 1 diff --git a/mysql-test/t/bdb-alter-table-1.test b/mysql-test/t/bdb-alter-table-1.test new file mode 100644 index 00000000000..25a86cd92f6 --- /dev/null +++ b/mysql-test/t/bdb-alter-table-1.test @@ -0,0 +1,12 @@ +-- source include/have_bdb.inc + +# +# Small basic test for ALTER TABLE bug .. +# +drop table if exists t1; +create table t1(objid BIGINT not null, tablename varchar(64), oid BIGINT not null, test BIGINT, PRIMARY KEY (objid), UNIQUE(tablename)) type=BDB; +insert into t1 values(1, 't1',4,9); +insert into t1 values(2, 'metatable',1,9); +insert into t1 values(3, 'metaindex',1,9 ); +select * from t1; +alter table t1 drop column test; diff --git a/mysql-test/t/bdb-alter-table-2.test b/mysql-test/t/bdb-alter-table-2.test new file mode 100644 index 00000000000..69ff04ee24a --- /dev/null +++ b/mysql-test/t/bdb-alter-table-2.test @@ -0,0 +1,3 @@ +-- source include/have_bdb.inc +select * from t1; +drop table t1; \ No newline at end of file diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 9a5056a1f35..534b267403c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1665,11 +1665,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, VOID(pthread_cond_broadcast(&COND_refresh)); goto err; } -#ifdef HAVE_BERKELEY_DB - extern bool berkeley_flush_logs(void); - if (old_db_type == DB_TYPE_BERKELEY_DB && berkeley_flush_logs()) - goto err; -#endif thd->proc_info="end"; mysql_update_log.write(thd, thd->query,thd->query_length); if (mysql_bin_log.is_open()) @@ -1679,6 +1674,14 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, } VOID(pthread_cond_broadcast(&COND_refresh)); VOID(pthread_mutex_unlock(&LOCK_open)); +#ifdef HAVE_BERKELEY_DB + extern bool berkeley_flush_logs(void); + if (old_db_type == DB_TYPE_BERKELEY_DB) + { + (void)berkeley_flush_logs(); + table=open_ltable(thd,table_list,TL_READ); + } +#endif end_temporary: sprintf(tmp_name,ER(ER_INSERT_INFO),(ulong) (copied+deleted), From 0970e25d26f472648d673f994515d7871c45e4be Mon Sep 17 00:00:00 2001 From: "paul@teton.kitebird.com" <> Date: Wed, 28 Aug 2002 10:00:48 -0500 Subject: [PATCH 5/6] manual.texi minor fix to 3.23.53 change note --- BitKeeper/etc/logging_ok | 1 + Docs/manual.texi | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 76473988dbf..aae42cf286f 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -28,3 +28,4 @@ serg@sergbook.mysql.com sinisa@rhols221.adsl.netsonic.fi zak@balfor.local bar@bar.mysql.r18.ru +paul@teton.kitebird.com diff --git a/Docs/manual.texi b/Docs/manual.texi index 9bbb9fa0c5a..3796756a9ad 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46929,12 +46929,12 @@ not yet 100% confident in this code. @appendixsubsec Changes in release 3.23.53 @itemize @bullet @item -Fixed a bug with BDB @code[ALTER TABLE] with dropping column, and shutdown -immediately thereafter. +Fixed a @code{BDB}-related @code{ALTER TABLE} bug with dropping a column +and shutting down immediately thereafter. @item Fixed problem with @code{UNSIGNED BIGINT} on AIX (again). @item -Fixed bug in pthread_mutex_trylock() on HPUX 11.0 +Fixed bug in pthread_mutex_trylock() on HPUX 11.0. @item Multithreaded stress tests for InnoDB. @end itemize From b17eea55053c5891fcbf05c0dec70f7fcb99eb06 Mon Sep 17 00:00:00 2001 From: "lenz@mysql.com" <> Date: Thu, 29 Aug 2002 14:17:52 +0200 Subject: [PATCH 6/6] - Applied many modifications to Build-tools/Do-compile made in the 4.0 tree --- Build-tools/Do-compile | 69 ++++++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 20 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index ffd8815fdb1..2f419fe644b 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -2,12 +2,12 @@ use Getopt::Long; $opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env=""; -$opt_dbd_options=$opt_perl_options=$opt_suffix=""; +$opt_dbd_options=$opt_perl_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; $opt_help=$opt_Information=$opt_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_no_mysqltest=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=0; -$opt_innodb=$opt_bdb=0; +$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=0; -GetOptions("Information","help","distribution=s","user=s","result=s","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip","version-suffix=s", "with-other-libc=s") || usage(); +GetOptions("Information","help","distribution=s","user=s","result=s","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","make-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","raid","libwrap","use-old-distribution","enable-shared","no-crash-me","no-strip","version-suffix=s", "with-other-libc=s") || usage(); usage() if ($opt_help || $opt_Information); usage() if (!$opt_distribution); @@ -75,6 +75,19 @@ $ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl"; $slave_port=$mysql_tcp_port+16; $manager_port=$mysql_tcp_port+1; +if ($opt_stage == 0) +{ + system("mkdir Logs") if (! -d "Logs"); + system("mv $log ${log}-old") if (-f $log); + unlink($log); +} + +open(LOG,">>$log") || abort("Can't open log file, error $?"); +select LOG; +$|=1; +select STDOUT; +$|=1; + if (-x "$host/bin/mysqladmin") { log_system("$host/bin/mysqladmin --no-defaults -u root -S $mysql_unix_port -s shutdown"); @@ -97,25 +110,22 @@ if ($opt_stage == 0) } rm_all("$host/test"); system("mkdir $host/test") if (! -d "$host/test"); - system("mkdir Logs") if (! -d "Logs"); - system("mv $log ${log}-old") if (-f $log); - unlink($log); } -open(LOG,">>$log") || abort("Can't open log file, error $?"); -select LOG; -$|=1; -select STDOUT; -$|=1; - safe_cd($host); if ($opt_stage == 0 && ! $opt_use_old_distribution) { safe_system("gunzip < $opt_distribution | $tar xf -"); # Fix file times; This is needed because the time for files may be - # in the future - system("touch timestamp; find . -newer timestamp -print | xargs touch; rm -f timestamp"); + # in the future. The following is done this way to ensure that + # we don't get any errors from xargs touch + system("touch timestamp"); + sleep(2); + system("touch timestamp2"); + system("find . -newer timestamp -print | xargs touch"); + unlink("timestamp"); + unlink("timestamp2"); sleep(2); # Ensure that files we don't want to rebuild are newer than other files safe_cd($ver); @@ -149,7 +159,8 @@ if ($opt_stage <= 1) } if ($opt_with_other_libc) { - $opt_with_other_libc = "--with-other-libc=$opt_with_other_libc"; + $opt_with_other_libc= "--with-other-libc=$opt_with_other_libc"; + $opt_config_options.= " $opt_with_other_libc"; } if (!$opt_enable_shared) { @@ -159,11 +170,19 @@ if ($opt_stage <= 1) { $opt_config_options.= " --with-berkeley-db" } + if ($opt_raid) + { + $opt_config_options.= " --with-raid" + } if ($opt_innodb) { $opt_config_options.= " --with-innodb" } - check_system("$opt_config_env ./configure --prefix=/usr/local/mysql \"--with-comment=Official MySQL$opt_version_suffix binary\" --with-extra-charsets=complex \"--with-server-suffix=$opt_version_suffix\" --enable-thread-safe-client --enable-local-infile $opt_config_options","Thank you for choosing MySQL"); + if ($opt_libwrap) + { + $opt_config_options.= " --with-libwrap" + } + check_system("$opt_config_env ./configure --prefix=/usr/local/mysql --with-comment=\"Official MySQL$opt_version_suffix binary\" --with-extra-charsets=complex --with-server-suffix=\"$opt_version_suffix\" --enable-thread-safe-client --enable-local-infile $opt_config_options","Thank you for choosing MySQL"); if (-d "$pwd/$host/include-mysql") { safe_system("cp -r $pwd/$host/include-mysql/* $pwd/$host/$ver/include"); @@ -172,8 +191,11 @@ if ($opt_stage <= 1) if ($opt_stage <= 2) { + my ($command); unlink($opt_distribution) if ($opt_delete && !$opt_use_old_distribution); - safe_system("$make"); + $command=$make; + $command.= " $opt_make_options" if (defined($opt_make_options) && $opt_make_options ne ""); + safe_system($command); } # @@ -368,6 +390,9 @@ To set up the environment, like 'CC=cc CXX=gcc CXXFLAGS=-O3' --dbd-options 'options' Options for Makefile.PL when configuring msql-mysql-modules. +--make-options 'options' +Options to make after configure. (Like 'CXXLD=gcc') + --version-suffix suffix Can be used to set a suffix (normally 'com' or '-max') for a distribution @@ -547,13 +572,17 @@ sub rm_all sub kill_all { my ($pattern) = @_; - my ($USER,$BSD,$LINUX,$pscmd, $user, $pid); + my ($USER,$BSD,$LINUX, $pscmd, $user, $pid); $user=$ENV{'USER'}; - $BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4"; + $BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4" || $^O eq 'darwin'; $LINUX = $^O eq 'linux'; $pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef"; - open(PS, "$pscmd|") || die "can't run $pscmd: $!"; + if (!open(PS, "$pscmd|")) + { + print "Warning: Can't run $pscmd: $!\n"; + exit; + } # Catch any errors with eval. A bad pattern, for instance. process: