diff options
author | Will DeVries <william.devries@gmail.com> | 2020-02-26 15:47:05 -0800 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2020-03-10 11:22:33 +0300 |
commit | b2f56c36e9a7e0d1f1573eac71a5dcec9fc7998c (patch) | |
tree | 91fa9fce63f104c3d096fe5d98f10aa1cb086763 | |
parent | 1e0152b456711948a26e90e3ccbab90b5cc6f461 (diff) | |
download | mariadb-git-b2f56c36e9a7e0d1f1573eac71a5dcec9fc7998c.tar.gz |
Revert "Add table synchronization for select and derived handlers."
-rw-r--r-- | storage/xpand/ha_xpand.cc | 36 | ||||
-rw-r--r-- | storage/xpand/ha_xpand.h | 3 | ||||
-rw-r--r-- | storage/xpand/ha_xpand_pushdown.cc | 16 | ||||
-rw-r--r-- | storage/xpand/xpand_connection.cc | 9 | ||||
-rw-r--r-- | storage/xpand/xpand_connection.h | 2 |
5 files changed, 6 insertions, 60 deletions
diff --git a/storage/xpand/ha_xpand.cc b/storage/xpand/ha_xpand.cc index 577689076bb..90d8738e332 100644 --- a/storage/xpand/ha_xpand.cc +++ b/storage/xpand/ha_xpand.cc @@ -473,37 +473,6 @@ xpand_mark_table_for_discovery(TABLE *table) xs->xpand_table_oid= 0; } -void -xpand_mark_tables_for_discovery(LEX *lex) -{ - for (TABLE_LIST *tbl= lex->query_tables; tbl; tbl= tbl->next_global) - if (tbl->table && tbl->table->file->ht == xpand_hton) - xpand_mark_table_for_discovery(tbl->table); -} - -ulonglong * -xpand_extract_table_oids(THD *thd, LEX *lex) -{ - int cnt = 1; - for (TABLE_LIST *tbl = lex->query_tables; tbl; tbl= tbl->next_global) - if (tbl->table && tbl->table->file->ht == xpand_hton) - cnt++; - - ulonglong *oids = (ulonglong*)thd_alloc(thd, cnt * sizeof(ulonglong)); - ulonglong *ptr = oids; - for (TABLE_LIST *tbl = lex->query_tables; tbl; tbl= tbl->next_global) - { - if (tbl->table && tbl->table->file->ht == xpand_hton) - { - ha_xpand *hndlr = static_cast<ha_xpand *>(tbl->table->file); - *ptr++ = hndlr->get_table_oid(); - } - } - - *ptr = 0; - return oids; -} - int ha_xpand::open(const char *name, int mode, uint test_if_locked) { THD *thd= ha_thd(); @@ -1221,11 +1190,6 @@ int ha_xpand::info_push(uint info_type, void *info) return 0; } -ulonglong ha_xpand::get_table_oid() -{ - return xpand_table_oid; -} - /**************************************************************************** ** Row encoding functions ****************************************************************************/ diff --git a/storage/xpand/ha_xpand.h b/storage/xpand/ha_xpand.h index bc3206f2f5f..8e3ea059e59 100644 --- a/storage/xpand/ha_xpand.h +++ b/storage/xpand/ha_xpand.h @@ -29,8 +29,6 @@ void remove_current_table_from_rpl_table_list(rpl_group_info *rgi); int unpack_row_to_buf(rpl_group_info *rgi, TABLE *table, uchar *data, uchar const *const row_data, MY_BITMAP const *cols, uchar const *const row_end); -void xpand_mark_tables_for_discovery(LEX *lex); -ulonglong *xpand_extract_table_oids(THD *thd, LEX *lex); class Xpand_share : public Handler_share { @@ -133,7 +131,6 @@ public: void cond_pop(); int info_push(uint info_type, void *info); - ulonglong get_table_oid(); private: void build_key_packed_row(uint index, const uchar *buf, uchar *packed_key, size_t *packed_key_len); diff --git a/storage/xpand/ha_xpand_pushdown.cc b/storage/xpand/ha_xpand_pushdown.cc index 7700d8dfa3c..de43d4bd75b 100644 --- a/storage/xpand/ha_xpand_pushdown.cc +++ b/storage/xpand/ha_xpand_pushdown.cc @@ -101,7 +101,6 @@ err: select_handler* create_xpand_select_handler(THD* thd, SELECT_LEX* select_lex) { - ulonglong *oids = NULL; ha_xpand_select_handler *sh = NULL; if (!select_handler_setting(thd)) { return sh; @@ -157,23 +156,20 @@ create_xpand_select_handler(THD* thd, SELECT_LEX* select_lex) if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) trx->auto_commit_next(); - oids = xpand_extract_table_oids(thd, select_lex->parent_lex); if ((error_code = trx->scan_query(query, fieldtype, items_number, null_bits, num_null_bytes, field_metadata, field_metadata_size, - row_buffer_setting(thd), oids, &scan))) { + row_buffer_setting(thd), &scan))) { goto err; } sh = new ha_xpand_select_handler(thd, select_lex, scan); err: + // deallocate buffers if (meta_memory) my_free(meta_memory); - if (error_code == HA_ERR_TABLE_DEF_CHANGED) - xpand_mark_tables_for_discovery(select_lex->parent_lex); - return sh; } @@ -380,7 +376,6 @@ int ha_xpand_derived_handler::init_scan() int error_code = 0; int field_metadata_size = 0; xpand_connection *trx = NULL; - ulonglong *oids = NULL; // We presume this number is equal to types.elements in get_field_types uint items_number= select->get_item_list()->elements; @@ -407,11 +402,10 @@ int ha_xpand_derived_handler::init_scan() if (!trx) goto err; - oids = xpand_extract_table_oids(thd__, select->parent_lex); if ((error_code = trx->scan_query(query, fieldtype, items_number, null_bits, num_null_bytes, field_metadata, field_metadata_size, - row_buffer_setting(thd), oids, &scan))) { + row_buffer_setting(thd), &scan))) { goto err; } @@ -426,12 +420,10 @@ int ha_xpand_derived_handler::init_scan() add_current_table_to_rpl_table_list(&rgi, thd__, table__); err: + // deallocate buffers if (meta_memory) my_free(meta_memory); - if (error_code == HA_ERR_TABLE_DEF_CHANGED) - xpand_mark_tables_for_discovery(select->parent_lex); - return error_code; } diff --git a/storage/xpand/xpand_connection.cc b/storage/xpand/xpand_connection.cc index fd3e83b1972..34ba7b7dfe1 100644 --- a/storage/xpand/xpand_connection.cc +++ b/storage/xpand/xpand_connection.cc @@ -281,7 +281,7 @@ int xpand_connection::send_command() committed or rolled back. */ trans_state = XPAND_TRANS_STARTED; - + com_error = simple_command(&xpand_net, (enum_server_command)XPAND_SERVER_REQUEST, command_buffer, command_length, TRUE); @@ -777,7 +777,6 @@ int xpand_connection::scan_query(String &stmt, uchar *fieldtype, uint fields, uchar *null_bits, uint null_bits_size, uchar *field_metadata, uint field_metadata_size, ushort row_req, - ulonglong *oids, xpand_connection_cursor **scan) { int error_code; @@ -786,12 +785,6 @@ int xpand_connection::scan_query(String &stmt, uchar *fieldtype, uint fields, if ((error_code = begin_command(XPAND_SCAN_QUERY))) return error_code; - do { - if ((error_code = add_command_operand_ulonglong(*oids))) - return error_code; - } - while (*oids++); - if ((error_code = add_command_operand_ushort(row_req))) return error_code; diff --git a/storage/xpand/xpand_connection.h b/storage/xpand/xpand_connection.h index a9f4df04b55..e2d4761dd68 100644 --- a/storage/xpand/xpand_connection.h +++ b/storage/xpand/xpand_connection.h @@ -89,7 +89,7 @@ public: xpand_connection_cursor **scan); int scan_query(String &stmt, uchar *fieldtype, uint fields, uchar *null_bits, uint null_bits_size, uchar *field_metadata, - uint field_metadata_size, ushort row_req, ulonglong *oids, + uint field_metadata_size, ushort row_req, xpand_connection_cursor **scan); int update_query(String &stmt, LEX_CSTRING &dbname, ulonglong *affected_rows); int scan_from_key(ulonglong xpand_table_oid, uint index, |