diff options
author | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-02-21 14:07:08 +0200 |
---|---|---|
committer | unknown <monty@mysql.com/narttu.mysql.fi> | 2007-02-21 14:07:08 +0200 |
commit | 1384e640053aee1f528148e876a632b2a0a2a8ed (patch) | |
tree | 57fb0c9c6c3686011b021c42671cf5065cdc0cf6 /sql/table.cc | |
parent | c5beed03464e9b74d75a701721154d68fc4f84ea (diff) | |
parent | 2f3a17b63e4e207ae8796d953ba611a593e3ee2c (diff) | |
download | mariadb-git-1384e640053aee1f528148e876a632b2a0a2a8ed.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
BitKeeper/etc/ignore:
auto-union
BUILD/SETUP.sh:
Auto merged
Makefile.am:
Auto merged
client/mysql.cc:
Auto merged
cmd-line-utils/readline/display.c:
Auto merged
configure.in:
Auto merged
extra/yassl/include/buffer.hpp:
Auto merged
extra/yassl/include/crypto_wrapper.hpp:
Auto merged
extra/yassl/include/yassl_imp.hpp:
Auto merged
extra/yassl/include/yassl_int.hpp:
Auto merged
extra/yassl/src/crypto_wrapper.cpp:
Auto merged
extra/yassl/taocrypt/include/algebra.hpp:
Auto merged
extra/yassl/taocrypt/include/des.hpp:
Auto merged
extra/yassl/taocrypt/include/hash.hpp:
Auto merged
extra/yassl/taocrypt/include/hmac.hpp:
Auto merged
extra/yassl/taocrypt/include/modarith.hpp:
Auto merged
extra/yassl/taocrypt/include/modes.hpp:
Auto merged
extra/yassl/taocrypt/include/rsa.hpp:
Auto merged
extra/yassl/taocrypt/include/type_traits.hpp:
Auto merged
extra/yassl/taocrypt/mySTL/list.hpp:
Auto merged
extra/yassl/taocrypt/src/aes.cpp:
Auto merged
extra/yassl/taocrypt/src/algebra.cpp:
Auto merged
extra/yassl/testsuite/testsuite.cpp:
Auto merged
include/my_global.h:
Auto merged
include/my_pthread.h:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
myisam/mi_open.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/mysqltest.result:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysys/default.c:
Auto merged
ndb/src/common/transporter/Transporter.cpp:
Auto merged
ndb/src/common/util/File.cpp:
Auto merged
ndb/src/common/util/SocketClient.cpp:
Auto merged
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
Auto merged
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
Auto merged
ndb/src/kernel/blocks/qmgr/Qmgr.hpp:
Auto merged
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
Auto merged
ndb/src/mgmapi/mgmapi.cpp:
Auto merged
ndb/src/mgmclient/CommandInterpreter.cpp:
Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
Auto merged
ndb/src/ndbapi/ClusterMgr.hpp:
Auto merged
ndb/src/ndbapi/Ndb.cpp:
Auto merged
ndb/src/ndbapi/NdbScanOperation.cpp:
Auto merged
ndb/src/ndbapi/SignalSender.cpp:
Auto merged
sql/field.cc:
Auto merged
sql/filesort.cc:
Auto merged
sql/ha_myisammrg.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_subselect.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/net_serv.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/opt_range.h:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_union.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_view.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql/unireg.cc:
Auto merged
extra/yassl/taocrypt/src/asn.cpp:
Manual merge (Fix shadowed variable name)
extra/yassl/taocrypt/test/test.cpp:
No changes
ndb/src/common/util/ConfigValues.cpp:
Manual merge (Fix shadowed variable name)
sql/field.h:
manual merge
sql/ha_myisam.cc:
manual merge
sql/ha_ndbcluster.cc:
manual merge
sql/item_cmpfunc.cc:
manual merge
sql/item_subselect.cc:
Manual merge (Fix shadowed variable name)
sql/mysqld.cc:
no changes
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 65 |
1 files changed, 33 insertions, 32 deletions
diff --git a/sql/table.cc b/sql/table.cc index e2cb0bea300..970f5b2267c 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -892,17 +892,17 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, if (share->blob_fields) { Field **ptr; - uint i, *save; + uint k, *save; /* Store offsets to blob fields to find them fast */ if (!(share->blob_field= save= (uint*) alloc_root(&outparam->mem_root, (uint) (share->blob_fields* sizeof(uint))))) goto err; - for (i=0, ptr= outparam->field ; *ptr ; ptr++, i++) + for (k=0, ptr= outparam->field ; *ptr ; ptr++, k++) { if ((*ptr)->flags & BLOB_FLAG) - (*save++)= i; + (*save++)= k; } } @@ -2161,19 +2161,17 @@ int st_table_list::view_check_option(THD *thd, bool ignore_failure) { if (check_option && check_option->val_int() == 0) { - TABLE_LIST *view= top_table(); + TABLE_LIST *main_view= top_table(); if (ignore_failure) { push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, ER_VIEW_CHECK_FAILED, ER(ER_VIEW_CHECK_FAILED), - view->view_db.str, view->view_name.str); + main_view->view_db.str, main_view->view_name.str); return(VIEW_CHECK_SKIP); } - else - { - my_error(ER_VIEW_CHECK_FAILED, MYF(0), view->view_db.str, view->view_name.str); - return(VIEW_CHECK_ERROR); - } + my_error(ER_VIEW_CHECK_FAILED, MYF(0), main_view->view_db.str, + main_view->view_name.str); + return(VIEW_CHECK_ERROR); } return(VIEW_CHECK_OK); } @@ -2185,19 +2183,20 @@ int st_table_list::view_check_option(THD *thd, bool ignore_failure) SYNOPSIS st_table_list::check_single_table() - table reference on variable where to store found table + table_arg reference on variable where to store found table (should be 0 on call, to find table, or point to table for unique test) map bit mask of tables - view view for which we are looking table + view_arg view for which we are looking table RETURN FALSE table not found or found only one TRUE found several tables */ -bool st_table_list::check_single_table(st_table_list **table, table_map map, - st_table_list *view) +bool st_table_list::check_single_table(st_table_list **table_arg, + table_map map, + st_table_list *view_arg) { for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local) { @@ -2205,13 +2204,13 @@ bool st_table_list::check_single_table(st_table_list **table, table_map map, { if (tbl->table->map & map) { - if (*table) + if (*table_arg) return TRUE; - *table= tbl; - tbl->check_option= view->check_option; + *table_arg= tbl; + tbl->check_option= view_arg->check_option; } } - else if (tbl->check_single_table(table, map, view)) + else if (tbl->check_single_table(table_arg, map, view_arg)) return TRUE; } return FALSE; @@ -2536,18 +2535,19 @@ bool st_table_list::prepare_security(THD *thd) while ((tbl= tb++)) { DBUG_ASSERT(tbl->referencing_view); - char *db, *table_name; + char *local_db, *local_table_name; if (tbl->view) { - db= tbl->view_db.str; - table_name= tbl->view_name.str; + local_db= tbl->view_db.str; + local_table_name= tbl->view_name.str; } else { - db= tbl->db; - table_name= tbl->table_name; + local_db= tbl->db; + local_table_name= tbl->table_name; } - fill_effective_table_privileges(thd, &tbl->grant, db, table_name); + fill_effective_table_privileges(thd, &tbl->grant, local_db, + local_table_name); if (tbl->table) tbl->table->grant= grant; } @@ -2907,12 +2907,13 @@ Field_iterator_table_ref::get_or_create_column_ref(TABLE_LIST *parent_table_ref) uint field_count; TABLE_LIST *add_table_ref= parent_table_ref ? parent_table_ref : table_ref; - + LINT_INIT(field_count); + if (field_it == &table_field_it) { /* The field belongs to a stored table. */ - Field *field= table_field_it.field(); - nj_col= new Natural_join_column(field, table_ref); + Field *tmp_field= table_field_it.field(); + nj_col= new Natural_join_column(tmp_field, table_ref); field_count= table_ref->table->s->fields; } else if (field_it == &view_field_it) @@ -3023,16 +3024,16 @@ void st_table_list::reinit_before_use(THD *thd) schema_table_state= NOT_PROCESSED; TABLE_LIST *embedded; /* The table at the current level of nesting. */ - TABLE_LIST *embedding= this; /* The parent nested table reference. */ + TABLE_LIST *parent_embedding= this; /* The parent nested table reference. */ do { - embedded= embedding; + embedded= parent_embedding; if (embedded->prep_on_expr) embedded->on_expr= embedded->prep_on_expr->copy_andor_structure(thd); - embedding= embedded->embedding; + parent_embedding= embedded->embedding; } - while (embedding && - embedding->nested_join->join_list.head() == embedded); + while (parent_embedding && + parent_embedding->nested_join->join_list.head() == embedded); } /* |