summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <antony@pcg5ppc.xiphis.org>2007-10-19 13:06:37 -0700
committerunknown <antony@pcg5ppc.xiphis.org>2007-10-19 13:06:37 -0700
commit62fd471647d920482eb4a8bd61d33a6cad1064ec (patch)
treec11732a55bd249a146cc63db1188fd4f7c10cd0c /sql
parentb0488a32038ca9abf8e9ec8ec2482598aca133ab (diff)
parent8d923eb55973643d171f83616f21466defc89137 (diff)
downloadmariadb-git-62fd471647d920482eb4a8bd61d33a6cad1064ec.tar.gz
Merge anubis.xiphis.org:/usr/home/antony/work/mysql-5.1-engines
into anubis.xiphis.org:/usr/home/antony/work/mysql-5.1-engines.merge configure.in: Auto merged mysql-test/r/heap_btree.result: Auto merged mysql-test/r/log_tables.result: Auto merged mysql-test/r/partition.result: Auto merged mysql-test/r/system_mysql_db.result: Auto merged mysql-test/t/heap_btree.test: Auto merged mysql-test/t/log_tables.test: Auto merged mysql-test/t/partition.test: Auto merged mysys/my_getopt.c: Auto merged scripts/mysql_system_tables.sql: Auto merged sql/sql_base.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_partition.cc34
-rw-r--r--sql/sql_base.cc10
-rw-r--r--sql/sql_plugin.cc13
-rw-r--r--sql/table.cc1
4 files changed, 54 insertions, 4 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 200e8a97c67..1150cf41417 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3391,6 +3391,22 @@ int ha_partition::index_init(uint inx, bool sorted)
*/
if (m_lock_type == F_WRLCK)
bitmap_union(table->read_set, &m_part_info->full_part_field_set);
+ else if (sorted && m_table_flags & HA_PARTIAL_COLUMN_READ)
+ {
+ /*
+ An ordered scan is requested and necessary fields aren't in read_set.
+ This may happen e.g. with SELECT COUNT(*) FROM t1. We must ensure
+ that all fields of current key are included into read_set, as
+ partitioning requires them for sorting
+ (see ha_partition::handle_ordered_index_scan).
+
+ TODO: handle COUNT(*) queries via unordered scan.
+ */
+ uint i;
+ for (i= 0; i < m_curr_key_info->key_parts; i++)
+ bitmap_set_bit(table->read_set,
+ m_curr_key_info->key_part[i].field->field_index);
+ }
file= m_file;
do
{
@@ -4540,6 +4556,8 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info,
4) Parameters only used by temporary tables for query processing
5) Parameters only used by MyISAM internally
6) Parameters not used at all
+ 7) Parameters only used by federated tables for query processing
+ 8) Parameters only used by NDB
The partition handler need to handle category 1), 2) and 3).
@@ -4806,6 +4824,15 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info,
HA_EXTRA_INSERT_WITH_UPDATE:
Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be
executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
+
+ 8) Parameters only used by NDB
+ ------------------------------
+ HA_EXTRA_DELETE_CANNOT_BATCH:
+ HA_EXTRA_UPDATE_CANNOT_BATCH:
+ Inform handler that delete_row()/update_row() cannot batch deletes/updates
+ and should perform them immediately. This may be needed when table has
+ AFTER DELETE/UPDATE triggers which access to subject table.
+ These flags are reset by the handler::extra(HA_EXTRA_RESET) call.
*/
int ha_partition::extra(enum ha_extra_function operation)
@@ -4890,6 +4917,13 @@ int ha_partition::extra(enum ha_extra_function operation)
/* Category 7), used by federated handlers */
case HA_EXTRA_INSERT_WITH_UPDATE:
DBUG_RETURN(loop_extra(operation));
+ /* Category 8) Parameters only used by NDB */
+ case HA_EXTRA_DELETE_CANNOT_BATCH:
+ case HA_EXTRA_UPDATE_CANNOT_BATCH:
+ {
+ /* Currently only NDB use the *_CANNOT_BATCH */
+ break;
+ }
default:
{
/* Temporary crash to discover what is wrong */
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index c4e90165ced..3a959d30a5d 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -7758,7 +7758,17 @@ open_performance_schema_table(THD *thd, TABLE_LIST *one_table,
table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
}
else
+ {
+ /*
+ If error in mysql_lock_tables(), open_ltable doesn't close the
+ table. Thread kill during mysql_lock_tables() is such error. But
+ open tables cannot be accepted when restoring the open tables
+ state.
+ */
+ if (thd->killed)
+ close_thread_tables(thd);
thd->restore_backup_open_tables_state(backup);
+ }
thd->utime_after_lock= save_utime_after_lock;
DBUG_RETURN(table);
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 2d33da29b77..2af528f6699 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -3053,7 +3053,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
MEM_ROOT *mem_root= alloc_root_inited(&tmp->mem_root) ?
&tmp->mem_root : &plugin_mem_root;
st_mysql_sys_var **opt;
- my_option *opts;
+ my_option *opts= NULL;
char *p, *varname;
int error;
st_mysql_sys_var *o;
@@ -3092,7 +3092,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
{
sql_print_error("Parsing options for plugin '%s' failed.",
tmp->name.str);
- DBUG_RETURN(error);
+ goto err;
}
}
@@ -3102,6 +3102,8 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
*enabled= TRUE;
}
+ error= 1;
+
if (*enabled)
{
for (opt= tmp->plugin->system_vars; opt && *opt; opt++)
@@ -3140,7 +3142,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
{
sql_print_error("Plugin '%s' has conflicting system variables",
tmp->name.str);
- DBUG_RETURN(1);
+ goto err;
}
tmp->system_vars= chain.first;
}
@@ -3150,7 +3152,10 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
if (enabled_saved && global_system_variables.log_warnings)
sql_print_information("Plugin '%s' disabled by command line option",
tmp->name.str);
- DBUG_RETURN(1);
+err:
+ if (opts)
+ my_cleanup_options(opts);
+ DBUG_RETURN(error);
}
diff --git a/sql/table.cc b/sql/table.cc
index c1d8e3abe94..ccddbf8134b 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -969,6 +969,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
}
parser_name.str= (char*) next_chunk;
parser_name.length= strlen((char*) next_chunk);
+ next_chunk+= parser_name.length + 1;
keyinfo->parser= my_plugin_lock_by_name(NULL, &parser_name,
MYSQL_FTPARSER_PLUGIN);
if (! keyinfo->parser)