sql_yacc.cpp
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:979k
- #line 4937 "sql_yacc.yy"
- { yyval.item = new Item_varbinary(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length);}
- break;
- case 1253:
- #line 4939 "sql_yacc.yy"
- {
- Item *tmp= new Item_varbinary(yyvsp[0].lex_str.str,yyvsp[0].lex_str.length);
- /*
- it is OK only emulate fix_fieds, because we need only
- value of constant
- */
- String *str= tmp ?
- tmp->quick_fix_field(), tmp->val_str((String*) 0) :
- (String*) 0;
- yyval.item= new Item_string(str ? str->ptr() : "",
- str ? str->length() : 0,
- Lex->charset);
- }
- break;
- case 1254:
- #line 4952 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item; }
- break;
- case 1255:
- #line 4953 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item; }
- break;
- case 1256:
- #line 4954 "sql_yacc.yy"
- { yyval.item = yyvsp[0].item; }
- break;
- case 1257:
- #line 4957 "sql_yacc.yy"
- { int error; yyval.item_num = new Item_int(yyvsp[0].lex_str.str, (longlong) my_strtoll10(yyvsp[0].lex_str.str, NULL, &error), yyvsp[0].lex_str.length); }
- break;
- case 1258:
- #line 4958 "sql_yacc.yy"
- { int error; yyval.item_num = new Item_int(yyvsp[0].lex_str.str, (longlong) my_strtoll10(yyvsp[0].lex_str.str, NULL, &error), yyvsp[0].lex_str.length); }
- break;
- case 1259:
- #line 4959 "sql_yacc.yy"
- { yyval.item_num = new Item_uint(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); }
- break;
- case 1260:
- #line 4960 "sql_yacc.yy"
- { yyval.item_num = new Item_real(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); }
- break;
- case 1261:
- #line 4961 "sql_yacc.yy"
- { yyval.item_num = new Item_float(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length); }
- break;
- case 1262:
- #line 4969 "sql_yacc.yy"
- { yyval.item=yyvsp[0].item; }
- break;
- case 1263:
- #line 4970 "sql_yacc.yy"
- { yyval.item=yyvsp[0].item; }
- break;
- case 1264:
- #line 4974 "sql_yacc.yy"
- {
- yyval.item = new Item_field(NullS,yyvsp[-2].lex_str.str,"*");
- Lex->current_select->with_wild++;
- }
- break;
- case 1265:
- #line 4979 "sql_yacc.yy"
- {
- yyval.item = new Item_field((YYTHD->client_capabilities &
- CLIENT_NO_SCHEMA ? NullS : yyvsp[-4].lex_str.str),
- yyvsp[-2].lex_str.str,"*");
- Lex->current_select->with_wild++;
- }
- break;
- case 1266:
- #line 4988 "sql_yacc.yy"
- { yyval.item=yyvsp[0].item; }
- break;
- case 1267:
- #line 4992 "sql_yacc.yy"
- {
- SELECT_LEX *sel=Select;
- yyval.item= (sel->parsing_place != IN_HAVING ||
- sel->get_in_sum_expr() > 0) ?
- (Item*) new Item_field(NullS,NullS,yyvsp[0].lex_str.str) :
- (Item*) new Item_ref(NullS, NullS, yyvsp[0].lex_str.str);
- }
- break;
- case 1268:
- #line 5000 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- SELECT_LEX *sel= lex->current_select;
- if (sel->no_table_names_allowed)
- {
- my_printf_error(ER_TABLENAME_NOT_ALLOWED_HERE,
- ER(ER_TABLENAME_NOT_ALLOWED_HERE),
- MYF(0), yyvsp[-2].lex_str.str, thd->where);
- }
- yyval.item= (sel->parsing_place != IN_HAVING ||
- sel->get_in_sum_expr() > 0) ?
- (Item*) new Item_field(NullS,yyvsp[-2].lex_str.str,yyvsp[0].lex_str.str) :
- (Item*) new Item_ref(NullS, yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str);
- }
- break;
- case 1269:
- #line 5016 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- SELECT_LEX *sel= lex->current_select;
- if (sel->no_table_names_allowed)
- {
- my_printf_error(ER_TABLENAME_NOT_ALLOWED_HERE,
- ER(ER_TABLENAME_NOT_ALLOWED_HERE),
- MYF(0), yyvsp[-2].lex_str.str, thd->where);
- }
- yyval.item= (sel->parsing_place != IN_HAVING ||
- sel->get_in_sum_expr() > 0) ?
- (Item*) new Item_field(NullS,yyvsp[-2].lex_str.str,yyvsp[0].lex_str.str) :
- (Item*) new Item_ref(NullS, yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str);
- }
- break;
- case 1270:
- #line 5032 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- SELECT_LEX *sel= lex->current_select;
- if (sel->no_table_names_allowed)
- {
- my_printf_error(ER_TABLENAME_NOT_ALLOWED_HERE,
- ER(ER_TABLENAME_NOT_ALLOWED_HERE),
- MYF(0), yyvsp[-2].lex_str.str, thd->where);
- }
- yyval.item= (sel->parsing_place != IN_HAVING ||
- sel->get_in_sum_expr() > 0) ?
- (Item*) new Item_field((YYTHD->client_capabilities &
- CLIENT_NO_SCHEMA ? NullS : yyvsp[-4].lex_str.str),
- yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str) :
- (Item*) new Item_ref((YYTHD->client_capabilities &
- CLIENT_NO_SCHEMA ? NullS : yyvsp[-4].lex_str.str),
- yyvsp[-2].lex_str.str, yyvsp[0].lex_str.str);
- }
- break;
- case 1271:
- #line 5054 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;}
- break;
- case 1272:
- #line 5056 "sql_yacc.yy"
- {
- TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first;
- if (my_strcasecmp(table_alias_charset, yyvsp[-4].lex_str.str, table->db))
- {
- net_printf(YYTHD, ER_WRONG_DB_NAME, yyvsp[-4].lex_str.str);
- YYABORT;
- }
- if (my_strcasecmp(table_alias_charset, yyvsp[-2].lex_str.str, table->real_name))
- {
- net_printf(YYTHD, ER_WRONG_TABLE_NAME, yyvsp[-2].lex_str.str);
- YYABORT;
- }
- yyval.lex_str=yyvsp[0].lex_str;
- }
- break;
- case 1273:
- #line 5071 "sql_yacc.yy"
- {
- TABLE_LIST *table= (TABLE_LIST*) Select->table_list.first;
- if (my_strcasecmp(table_alias_charset, yyvsp[-2].lex_str.str, table->alias))
- {
- net_printf(YYTHD, ER_WRONG_TABLE_NAME, yyvsp[-2].lex_str.str);
- YYABORT;
- }
- yyval.lex_str=yyvsp[0].lex_str;
- }
- break;
- case 1274:
- #line 5080 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;}
- break;
- case 1275:
- #line 5083 "sql_yacc.yy"
- { yyval.table=new Table_ident(yyvsp[0].lex_str); }
- break;
- case 1276:
- #line 5084 "sql_yacc.yy"
- { yyval.table=new Table_ident(YYTHD, yyvsp[-2].lex_str,yyvsp[0].lex_str,0);}
- break;
- case 1277:
- #line 5085 "sql_yacc.yy"
- { yyval.table=new Table_ident(yyvsp[0].lex_str);}
- break;
- case 1278:
- #line 5089 "sql_yacc.yy"
- { LEX_STRING db={(char*) any_db,3}; yyval.table=new Table_ident(YYTHD, db,yyvsp[0].lex_str,0); }
- break;
- case 1279:
- #line 5093 "sql_yacc.yy"
- { yyval.lex_str= yyvsp[0].lex_str; }
- break;
- case 1280:
- #line 5095 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- if (thd->charset_is_system_charset)
- {
- CHARSET_INFO *cs= system_charset_info;
- int dummy_error;
- uint wlen= cs->cset->well_formed_len(cs, yyvsp[0].lex_str.str,
- yyvsp[0].lex_str.str+yyvsp[0].lex_str.length,
- yyvsp[0].lex_str.length, &dummy_error);
- if (wlen < yyvsp[0].lex_str.length)
- {
- net_printf(YYTHD, ER_INVALID_CHARACTER_STRING, cs->csname,
- yyvsp[0].lex_str.str + wlen);
- YYABORT;
- }
- yyval.lex_str= yyvsp[0].lex_str;
- }
- else
- thd->convert_string(&yyval.lex_str, system_charset_info,
- yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset());
- }
- break;
- case 1281:
- #line 5120 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- if (thd->charset_is_system_charset)
- yyval.lex_str= yyvsp[0].lex_str;
- else
- thd->convert_string(&yyval.lex_str, system_charset_info,
- yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset());
- }
- break;
- case 1282:
- #line 5132 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- if (thd->charset_is_collation_connection)
- yyval.lex_str= yyvsp[0].lex_str;
- else
- thd->convert_string(&yyval.lex_str, thd->variables.collation_connection,
- yyvsp[0].lex_str.str, yyvsp[0].lex_str.length, thd->charset());
- }
- break;
- case 1283:
- #line 5144 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str; }
- break;
- case 1284:
- #line 5146 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- yyval.lex_str.str= thd->strmake(yyvsp[0].symbol.str, yyvsp[0].symbol.length);
- yyval.lex_str.length= yyvsp[0].symbol.length;
- }
- break;
- case 1285:
- #line 5154 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;}
- break;
- case 1286:
- #line 5155 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;}
- break;
- case 1287:
- #line 5156 "sql_yacc.yy"
- { yyval.lex_str=yyvsp[0].lex_str;}
- break;
- case 1288:
- #line 5160 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- if (!(yyval.lex_user=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
- YYABORT;
- yyval.lex_user->user = yyvsp[0].lex_str;
- yyval.lex_user->host.str= (char *) "%";
- yyval.lex_user->host.length= 1;
- }
- break;
- case 1289:
- #line 5169 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- if (!(yyval.lex_user=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
- YYABORT;
- yyval.lex_user->user = yyvsp[-2].lex_str; yyval.lex_user->host=yyvsp[0].lex_str;
- }
- break;
- case 1290:
- #line 5176 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- if (!(yyval.lex_user=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
- YYABORT;
- yyval.lex_user->user.str= thd->priv_user;
- yyval.lex_user->user.length= strlen(thd->priv_user);
- if (*thd->priv_host != 0)
- {
- yyval.lex_user->host.str= thd->priv_host;
- yyval.lex_user->host.length= strlen(thd->priv_host);
- }
- else
- {
- yyval.lex_user->host.str= (char *) "%";
- yyval.lex_user->host.length= 1;
- }
- }
- break;
- case 1291:
- #line 5197 "sql_yacc.yy"
- {}
- break;
- case 1292:
- #line 5198 "sql_yacc.yy"
- {}
- break;
- case 1293:
- #line 5199 "sql_yacc.yy"
- {}
- break;
- case 1294:
- #line 5200 "sql_yacc.yy"
- {}
- break;
- case 1295:
- #line 5201 "sql_yacc.yy"
- {}
- break;
- case 1296:
- #line 5202 "sql_yacc.yy"
- {}
- break;
- case 1297:
- #line 5203 "sql_yacc.yy"
- {}
- break;
- case 1298:
- #line 5204 "sql_yacc.yy"
- {}
- break;
- case 1299:
- #line 5205 "sql_yacc.yy"
- {}
- break;
- case 1300:
- #line 5206 "sql_yacc.yy"
- {}
- break;
- case 1301:
- #line 5207 "sql_yacc.yy"
- {}
- break;
- case 1302:
- #line 5208 "sql_yacc.yy"
- {}
- break;
- case 1303:
- #line 5209 "sql_yacc.yy"
- {}
- break;
- case 1304:
- #line 5210 "sql_yacc.yy"
- {}
- break;
- case 1305:
- #line 5211 "sql_yacc.yy"
- {}
- break;
- case 1306:
- #line 5212 "sql_yacc.yy"
- {}
- break;
- case 1307:
- #line 5213 "sql_yacc.yy"
- {}
- break;
- case 1308:
- #line 5214 "sql_yacc.yy"
- {}
- break;
- case 1309:
- #line 5215 "sql_yacc.yy"
- {}
- break;
- case 1310:
- #line 5216 "sql_yacc.yy"
- {}
- break;
- case 1311:
- #line 5217 "sql_yacc.yy"
- {}
- break;
- case 1312:
- #line 5218 "sql_yacc.yy"
- {}
- break;
- case 1313:
- #line 5219 "sql_yacc.yy"
- {}
- break;
- case 1314:
- #line 5220 "sql_yacc.yy"
- {}
- break;
- case 1315:
- #line 5221 "sql_yacc.yy"
- {}
- break;
- case 1316:
- #line 5222 "sql_yacc.yy"
- {}
- break;
- case 1317:
- #line 5223 "sql_yacc.yy"
- {}
- break;
- case 1318:
- #line 5224 "sql_yacc.yy"
- {}
- break;
- case 1319:
- #line 5225 "sql_yacc.yy"
- {}
- break;
- case 1320:
- #line 5226 "sql_yacc.yy"
- {}
- break;
- case 1321:
- #line 5227 "sql_yacc.yy"
- {}
- break;
- case 1322:
- #line 5228 "sql_yacc.yy"
- {}
- break;
- case 1323:
- #line 5229 "sql_yacc.yy"
- {}
- break;
- case 1324:
- #line 5230 "sql_yacc.yy"
- {}
- break;
- case 1325:
- #line 5231 "sql_yacc.yy"
- {}
- break;
- case 1326:
- #line 5232 "sql_yacc.yy"
- {}
- break;
- case 1327:
- #line 5233 "sql_yacc.yy"
- {}
- break;
- case 1328:
- #line 5234 "sql_yacc.yy"
- {}
- break;
- case 1329:
- #line 5235 "sql_yacc.yy"
- {}
- break;
- case 1330:
- #line 5236 "sql_yacc.yy"
- {}
- break;
- case 1331:
- #line 5237 "sql_yacc.yy"
- {}
- break;
- case 1332:
- #line 5238 "sql_yacc.yy"
- {}
- break;
- case 1333:
- #line 5239 "sql_yacc.yy"
- {}
- break;
- case 1334:
- #line 5240 "sql_yacc.yy"
- {}
- break;
- case 1335:
- #line 5241 "sql_yacc.yy"
- {}
- break;
- case 1336:
- #line 5242 "sql_yacc.yy"
- {}
- break;
- case 1337:
- #line 5243 "sql_yacc.yy"
- {}
- break;
- case 1338:
- #line 5244 "sql_yacc.yy"
- {}
- break;
- case 1339:
- #line 5245 "sql_yacc.yy"
- {}
- break;
- case 1340:
- #line 5246 "sql_yacc.yy"
- {}
- break;
- case 1341:
- #line 5247 "sql_yacc.yy"
- {}
- break;
- case 1342:
- #line 5248 "sql_yacc.yy"
- {}
- break;
- case 1343:
- #line 5249 "sql_yacc.yy"
- {}
- break;
- case 1344:
- #line 5250 "sql_yacc.yy"
- {}
- break;
- case 1345:
- #line 5251 "sql_yacc.yy"
- {}
- break;
- case 1346:
- #line 5252 "sql_yacc.yy"
- {}
- break;
- case 1347:
- #line 5253 "sql_yacc.yy"
- {}
- break;
- case 1348:
- #line 5254 "sql_yacc.yy"
- {}
- break;
- case 1349:
- #line 5255 "sql_yacc.yy"
- {}
- break;
- case 1350:
- #line 5256 "sql_yacc.yy"
- {}
- break;
- case 1351:
- #line 5257 "sql_yacc.yy"
- {}
- break;
- case 1352:
- #line 5258 "sql_yacc.yy"
- {}
- break;
- case 1353:
- #line 5259 "sql_yacc.yy"
- {}
- break;
- case 1354:
- #line 5260 "sql_yacc.yy"
- {}
- break;
- case 1355:
- #line 5261 "sql_yacc.yy"
- {}
- break;
- case 1356:
- #line 5262 "sql_yacc.yy"
- {}
- break;
- case 1357:
- #line 5263 "sql_yacc.yy"
- {}
- break;
- case 1358:
- #line 5264 "sql_yacc.yy"
- {}
- break;
- case 1359:
- #line 5265 "sql_yacc.yy"
- {}
- break;
- case 1360:
- #line 5266 "sql_yacc.yy"
- {}
- break;
- case 1361:
- #line 5267 "sql_yacc.yy"
- {}
- break;
- case 1362:
- #line 5268 "sql_yacc.yy"
- {}
- break;
- case 1363:
- #line 5269 "sql_yacc.yy"
- {}
- break;
- case 1364:
- #line 5270 "sql_yacc.yy"
- {}
- break;
- case 1365:
- #line 5271 "sql_yacc.yy"
- {}
- break;
- case 1366:
- #line 5272 "sql_yacc.yy"
- {}
- break;
- case 1367:
- #line 5273 "sql_yacc.yy"
- {}
- break;
- case 1368:
- #line 5274 "sql_yacc.yy"
- {}
- break;
- case 1369:
- #line 5275 "sql_yacc.yy"
- {}
- break;
- case 1370:
- #line 5276 "sql_yacc.yy"
- {}
- break;
- case 1371:
- #line 5277 "sql_yacc.yy"
- {}
- break;
- case 1372:
- #line 5278 "sql_yacc.yy"
- {}
- break;
- case 1373:
- #line 5279 "sql_yacc.yy"
- {}
- break;
- case 1374:
- #line 5280 "sql_yacc.yy"
- {}
- break;
- case 1375:
- #line 5281 "sql_yacc.yy"
- {}
- break;
- case 1376:
- #line 5282 "sql_yacc.yy"
- {}
- break;
- case 1377:
- #line 5283 "sql_yacc.yy"
- {}
- break;
- case 1378:
- #line 5284 "sql_yacc.yy"
- {}
- break;
- case 1379:
- #line 5285 "sql_yacc.yy"
- {}
- break;
- case 1380:
- #line 5286 "sql_yacc.yy"
- {}
- break;
- case 1381:
- #line 5287 "sql_yacc.yy"
- {}
- break;
- case 1382:
- #line 5288 "sql_yacc.yy"
- {}
- break;
- case 1383:
- #line 5289 "sql_yacc.yy"
- {}
- break;
- case 1384:
- #line 5290 "sql_yacc.yy"
- {}
- break;
- case 1385:
- #line 5291 "sql_yacc.yy"
- {}
- break;
- case 1386:
- #line 5292 "sql_yacc.yy"
- {}
- break;
- case 1387:
- #line 5293 "sql_yacc.yy"
- {}
- break;
- case 1388:
- #line 5294 "sql_yacc.yy"
- {}
- break;
- case 1389:
- #line 5295 "sql_yacc.yy"
- {}
- break;
- case 1390:
- #line 5296 "sql_yacc.yy"
- {}
- break;
- case 1391:
- #line 5297 "sql_yacc.yy"
- {}
- break;
- case 1392:
- #line 5298 "sql_yacc.yy"
- {}
- break;
- case 1393:
- #line 5299 "sql_yacc.yy"
- {}
- break;
- case 1394:
- #line 5300 "sql_yacc.yy"
- {}
- break;
- case 1395:
- #line 5301 "sql_yacc.yy"
- {}
- break;
- case 1396:
- #line 5302 "sql_yacc.yy"
- {}
- break;
- case 1397:
- #line 5303 "sql_yacc.yy"
- {}
- break;
- case 1398:
- #line 5304 "sql_yacc.yy"
- {}
- break;
- case 1399:
- #line 5305 "sql_yacc.yy"
- {}
- break;
- case 1400:
- #line 5306 "sql_yacc.yy"
- {}
- break;
- case 1401:
- #line 5307 "sql_yacc.yy"
- {}
- break;
- case 1402:
- #line 5308 "sql_yacc.yy"
- {}
- break;
- case 1403:
- #line 5309 "sql_yacc.yy"
- {}
- break;
- case 1404:
- #line 5310 "sql_yacc.yy"
- {}
- break;
- case 1405:
- #line 5311 "sql_yacc.yy"
- {}
- break;
- case 1406:
- #line 5312 "sql_yacc.yy"
- {}
- break;
- case 1407:
- #line 5313 "sql_yacc.yy"
- {}
- break;
- case 1408:
- #line 5314 "sql_yacc.yy"
- {}
- break;
- case 1409:
- #line 5315 "sql_yacc.yy"
- {}
- break;
- case 1410:
- #line 5316 "sql_yacc.yy"
- {}
- break;
- case 1411:
- #line 5317 "sql_yacc.yy"
- {}
- break;
- case 1412:
- #line 5318 "sql_yacc.yy"
- {}
- break;
- case 1413:
- #line 5319 "sql_yacc.yy"
- {}
- break;
- case 1414:
- #line 5320 "sql_yacc.yy"
- {}
- break;
- case 1415:
- #line 5321 "sql_yacc.yy"
- {}
- break;
- case 1416:
- #line 5322 "sql_yacc.yy"
- {}
- break;
- case 1417:
- #line 5323 "sql_yacc.yy"
- {}
- break;
- case 1418:
- #line 5324 "sql_yacc.yy"
- {}
- break;
- case 1419:
- #line 5325 "sql_yacc.yy"
- {}
- break;
- case 1420:
- #line 5326 "sql_yacc.yy"
- {}
- break;
- case 1421:
- #line 5327 "sql_yacc.yy"
- {}
- break;
- case 1422:
- #line 5328 "sql_yacc.yy"
- {}
- break;
- case 1423:
- #line 5329 "sql_yacc.yy"
- {}
- break;
- case 1424:
- #line 5330 "sql_yacc.yy"
- {}
- break;
- case 1425:
- #line 5331 "sql_yacc.yy"
- {}
- break;
- case 1426:
- #line 5332 "sql_yacc.yy"
- {}
- break;
- case 1427:
- #line 5333 "sql_yacc.yy"
- {}
- break;
- case 1428:
- #line 5334 "sql_yacc.yy"
- {}
- break;
- case 1429:
- #line 5335 "sql_yacc.yy"
- {}
- break;
- case 1430:
- #line 5336 "sql_yacc.yy"
- {}
- break;
- case 1431:
- #line 5337 "sql_yacc.yy"
- {}
- break;
- case 1432:
- #line 5338 "sql_yacc.yy"
- {}
- break;
- case 1433:
- #line 5339 "sql_yacc.yy"
- {}
- break;
- case 1434:
- #line 5340 "sql_yacc.yy"
- {}
- break;
- case 1435:
- #line 5341 "sql_yacc.yy"
- {}
- break;
- case 1436:
- #line 5342 "sql_yacc.yy"
- {}
- break;
- case 1437:
- #line 5343 "sql_yacc.yy"
- {}
- break;
- case 1438:
- #line 5344 "sql_yacc.yy"
- {}
- break;
- case 1439:
- #line 5345 "sql_yacc.yy"
- {}
- break;
- case 1440:
- #line 5346 "sql_yacc.yy"
- {}
- break;
- case 1441:
- #line 5347 "sql_yacc.yy"
- {}
- break;
- case 1442:
- #line 5348 "sql_yacc.yy"
- {}
- break;
- case 1443:
- #line 5349 "sql_yacc.yy"
- {}
- break;
- case 1444:
- #line 5350 "sql_yacc.yy"
- {}
- break;
- case 1445:
- #line 5351 "sql_yacc.yy"
- {}
- break;
- case 1446:
- #line 5352 "sql_yacc.yy"
- {}
- break;
- case 1447:
- #line 5353 "sql_yacc.yy"
- {}
- break;
- case 1448:
- #line 5354 "sql_yacc.yy"
- {}
- break;
- case 1449:
- #line 5355 "sql_yacc.yy"
- {}
- break;
- case 1450:
- #line 5356 "sql_yacc.yy"
- {}
- break;
- case 1451:
- #line 5357 "sql_yacc.yy"
- {}
- break;
- case 1452:
- #line 5358 "sql_yacc.yy"
- {}
- break;
- case 1453:
- #line 5359 "sql_yacc.yy"
- {}
- break;
- case 1454:
- #line 5360 "sql_yacc.yy"
- {}
- break;
- case 1455:
- #line 5361 "sql_yacc.yy"
- {}
- break;
- case 1456:
- #line 5362 "sql_yacc.yy"
- {}
- break;
- case 1457:
- #line 5363 "sql_yacc.yy"
- {}
- break;
- case 1458:
- #line 5364 "sql_yacc.yy"
- {}
- break;
- case 1459:
- #line 5365 "sql_yacc.yy"
- {}
- break;
- case 1460:
- #line 5366 "sql_yacc.yy"
- {}
- break;
- case 1461:
- #line 5367 "sql_yacc.yy"
- {}
- break;
- case 1462:
- #line 5368 "sql_yacc.yy"
- {}
- break;
- case 1463:
- #line 5369 "sql_yacc.yy"
- {}
- break;
- case 1464:
- #line 5370 "sql_yacc.yy"
- {}
- break;
- case 1465:
- #line 5371 "sql_yacc.yy"
- {}
- break;
- case 1466:
- #line 5372 "sql_yacc.yy"
- {}
- break;
- case 1467:
- #line 5373 "sql_yacc.yy"
- {}
- break;
- case 1468:
- #line 5374 "sql_yacc.yy"
- {}
- break;
- case 1469:
- #line 5375 "sql_yacc.yy"
- {}
- break;
- case 1470:
- #line 5376 "sql_yacc.yy"
- {}
- break;
- case 1471:
- #line 5377 "sql_yacc.yy"
- {}
- break;
- case 1472:
- #line 5378 "sql_yacc.yy"
- {}
- break;
- case 1473:
- #line 5379 "sql_yacc.yy"
- {}
- break;
- case 1474:
- #line 5380 "sql_yacc.yy"
- {}
- break;
- case 1475:
- #line 5381 "sql_yacc.yy"
- {}
- break;
- case 1476:
- #line 5382 "sql_yacc.yy"
- {}
- break;
- case 1477:
- #line 5383 "sql_yacc.yy"
- {}
- break;
- case 1478:
- #line 5384 "sql_yacc.yy"
- {}
- break;
- case 1479:
- #line 5385 "sql_yacc.yy"
- {}
- break;
- case 1480:
- #line 5386 "sql_yacc.yy"
- {}
- break;
- case 1481:
- #line 5387 "sql_yacc.yy"
- {}
- break;
- case 1482:
- #line 5388 "sql_yacc.yy"
- {}
- break;
- case 1483:
- #line 5389 "sql_yacc.yy"
- {}
- break;
- case 1484:
- #line 5390 "sql_yacc.yy"
- {}
- break;
- case 1485:
- #line 5391 "sql_yacc.yy"
- {}
- break;
- case 1486:
- #line 5392 "sql_yacc.yy"
- {}
- break;
- case 1487:
- #line 5393 "sql_yacc.yy"
- {}
- break;
- case 1488:
- #line 5394 "sql_yacc.yy"
- {}
- break;
- case 1489:
- #line 5395 "sql_yacc.yy"
- {}
- break;
- case 1490:
- #line 5396 "sql_yacc.yy"
- {}
- break;
- case 1491:
- #line 5397 "sql_yacc.yy"
- {}
- break;
- case 1492:
- #line 5398 "sql_yacc.yy"
- {}
- break;
- case 1493:
- #line 5399 "sql_yacc.yy"
- {}
- break;
- case 1494:
- #line 5400 "sql_yacc.yy"
- {}
- break;
- case 1495:
- #line 5401 "sql_yacc.yy"
- {}
- break;
- case 1496:
- #line 5402 "sql_yacc.yy"
- {}
- break;
- case 1497:
- #line 5403 "sql_yacc.yy"
- {}
- break;
- case 1498:
- #line 5404 "sql_yacc.yy"
- {}
- break;
- case 1499:
- #line 5405 "sql_yacc.yy"
- {}
- break;
- case 1500:
- #line 5412 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command= SQLCOM_SET_OPTION;
- mysql_init_select(lex);
- lex->option_type=OPT_SESSION;
- lex->var_list.empty();
- lex->one_shot_set= 0;
- }
- break;
- case 1501:
- #line 5421 "sql_yacc.yy"
- {}
- break;
- case 1502:
- #line 5425 "sql_yacc.yy"
- {}
- break;
- case 1503:
- #line 5426 "sql_yacc.yy"
- {}
- break;
- case 1506:
- #line 5433 "sql_yacc.yy"
- {}
- break;
- case 1507:
- #line 5434 "sql_yacc.yy"
- {}
- break;
- case 1508:
- #line 5438 "sql_yacc.yy"
- {}
- break;
- case 1509:
- #line 5439 "sql_yacc.yy"
- { Lex->option_type= OPT_GLOBAL; }
- break;
- case 1510:
- #line 5440 "sql_yacc.yy"
- { Lex->option_type= OPT_SESSION; }
- break;
- case 1511:
- #line 5441 "sql_yacc.yy"
- { Lex->option_type= OPT_SESSION; }
- break;
- case 1512:
- #line 5445 "sql_yacc.yy"
- {}
- break;
- case 1513:
- #line 5446 "sql_yacc.yy"
- { Lex->option_type= OPT_SESSION; Lex->one_shot_set= 1; }
- break;
- case 1514:
- #line 5450 "sql_yacc.yy"
- { yyval.num=OPT_SESSION; }
- break;
- case 1515:
- #line 5451 "sql_yacc.yy"
- { yyval.num=OPT_GLOBAL; }
- break;
- case 1516:
- #line 5452 "sql_yacc.yy"
- { yyval.num=OPT_SESSION; }
- break;
- case 1517:
- #line 5453 "sql_yacc.yy"
- { yyval.num=OPT_SESSION; }
- break;
- case 1518:
- #line 5457 "sql_yacc.yy"
- { yyval.num=OPT_DEFAULT; }
- break;
- case 1519:
- #line 5458 "sql_yacc.yy"
- { yyval.num=OPT_GLOBAL; }
- break;
- case 1520:
- #line 5459 "sql_yacc.yy"
- { yyval.num=OPT_SESSION; }
- break;
- case 1521:
- #line 5460 "sql_yacc.yy"
- { yyval.num=OPT_SESSION; }
- break;
- case 1522:
- #line 5465 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->var_list.push_back(new set_var(lex->option_type, yyvsp[-2].variable.var,
- &yyvsp[-2].variable.base_name, yyvsp[0].item));
- }
- break;
- case 1523:
- #line 5471 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- LEX_STRING tmp;
- tmp.str=0;
- tmp.length=0;
- lex->var_list.push_back(new set_var(lex->option_type,
- find_sys_var("tx_isolation"),
- &tmp,
- new Item_int((int32) yyvsp[0].tx_isolation)));
- }
- break;
- case 1524:
- #line 5485 "sql_yacc.yy"
- {
- Lex->var_list.push_back(new set_var_user(new Item_func_set_user_var(yyvsp[-2].lex_str,yyvsp[0].item)));
- }
- break;
- case 1525:
- #line 5489 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->var_list.push_back(new set_var((enum_var_type) yyvsp[-3].num, yyvsp[-2].variable.var,
- &yyvsp[-2].variable.base_name, yyvsp[0].item));
- }
- break;
- case 1526:
- #line 5495 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- LEX *lex= Lex;
- yyvsp[0].charset= yyvsp[0].charset ? yyvsp[0].charset: global_system_variables.character_set_client;
- lex->var_list.push_back(new set_var_collation_client(yyvsp[0].charset,thd->variables.collation_database,yyvsp[0].charset));
- }
- break;
- case 1527:
- #line 5502 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- LEX *lex= Lex;
- yyvsp[-1].charset= yyvsp[-1].charset ? yyvsp[-1].charset : global_system_variables.character_set_client;
- yyvsp[0].charset= yyvsp[0].charset ? yyvsp[0].charset : yyvsp[-1].charset;
- if (!my_charset_same(yyvsp[-1].charset,yyvsp[0].charset))
- {
- net_printf(thd,ER_COLLATION_CHARSET_MISMATCH,yyvsp[0].charset->name,yyvsp[-1].charset->csname);
- YYABORT;
- }
- lex->var_list.push_back(new set_var_collation_client(yyvsp[0].charset,yyvsp[0].charset,yyvsp[0].charset));
- }
- break;
- case 1528:
- #line 5515 "sql_yacc.yy"
- {
- THD *thd=YYTHD;
- LEX_USER *user;
- if (!(user=(LEX_USER*) thd->alloc(sizeof(LEX_USER))))
- YYABORT;
- user->host.str=0;
- user->user.str=thd->priv_user;
- thd->lex->var_list.push_back(new set_var_password(user, yyvsp[0].simple_string));
- }
- break;
- case 1529:
- #line 5525 "sql_yacc.yy"
- {
- Lex->var_list.push_back(new set_var_password(yyvsp[-2].lex_user,yyvsp[0].simple_string));
- }
- break;
- case 1530:
- #line 5532 "sql_yacc.yy"
- {
- sys_var *tmp=find_sys_var(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length);
- if (!tmp)
- YYABORT;
- yyval.variable.var= tmp;
- yyval.variable.base_name.str=0;
- yyval.variable.base_name.length=0;
- /*
- If this is time_zone variable we should open time zone
- describing tables
- */
- if (tmp == &sys_time_zone)
- Lex->time_zone_tables_used= &fake_time_zone_tables_list;
- }
- break;
- case 1531:
- #line 5547 "sql_yacc.yy"
- {
- if (check_reserved_words(&yyvsp[-2].lex_str))
- {
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- }
- sys_var *tmp=find_sys_var(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length);
- if (!tmp)
- YYABORT;
- if (!tmp->is_struct())
- net_printf(YYTHD, ER_VARIABLE_IS_NOT_STRUCT, yyvsp[0].lex_str.str);
- yyval.variable.var= tmp;
- yyval.variable.base_name= yyvsp[-2].lex_str;
- }
- break;
- case 1532:
- #line 5562 "sql_yacc.yy"
- {
- sys_var *tmp=find_sys_var(yyvsp[0].lex_str.str, yyvsp[0].lex_str.length);
- if (!tmp)
- YYABORT;
- if (!tmp->is_struct())
- net_printf(YYTHD, ER_VARIABLE_IS_NOT_STRUCT, yyvsp[0].lex_str.str);
- yyval.variable.var= tmp;
- yyval.variable.base_name.str= (char*) "default";
- yyval.variable.base_name.length= 7;
- }
- break;
- case 1533:
- #line 5575 "sql_yacc.yy"
- { yyval.tx_isolation= ISO_READ_UNCOMMITTED; }
- break;
- case 1534:
- #line 5576 "sql_yacc.yy"
- { yyval.tx_isolation= ISO_READ_COMMITTED; }
- break;
- case 1535:
- #line 5577 "sql_yacc.yy"
- { yyval.tx_isolation= ISO_REPEATABLE_READ; }
- break;
- case 1536:
- #line 5578 "sql_yacc.yy"
- { yyval.tx_isolation= ISO_SERIALIZABLE; }
- break;
- case 1537:
- #line 5582 "sql_yacc.yy"
- { yyval.simple_string=yyvsp[0].lex_str.str;}
- break;
- case 1538:
- #line 5584 "sql_yacc.yy"
- {
- yyval.simple_string= yyvsp[-1].lex_str.length ? YYTHD->variables.old_passwords ?
- Item_func_old_password::alloc(YYTHD, yyvsp[-1].lex_str.str) :
- Item_func_password::alloc(YYTHD, yyvsp[-1].lex_str.str) :
- yyvsp[-1].lex_str.str;
- }
- break;
- case 1539:
- #line 5591 "sql_yacc.yy"
- {
- yyval.simple_string= yyvsp[-1].lex_str.length ? Item_func_old_password::alloc(YYTHD, yyvsp[-1].lex_str.str) :
- yyvsp[-1].lex_str.str;
- }
- break;
- case 1540:
- #line 5599 "sql_yacc.yy"
- { yyval.item=yyvsp[0].item; }
- break;
- case 1541:
- #line 5600 "sql_yacc.yy"
- { yyval.item=0; }
- break;
- case 1542:
- #line 5601 "sql_yacc.yy"
- { yyval.item=new Item_string("ON", 2, system_charset_info); }
- break;
- case 1543:
- #line 5602 "sql_yacc.yy"
- { yyval.item=new Item_string("ALL", 3, system_charset_info); }
- break;
- case 1544:
- #line 5603 "sql_yacc.yy"
- { yyval.item=new Item_string("binary", 6, system_charset_info); }
- break;
- case 1545:
- #line 5611 "sql_yacc.yy"
- {
- Lex->sql_command=SQLCOM_LOCK_TABLES;
- }
- break;
- case 1546:
- #line 5615 "sql_yacc.yy"
- {}
- break;
- case 1551:
- #line 5628 "sql_yacc.yy"
- {
- if (!Select->add_table_to_list(YYTHD, yyvsp[-2].table, yyvsp[-1].lex_str_ptr, 0, (thr_lock_type) yyvsp[0].num))
- YYABORT;
- }
- break;
- case 1552:
- #line 5635 "sql_yacc.yy"
- { yyval.num=TL_READ_NO_INSERT; }
- break;
- case 1553:
- #line 5636 "sql_yacc.yy"
- { yyval.num=YYTHD->update_lock_default; }
- break;
- case 1554:
- #line 5637 "sql_yacc.yy"
- { yyval.num=TL_WRITE_LOW_PRIORITY; }
- break;
- case 1555:
- #line 5638 "sql_yacc.yy"
- { yyval.num= TL_READ; }
- break;
- case 1556:
- #line 5642 "sql_yacc.yy"
- { Lex->sql_command=SQLCOM_UNLOCK_TABLES; }
- break;
- case 1557:
- #line 5652 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->sql_command = SQLCOM_HA_OPEN;
- if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-2].table, yyvsp[0].lex_str_ptr, 0))
- YYABORT;
- }
- break;
- case 1558:
- #line 5659 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->sql_command = SQLCOM_HA_CLOSE;
- if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-1].table, 0, 0))
- YYABORT;
- }
- break;
- case 1559:
- #line 5666 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_HA_READ;
- lex->ha_rkey_mode= HA_READ_KEY_EXACT; /* Avoid purify warnings */
- lex->current_select->select_limit= 1;
- lex->current_select->offset_limit= 0L;
- if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[-1].table, 0, 0))
- YYABORT;
- }
- break;
- case 1560:
- #line 5675 "sql_yacc.yy"
- {}
- break;
- case 1561:
- #line 5679 "sql_yacc.yy"
- { Lex->backup_dir= 0; }
- break;
- case 1562:
- #line 5680 "sql_yacc.yy"
- { Lex->backup_dir= yyvsp[-1].lex_str.str; }
- break;
- case 1563:
- #line 5684 "sql_yacc.yy"
- { Lex->ha_read_mode = RFIRST; }
- break;
- case 1564:
- #line 5685 "sql_yacc.yy"
- { Lex->ha_read_mode = RNEXT; }
- break;
- case 1565:
- #line 5689 "sql_yacc.yy"
- { Lex->ha_read_mode = RFIRST; }
- break;
- case 1566:
- #line 5690 "sql_yacc.yy"
- { Lex->ha_read_mode = RNEXT; }
- break;
- case 1567:
- #line 5691 "sql_yacc.yy"
- { Lex->ha_read_mode = RPREV; }
- break;
- case 1568:
- #line 5692 "sql_yacc.yy"
- { Lex->ha_read_mode = RLAST; }
- break;
- case 1569:
- #line 5694 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->ha_read_mode = RKEY;
- lex->ha_rkey_mode=yyvsp[0].ha_rkey_mode;
- if (!(lex->insert_list = new List_item))
- YYABORT;
- }
- break;
- case 1570:
- #line 5700 "sql_yacc.yy"
- { }
- break;
- case 1571:
- #line 5704 "sql_yacc.yy"
- { yyval.ha_rkey_mode=HA_READ_KEY_EXACT; }
- break;
- case 1572:
- #line 5705 "sql_yacc.yy"
- { yyval.ha_rkey_mode=HA_READ_KEY_OR_NEXT; }
- break;
- case 1573:
- #line 5706 "sql_yacc.yy"
- { yyval.ha_rkey_mode=HA_READ_KEY_OR_PREV; }
- break;
- case 1574:
- #line 5707 "sql_yacc.yy"
- { yyval.ha_rkey_mode=HA_READ_AFTER_KEY; }
- break;
- case 1575:
- #line 5708 "sql_yacc.yy"
- { yyval.ha_rkey_mode=HA_READ_BEFORE_KEY; }
- break;
- case 1576:
- #line 5715 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->sql_command = SQLCOM_REVOKE;
- lex->users_list.empty();
- lex->columns.empty();
- lex->grant= lex->grant_tot_col=0;
- lex->select_lex.db=0;
- lex->ssl_type= SSL_TYPE_NOT_SPECIFIED;
- lex->ssl_cipher= lex->x509_subject= lex->x509_issuer= 0;
- bzero((char*) &lex->mqh, sizeof(lex->mqh));
- }
- break;
- case 1577:
- #line 5727 "sql_yacc.yy"
- {}
- break;
- case 1578:
- #line 5732 "sql_yacc.yy"
- {}
- break;
- case 1579:
- #line 5735 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_REVOKE_ALL;
- }
- break;
- case 1580:
- #line 5742 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->users_list.empty();
- lex->columns.empty();
- lex->sql_command = SQLCOM_GRANT;
- lex->grant= lex->grant_tot_col= 0;
- lex->select_lex.db= 0;
- lex->ssl_type= SSL_TYPE_NOT_SPECIFIED;
- lex->ssl_cipher= lex->x509_subject= lex->x509_issuer= 0;
- bzero((char *)&(lex->mqh),sizeof(lex->mqh));
- }
- break;
- case 1581:
- #line 5755 "sql_yacc.yy"
- {}
- break;
- case 1582:
- #line 5759 "sql_yacc.yy"
- {}
- break;
- case 1583:
- #line 5760 "sql_yacc.yy"
- { Lex->grant = GLOBAL_ACLS;}
- break;
- case 1588:
- #line 5773 "sql_yacc.yy"
- { Lex->which_columns = SELECT_ACL;}
- break;
- case 1589:
- #line 5773 "sql_yacc.yy"
- {}
- break;
- case 1590:
- #line 5774 "sql_yacc.yy"
- { Lex->which_columns = INSERT_ACL;}
- break;
- case 1591:
- #line 5774 "sql_yacc.yy"
- {}
- break;
- case 1592:
- #line 5775 "sql_yacc.yy"
- { Lex->which_columns = UPDATE_ACL; }
- break;
- case 1593:
- #line 5775 "sql_yacc.yy"
- {}
- break;
- case 1594:
- #line 5776 "sql_yacc.yy"
- { Lex->which_columns = REFERENCES_ACL;}
- break;
- case 1595:
- #line 5776 "sql_yacc.yy"
- {}
- break;
- case 1596:
- #line 5777 "sql_yacc.yy"
- { Lex->grant |= DELETE_ACL;}
- break;
- case 1597:
- #line 5778 "sql_yacc.yy"
- {}
- break;
- case 1598:
- #line 5779 "sql_yacc.yy"
- { Lex->grant |= INDEX_ACL;}
- break;
- case 1599:
- #line 5780 "sql_yacc.yy"
- { Lex->grant |= ALTER_ACL;}
- break;
- case 1600:
- #line 5781 "sql_yacc.yy"
- { Lex->grant |= CREATE_ACL;}
- break;
- case 1601:
- #line 5782 "sql_yacc.yy"
- { Lex->grant |= DROP_ACL;}
- break;
- case 1602:
- #line 5783 "sql_yacc.yy"
- { Lex->grant |= EXECUTE_ACL;}
- break;
- case 1603:
- #line 5784 "sql_yacc.yy"
- { Lex->grant |= RELOAD_ACL;}
- break;
- case 1604:
- #line 5785 "sql_yacc.yy"
- { Lex->grant |= SHUTDOWN_ACL;}
- break;
- case 1605:
- #line 5786 "sql_yacc.yy"
- { Lex->grant |= PROCESS_ACL;}
- break;
- case 1606:
- #line 5787 "sql_yacc.yy"
- { Lex->grant |= FILE_ACL;}
- break;
- case 1607:
- #line 5788 "sql_yacc.yy"
- { Lex->grant |= GRANT_ACL;}
- break;
- case 1608:
- #line 5789 "sql_yacc.yy"
- { Lex->grant |= SHOW_DB_ACL;}
- break;
- case 1609:
- #line 5790 "sql_yacc.yy"
- { Lex->grant |= SUPER_ACL;}
- break;
- case 1610:
- #line 5791 "sql_yacc.yy"
- { Lex->grant |= CREATE_TMP_ACL;}
- break;
- case 1611:
- #line 5792 "sql_yacc.yy"
- { Lex->grant |= LOCK_TABLES_ACL; }
- break;
- case 1612:
- #line 5793 "sql_yacc.yy"
- { Lex->grant |= REPL_SLAVE_ACL;}
- break;
- case 1613:
- #line 5794 "sql_yacc.yy"
- { Lex->grant |= REPL_CLIENT_ACL;}
- break;
- case 1614:
- #line 5799 "sql_yacc.yy"
- {}
- break;
- case 1615:
- #line 5800 "sql_yacc.yy"
- {}
- break;
- case 1618:
- #line 5810 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (lex->x509_subject)
- {
- net_printf(lex->thd,ER_DUP_ARGUMENT, "SUBJECT");
- YYABORT;
- }
- lex->x509_subject=yyvsp[0].lex_str.str;
- }
- break;
- case 1619:
- #line 5820 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (lex->x509_issuer)
- {
- net_printf(lex->thd,ER_DUP_ARGUMENT, "ISSUER");
- YYABORT;
- }
- lex->x509_issuer=yyvsp[0].lex_str.str;
- }
- break;
- case 1620:
- #line 5830 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (lex->ssl_cipher)
- {
- net_printf(lex->thd,ER_DUP_ARGUMENT, "CIPHER");
- YYABORT;
- }
- lex->ssl_cipher=yyvsp[0].lex_str.str;
- }
- break;
- case 1621:
- #line 5843 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->current_select->db= lex->thd->db;
- if (lex->grant == GLOBAL_ACLS)
- lex->grant = DB_ACLS & ~GRANT_ACL;
- else if (lex->columns.elements)
- {
- send_error(lex->thd,ER_ILLEGAL_GRANT_FOR_TABLE);
- YYABORT;
- }
- }
- break;
- case 1622:
- #line 5855 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->current_select->db = yyvsp[-2].lex_str.str;
- if (lex->grant == GLOBAL_ACLS)
- lex->grant = DB_ACLS & ~GRANT_ACL;
- else if (lex->columns.elements)
- {
- send_error(lex->thd,ER_ILLEGAL_GRANT_FOR_TABLE);
- YYABORT;
- }
- }
- break;
- case 1623:
- #line 5867 "sql_yacc.yy"
- {
- LEX *lex= Lex;
- lex->current_select->db = NULL;
- if (lex->grant == GLOBAL_ACLS)
- lex->grant= GLOBAL_ACLS & ~GRANT_ACL;
- else if (lex->columns.elements)
- {
- send_error(lex->thd,ER_ILLEGAL_GRANT_FOR_TABLE);
- YYABORT;
- }
- }
- break;
- case 1624:
- #line 5879 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (!lex->current_select->add_table_to_list(lex->thd, yyvsp[0].table,NULL,0))
- YYABORT;
- if (lex->grant == GLOBAL_ACLS)
- lex->grant = TABLE_ACLS & ~GRANT_ACL;
- }
- break;
- case 1625:
- #line 5890 "sql_yacc.yy"
- { if (Lex->users_list.push_back(yyvsp[0].lex_user)) YYABORT;}
- break;
- case 1626:
- #line 5892 "sql_yacc.yy"
- {
- if (Lex->users_list.push_back(yyvsp[0].lex_user))
- YYABORT;
- }
- break;
- case 1627:
- #line 5901 "sql_yacc.yy"
- {
- yyval.lex_user=yyvsp[-3].lex_user; yyvsp[-3].lex_user->password=yyvsp[0].lex_str;
- if (yyvsp[0].lex_str.length)
- {
- if (YYTHD->variables.old_passwords)
- {
- char *buff=
- (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1);
- if (buff)
- make_scrambled_password_323(buff, yyvsp[0].lex_str.str);
- yyvsp[-3].lex_user->password.str= buff;
- yyvsp[-3].lex_user->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH_323;
- }
- else
- {
- char *buff=
- (char *) YYTHD->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH+1);
- if (buff)
- make_scrambled_password(buff, yyvsp[0].lex_str.str);
- yyvsp[-3].lex_user->password.str= buff;
- yyvsp[-3].lex_user->password.length= SCRAMBLED_PASSWORD_CHAR_LENGTH;
- }
- }
- }
- break;
- case 1628:
- #line 5926 "sql_yacc.yy"
- { yyval.lex_user=yyvsp[-4].lex_user; yyvsp[-4].lex_user->password=yyvsp[0].lex_str ; }
- break;
- case 1629:
- #line 5928 "sql_yacc.yy"
- { yyval.lex_user=yyvsp[0].lex_user; yyvsp[0].lex_user->password.str=NullS; }
- break;
- case 1630:
- #line 5934 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->grant |= lex->which_columns;
- }
- break;
- case 1634:
- #line 5946 "sql_yacc.yy"
- {
- String *new_str = new (YYTHD->mem_root) String((const char*) yyvsp[0].lex_str.str,yyvsp[0].lex_str.length,system_charset_info);
- List_iterator <LEX_COLUMN> iter(Lex->columns);
- class LEX_COLUMN *point;
- LEX *lex=Lex;
- while ((point=iter++))
- {
- if (!my_strcasecmp(system_charset_info,
- point->column.ptr(), new_str->ptr()))
- break;
- }
- lex->grant_tot_col|= lex->which_columns;
- if (point)
- point->rights |= lex->which_columns;
- else
- lex->columns.push_back(new LEX_COLUMN (*new_str,lex->which_columns));
- }
- break;
- case 1636:
- #line 5968 "sql_yacc.yy"
- {
- Lex->ssl_type=SSL_TYPE_SPECIFIED;
- }
- break;
- case 1637:
- #line 5972 "sql_yacc.yy"
- {
- Lex->ssl_type=SSL_TYPE_ANY;
- }
- break;
- case 1638:
- #line 5976 "sql_yacc.yy"
- {
- Lex->ssl_type=SSL_TYPE_X509;
- }
- break;
- case 1639:
- #line 5980 "sql_yacc.yy"
- {
- Lex->ssl_type=SSL_TYPE_NONE;
- }
- break;
- case 1640:
- #line 5986 "sql_yacc.yy"
- {}
- break;
- case 1642:
- #line 5990 "sql_yacc.yy"
- {}
- break;
- case 1643:
- #line 5991 "sql_yacc.yy"
- {}
- break;
- case 1644:
- #line 5995 "sql_yacc.yy"
- { Lex->grant |= GRANT_ACL;}
- break;
- case 1645:
- #line 5997 "sql_yacc.yy"
- {
- Lex->mqh.questions=yyvsp[0].ulong_num;
- Lex->mqh.bits |= 1;
- }
- break;
- case 1646:
- #line 6002 "sql_yacc.yy"
- {
- Lex->mqh.updates=yyvsp[0].ulong_num;
- Lex->mqh.bits |= 2;
- }
- break;
- case 1647:
- #line 6007 "sql_yacc.yy"
- {
- Lex->mqh.connections=yyvsp[0].ulong_num;
- Lex->mqh.bits |= 4;
- }
- break;
- case 1648:
- #line 6014 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_BEGIN; Lex->start_transaction_opt= 0;}
- break;
- case 1649:
- #line 6014 "sql_yacc.yy"
- {}
- break;
- case 1650:
- #line 6018 "sql_yacc.yy"
- {}
- break;
- case 1651:
- #line 6019 "sql_yacc.yy"
- {;}
- break;
- case 1652:
- #line 6023 "sql_yacc.yy"
- { Lex->sql_command = SQLCOM_COMMIT;}
- break;
- case 1653:
- #line 6027 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_ROLLBACK;
- }
- break;
- case 1654:
- #line 6031 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_ROLLBACK_TO_SAVEPOINT;
- Lex->savepoint_name = yyvsp[0].lex_str.str;
- }
- break;
- case 1655:
- #line 6037 "sql_yacc.yy"
- {
- Lex->sql_command = SQLCOM_SAVEPOINT;
- Lex->savepoint_name = yyvsp[0].lex_str.str;
- }
- break;
- case 1656:
- #line 6048 "sql_yacc.yy"
- {}
- break;
- case 1658:
- #line 6054 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (lex->exchange)
- {
- /* Only the last SELECT can have INTO...... */
- net_printf(lex->thd, ER_WRONG_USAGE, "UNION", "INTO");
- YYABORT;
- }
- if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
- {
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- }
- if (mysql_new_select(lex, 0))
- YYABORT;
- mysql_init_select(lex);
- lex->current_select->linkage=UNION_TYPE;
- if (yyvsp[0].num) /* UNION DISTINCT - remember position */
- lex->current_select->master_unit()->union_distinct=
- lex->current_select;
- }
- break;
- case 1659:
- #line 6075 "sql_yacc.yy"
- {}
- break;
- case 1660:
- #line 6079 "sql_yacc.yy"
- {}
- break;
- case 1661:
- #line 6080 "sql_yacc.yy"
- {}
- break;
- case 1662:
- #line 6084 "sql_yacc.yy"
- {}
- break;
- case 1663:
- #line 6086 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- LEX *lex= thd->lex;
- DBUG_ASSERT(lex->current_select->linkage != GLOBAL_OPTIONS_TYPE);
- SELECT_LEX *sel= lex->current_select;
- SELECT_LEX_UNIT *unit= sel->master_unit();
- SELECT_LEX *fake= unit->fake_select_lex;
- if (fake)
- {
- unit->global_parameters= fake;
- fake->no_table_names_allowed= 1;
- lex->current_select= fake;
- }
- thd->where= "global ORDER clause";
- }
- break;
- case 1664:
- #line 6102 "sql_yacc.yy"
- {
- THD *thd= YYTHD;
- thd->lex->current_select->no_table_names_allowed= 0;
- thd->where= "";
- }
- break;
- case 1667:
- #line 6115 "sql_yacc.yy"
- { yyval.num=1; }
- break;
- case 1668:
- #line 6116 "sql_yacc.yy"
- { yyval.num=1; }
- break;
- case 1669:
- #line 6117 "sql_yacc.yy"
- { yyval.num=0; }
- break;
- case 1670:
- #line 6123 "sql_yacc.yy"
- {
- yyval.item= yyvsp[-1].item;
- }
- break;
- case 1671:
- #line 6129 "sql_yacc.yy"
- {
- yyval.item= new Item_singlerow_subselect(Lex->current_select->
- master_unit()->first_select());
- }
- break;
- case 1672:
- #line 6137 "sql_yacc.yy"
- {
- yyval.item= yyvsp[-1].item;
- }
- break;
- case 1673:
- #line 6143 "sql_yacc.yy"
- {
- yyval.item= new Item_exists_subselect(Lex->current_select->master_unit()->
- first_select());
- }
- break;
- case 1674:
- #line 6151 "sql_yacc.yy"
- {
- yyval.select_lex= yyvsp[-1].select_lex;
- }
- break;
- case 1675:
- #line 6157 "sql_yacc.yy"
- {
- yyval.select_lex= Lex->current_select->master_unit()->first_select();
- }
- break;
- case 1676:
- #line 6163 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
- lex->sql_command <= (int)SQLCOM_HA_READ) ||
- lex->sql_command == (int)SQLCOM_KILL)
- {
- yyerror(ER(ER_SYNTAX_ERROR));
- YYABORT;
- }
- if (mysql_new_select(Lex, 1))
- YYABORT;
- }
- break;
- case 1677:
- #line 6178 "sql_yacc.yy"
- {
- LEX *lex=Lex;
- lex->current_select = lex->current_select->return_after_parsing();
- }
- break;
- }
- /* Line 1000 of yacc.c. */
- #line 21863 "sql_yacc.cc"
- yyvsp -= yylen;
- yyssp -= yylen;
- YY_STACK_PRINT (yyss, yyssp);
- *++yyvsp = yyval;
- /* Now `shift' the result of the reduction. Determine what state
- that goes to, based on the state we popped back to and the rule
- number reduced by. */
- yyn = yyr1[yyn];
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
- goto yynewstate;
- /*------------------------------------.
- | yyerrlab -- here on detecting error |
- `------------------------------------*/
- yyerrlab:
- /* If not already recovering from an error, report this error. */
- if (!yyerrstatus)
- {
- ++yynerrs;
- #if YYERROR_VERBOSE
- yyn = yypact[yystate];
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- YYSIZE_T yysize = 0;
- int yytype = YYTRANSLATE (yychar);
- const char* yyprefix;
- char *yymsg;
- int yyx;
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 0;
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
- yycount += 1;
- if (yycount == 5)
- {
- yysize = 0;
- break;
- }
- }
- yysize += (sizeof ("syntax error, unexpected ")
- + yystrlen (yytname[yytype]));
- yymsg = (char *) YYSTACK_ALLOC (yysize);
- if (yymsg != 0)
- {
- char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
- yyp = yystpcpy (yyp, yytname[yytype]);
- if (yycount < 5)
- {
- yyprefix = ", expecting ";
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- yyp = yystpcpy (yyp, yyprefix);
- yyp = yystpcpy (yyp, yytname[yyx]);
- yyprefix = " or ";
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- yyerror ("syntax error; also virtual memory exhausted");
- }
- else
- #endif /* YYERROR_VERBOSE */
- yyerror ("syntax error");
- }
- if (yyerrstatus == 3)
- {
- /* If just tried and failed to reuse lookahead token after an
- error, discard it. */
- if (yychar <= YYEOF)
- {
- /* If at end of input, pop the error token,
- then the rest of the stack, then return failure. */
- if (yychar == YYEOF)
- for (;;)
- {
- YYPOPSTACK;
- if (yyssp == yyss)
- YYABORT;
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[*yyssp], yyvsp);
- }
- }
- else
- {
- YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
- yydestruct (yytoken, &yylval);
- yychar = YYEMPTY;
- }
- }
- /* Else will try to reuse lookahead token after shifting the error
- token. */
- goto yyerrlab1;
- /*---------------------------------------------------.
- | yyerrorlab -- error raised explicitly by YYERROR. |
- `---------------------------------------------------*/
- yyerrorlab:
- #ifdef __GNUC__
- /* Pacify GCC when the user code never invokes YYERROR and the label
- yyerrorlab therefore never appears in user code. */
- if (0)
- goto yyerrorlab;
- #endif
- yyvsp -= yylen;
- yyssp -= yylen;
- yystate = *yyssp;
- goto yyerrlab1;
- /*-------------------------------------------------------------.
- | yyerrlab1 -- common code for both syntax error and YYERROR. |
- `-------------------------------------------------------------*/
- yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
- for (;;)
- {
- yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
- /* Pop the current state because it cannot handle the error token. */
- if (yyssp == yyss)
- YYABORT;
- YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
- yydestruct (yystos[yystate], yyvsp);
- YYPOPSTACK;
- yystate = *yyssp;
- YY_STACK_PRINT (yyss, yyssp);
- }
- if (yyn == YYFINAL)
- YYACCEPT;
- YYDPRINTF ((stderr, "Shifting error token, "));
- *++yyvsp = yylval;
- yystate = yyn;
- goto yynewstate;
- /*-------------------------------------.
- | yyacceptlab -- YYACCEPT comes here. |
- `-------------------------------------*/
- yyacceptlab:
- yyresult = 0;
- goto yyreturn;
- /*-----------------------------------.
- | yyabortlab -- YYABORT comes here. |
- `-----------------------------------*/
- yyabortlab:
- yyresult = 1;
- goto yyreturn;
- #ifndef yyoverflow
- /*----------------------------------------------.
- | yyoverflowlab -- parser overflow comes here. |
- `----------------------------------------------*/
- yyoverflowlab:
- yyerror ("parser stack overflow");
- yyresult = 2;
- /* Fall through. */
- #endif
- yyreturn:
- #ifndef yyoverflow
- if (yyss != yyssa)
- YYSTACK_FREE (yyss);
- #endif
- return yyresult;
- }