summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2005-07-01 07:05:42 +0300
committerunknown <bell@sanja.is.com.ua>2005-07-01 07:05:42 +0300
commitb4f595b95f1740b7153013431080ff77de8d867a (patch)
tree9add97047abadbc8746b2d0a892d7944e8703d4f /sql/sql_lex.h
parent6a5ba8fdc2b5c2b5d9f94049c040c24566248461 (diff)
downloadmariadb-git-b4f595b95f1740b7153013431080ff77de8d867a.tar.gz
Name resolution context added (BUG#6443)
include/my_bitmap.h: new bitmap operation mysql-test/r/view.result: added warnings Correct inserting data check (absence of default value) for view underlying tables (BUG#6443) mysql-test/t/view.test: Correct inserting data check (absence of default value) for view underlying tables (BUG#6443) mysys/my_bitmap.c: new bitmap operation sql/field.h: index of field in table added sql/item.cc: Name resolution context added table list removed from fix_fields() arguments sql/item.h: Name resolution context added table list removed from fix_fields() arguments sql/item_cmpfunc.cc: table list removed from fix_fields() arguments sql/item_cmpfunc.h: table list removed from fix_fields() arguments sql/item_func.cc: table list removed from fix_fields() arguments sql/item_func.h: table list removed from fix_fields() arguments sql/item_row.cc: table list removed from fix_fields() arguments sql/item_row.h: table list removed from fix_fields() arguments sql/item_strfunc.cc: fixed server crash on NULL argument sql/item_strfunc.h: table list removed from fix_fields() arguments sql/item_subselect.cc: table list removed from fix_fields() arguments sql/item_subselect.h: table list removed from fix_fields() arguments sql/item_sum.cc: table list removed from fix_fields() arguments sql/item_sum.h: table list removed from fix_fields() arguments sql/item_timefunc.cc: table list removed from fix_fields() arguments sql/item_timefunc.h: table list removed from fix_fields() arguments sql/item_uniq.h: table list removed from fix_fields() arguments sql/log_event.cc: Name resolution context added sql/log_event.h: Name resolution context added sql/mysql_priv.h: Name resolution context added sql/set_var.cc: table list removed from fix_fields() arguments sql/share/errmsg.txt: new error message sql/sp.cc: Name resolution context added sql/sp_head.cc: table list removed from fix_fields() arguments sql/sp_head.h: Name resolution context added sql/sql_base.cc: table list removed from fix_fields() arguments Name resolution context added sql/sql_class.cc: renamed variable sql/sql_delete.cc: Name resolution context added sql/sql_derived.cc: Name resolution context added sql/sql_do.cc: table list removed from fix_fields() arguments sql/sql_handler.cc: Name resolution context added sql/sql_help.cc: Name resolution context added sql/sql_insert.cc: Name resolution context added table list removed from fix_fields() arguments sql/sql_lex.cc: Name resolution context added sql/sql_lex.h: removed resolve mode (information stored into name resolution context) sql/sql_load.cc: table list removed from fix_fields() arguments sql/sql_olap.cc: Name resolution context added sql/sql_parse.cc: Name resolution context added sql/sql_prepare.cc: table list removed from fix_fields() arguments sql/sql_select.cc: table list removed from fix_fields() arguments sql/sql_show.cc: Name resolution context added sql/sql_trigger.cc: table list removed from fix_fields() arguments sql/sql_udf.h: table list removed from fix_fields() arguments sql/sql_union.cc: Name resolution context added sql/sql_update.cc: Name resolution context added sql/sql_view.cc: Name resolution context added sql/sql_view.h: table list removed from fix_fields() arguments sql/sql_yacc.yy: Name resolution context added sql/table.cc: Name resolution context added merged view processing moved sql/table.h: merged view processing moved
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h45
1 files changed, 24 insertions, 21 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 5cf0b66598f..8fde37b0126 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -470,6 +470,7 @@ typedef class st_select_lex_unit SELECT_LEX_UNIT;
class st_select_lex: public st_select_lex_node
{
public:
+ Name_resolution_context context;
char *db, *db1, *table1, *db2, *table2; /* For outer join using .. */
Item *where, *having; /* WHERE & HAVING clauses */
Item *prep_where; /* saved WHERE clause for prepared statement processing */
@@ -549,27 +550,6 @@ public:
/* exclude this select from check of unique_table() */
bool exclude_from_table_unique_test;
- /*
- SELECT for SELECT command st_select_lex. Used to privent scaning
- item_list of non-SELECT st_select_lex (no sense find to finding
- reference in it (all should be in tables, it is dangerouse due
- to order of fix_fields calling for non-SELECTs commands (item list
- can be not fix_fieldsd)). This value will be assigned for
- primary select (sql_yac.yy) and for any subquery and
- UNION SELECT (sql_parse.cc mysql_new_select())
-
-
- INSERT for primary st_select_lex structure of simple INSERT/REPLACE
- (used for name resolution, see Item_fiels & Item_ref fix_fields,
- FALSE for INSERT/REPLACE ... SELECT, because it's
- st_select_lex->table_list will be preprocessed (first table removed)
- before passing to handle_select)
-
- NOMATTER for other
- */
- enum {NOMATTER_MODE, SELECT_MODE, INSERT_MODE} resolve_mode;
-
-
void init_query();
void init_select();
st_select_lex_unit* master_unit();
@@ -903,7 +883,30 @@ typedef struct st_lex
bool can_not_use_merged();
bool only_view_structure();
bool need_correct_ident();
+ uint8 get_effective_with_check(st_table_list *view);
+ /*
+ Is this update command where 'WHITH CHECK OPTION' clause is important
+ SYNOPSIS
+ st_lex::which_check_option_applicable()
+
+ RETURN
+ TRUE have to take 'WHITH CHECK OPTION' clause into account
+ FALSE 'WHITH CHECK OPTION' clause do not need
+ */
+ inline bool which_check_option_applicable()
+ {
+ switch (sql_command) {
+ case SQLCOM_UPDATE:
+ case SQLCOM_UPDATE_MULTI:
+ case SQLCOM_INSERT:
+ case SQLCOM_INSERT_SELECT:
+ case SQLCOM_LOAD:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+ }
inline bool requires_prelocking()
{
return test(query_tables_own_last);