summaryrefslogtreecommitdiff
path: root/storage/innobase/pars/pars0pars.c
diff options
context:
space:
mode:
authorunknown <aivanov/alexi@mysql.com/mysqld.localdomain>2006-07-26 13:28:51 +0400
committerunknown <aivanov/alexi@mysql.com/mysqld.localdomain>2006-07-26 13:28:51 +0400
commitd36f94791a5443b64d6ed9469dfbdd28b70fd687 (patch)
tree01e121069675cd78a8509890964b58b5f8f5d5b8 /storage/innobase/pars/pars0pars.c
parent3a409d4a2afd9febb1c7be2e18a727b4e9ad9b05 (diff)
downloadmariadb-git-d36f94791a5443b64d6ed9469dfbdd28b70fd687.tar.gz
Applied innodb-5.1-ss660 snapshot.
Changes in SQL parser: * Change default mode of SELECT from "lock in share mode" to "consistent read". * Remove support from SELECT for specifying "consistent read". * Add support in SELECT for specifying "lock in share mode". * Change all uses of SQL parser to specify "lock in share mode". * Modify syntax so that the only valid top-level statement is a procedure definition, since it's the only one that actually works. * Add support for lock waits. sql/ha_innodb.cc: Applied innodb-5.1-ss660 snapshot. Document better the "bool table_id" flag. storage/innobase/btr/btr0cur.c: Applied innodb-5.1-ss660 snapshot. btr_cur_search_to_nth_level(): Reacquire btr_search_latch after inserting to the insert buffer. This was noticed while analysing Bug#19801, but this should not fix this bug since, according to Heikki, btr_search_latch is not reserved during an insert. storage/innobase/configure.in: Applied innodb-5.1-ss660 snapshot. Add -Wpointer-arith to CFLAGS when using GCC. storage/innobase/data/data0type.c: Applied innodb-5.1-ss660 snapshot. storage/innobase/dict/dict0crea.c: Applied innodb-5.1-ss660 snapshot. storage/innobase/dict/dict0dict.c: Applied innodb-5.1-ss660 snapshot. Make dict_remove_db_name() non-static. storage/innobase/ibuf/ibuf0ibuf.c: Applied innodb-5.1-ss660 snapshot. ibuf_fixed_addr_page(): Add parameter space. As the insert buffer B-tree is only located in the system tablespace (space 0), IBUF_TREE_ROOT_PAGE_NO is only special in space 0. storage/innobase/include/data0type.h: Applied innodb-5.1-ss660 snapshot. storage/innobase/include/dict0dict.h: Applied innodb-5.1-ss660 snapshot. Make dict_remove_db_name() non-static. storage/innobase/include/pars0grm.h: Applied innodb-5.1-ss660 snapshot. storage/innobase/include/pars0pars.h: Applied innodb-5.1-ss660 snapshot. storage/innobase/include/que0que.h: Applied innodb-5.1-ss660 snapshot. storage/innobase/include/sync0rw.ic: Applied innodb-5.1-ss660 snapshot. rw_lock_s_unlock_func(): Change a debug assertion to a production assertion in order to track down Bug#19081. storage/innobase/include/trx0trx.h: Applied innodb-5.1-ss660 snapshot. trx_sig_send() always succeeds or asserts. storage/innobase/include/ut0ut.h: Applied innodb-5.1-ss660 snapshot. Document better the "bool table_id" flags. storage/innobase/mem/mem0mem.c: Applied innodb-5.1-ss660 snapshot. storage/innobase/pars/lexyy.c: Applied innodb-5.1-ss660 snapshot. storage/innobase/pars/pars0grm.c: Applied innodb-5.1-ss660 snapshot. storage/innobase/pars/pars0grm.h: Applied innodb-5.1-ss660 snapshot. storage/innobase/pars/pars0grm.y: Applied innodb-5.1-ss660 snapshot. storage/innobase/pars/pars0lex.l: Applied innodb-5.1-ss660 snapshot. storage/innobase/pars/pars0pars.c: Applied innodb-5.1-ss660 snapshot. storage/innobase/que/que0que.c: Applied innodb-5.1-ss660 snapshot. storage/innobase/row/row0mysql.c: Applied innodb-5.1-ss660 snapshot. storage/innobase/row/row0sel.c: Applied innodb-5.1-ss660 snapshot. * Disable prefetch and adaptive hash index for tables with rows over 1024 bytes in InnoDB's SQL parser. * row_sel_try_search_shortcut(): Do not return SEL_FOUND when the record was not found. This bug was introduced in MySQL/InnoDB 5.0.3, but luckily it should never manifest itself, given that existing InnoDB SQL code never makes use of consistent reads. * Don't take unnecesary locks on supremum records when the srv_locks_unsafe_for_binlog option is enabled. Fixes an assertion failure in the innodb_unsafe_binlog testcase when compiled with UNIV_DEBUG. storage/innobase/row/row0upd.c: Applied innodb-5.1-ss660 snapshot. storage/innobase/trx/trx0roll.c: Applied innodb-5.1-ss660 snapshot. trx_sig_send() always succeeds or asserts. storage/innobase/trx/trx0trx.c: Applied innodb-5.1-ss660 snapshot. trx_sig_send() always succeeds or asserts. storage/innobase/ut/ut0ut.c: Applied innodb-5.1-ss660 snapshot. Document better the "bool table_id" flags.
Diffstat (limited to 'storage/innobase/pars/pars0pars.c')
-rw-r--r--storage/innobase/pars/pars0pars.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/storage/innobase/pars/pars0pars.c b/storage/innobase/pars/pars0pars.c
index def26e62d29..1ba28fa4fe3 100644
--- a/storage/innobase/pars/pars0pars.c
+++ b/storage/innobase/pars/pars0pars.c
@@ -72,7 +72,7 @@ pars_res_word_t pars_asc_token = {PARS_ASC_TOKEN};
pars_res_word_t pars_desc_token = {PARS_DESC_TOKEN};
pars_res_word_t pars_open_token = {PARS_OPEN_TOKEN};
pars_res_word_t pars_close_token = {PARS_CLOSE_TOKEN};
-pars_res_word_t pars_consistent_token = {PARS_CONSISTENT_TOKEN};
+pars_res_word_t pars_share_token = {PARS_SHARE_TOKEN};
pars_res_word_t pars_unique_token = {PARS_UNIQUE_TOKEN};
pars_res_word_t pars_clustered_token = {PARS_CLUSTERED_TOKEN};
@@ -699,8 +699,7 @@ pars_select_statement(
sym_node_t* table_list, /* in: table list */
que_node_t* search_cond, /* in: search condition or NULL */
pars_res_word_t* for_update, /* in: NULL or &pars_update_token */
- pars_res_word_t* consistent_read,/* in: NULL or
- &pars_consistent_token */
+ pars_res_word_t* lock_shared, /* in: NULL or &pars_share_token */
order_node_t* order_by) /* in: NULL or an order-by node */
{
select_node->state = SEL_NODE_OPEN;
@@ -734,19 +733,24 @@ pars_select_statement(
}
if (for_update) {
- ut_a(!consistent_read);
+ ut_a(!lock_shared);
+
select_node->set_x_locks = TRUE;
select_node->row_lock_mode = LOCK_X;
- } else {
+
+ select_node->consistent_read = FALSE;
+ select_node->read_view = NULL;
+ } else if (lock_shared){
select_node->set_x_locks = FALSE;
select_node->row_lock_mode = LOCK_S;
- }
- if (consistent_read) {
- select_node->consistent_read = TRUE;
- } else {
select_node->consistent_read = FALSE;
select_node->read_view = NULL;
+ } else {
+ select_node->set_x_locks = FALSE;
+ select_node->row_lock_mode = LOCK_S;
+
+ select_node->consistent_read = TRUE;
}
select_node->order_by = order_by;
@@ -976,7 +980,7 @@ pars_update_statement(
sel_node = pars_select_list(NULL, NULL);
pars_select_statement(sel_node, table_sym, search_cond, NULL,
- NULL, NULL);
+ &pars_share_token, NULL);
node->searched_update = TRUE;
sel_node->common.parent = node;
}
@@ -1857,8 +1861,9 @@ pars_sql(
#endif /* UNIV_SYNC_DEBUG */
pars_sym_tab_global = sym_tab_create(heap);
- pars_sym_tab_global->sql_string = mem_heap_strdup(heap, str);
pars_sym_tab_global->string_len = strlen(str);
+ pars_sym_tab_global->sql_string = mem_heap_dup(heap, str,
+ pars_sym_tab_global->string_len + 1);
pars_sym_tab_global->next_char_pos = 0;
pars_sym_tab_global->info = info;