diff options
author | timour@mysql.com <> | 2004-11-25 11:37:28 +0200 |
---|---|---|
committer | timour@mysql.com <> | 2004-11-25 11:37:28 +0200 |
commit | 38ab93c6befaca29e2fc36f0f24ce2d1e464550b (patch) | |
tree | 29ad0385fdb639f58ab052e5bb498f9429a374d9 /innobase/pars | |
parent | 5eae363c329978a8d87cadc76a1a4967f38a7d70 (diff) | |
parent | cf722bc3f5040d447f657477485e362b967d1f3e (diff) | |
download | mariadb-git-38ab93c6befaca29e2fc36f0f24ce2d1e464550b.tar.gz |
Merge for BUG#3759 which was missing from the main tree for some reason.
Diffstat (limited to 'innobase/pars')
-rw-r--r-- | innobase/pars/pars0opt.c | 13 | ||||
-rw-r--r-- | innobase/pars/pars0pars.c | 8 |
2 files changed, 19 insertions, 2 deletions
diff --git a/innobase/pars/pars0opt.c b/innobase/pars/pars0opt.c index 5cc2e39b438..51aaf02b736 100644 --- a/innobase/pars/pars0opt.c +++ b/innobase/pars/pars0opt.c @@ -1094,6 +1094,19 @@ opt_clust_access( for (i = 0; i < n_fields; i++) { pos = dict_index_get_nth_field_pos(index, clust_index, i); + ut_a(pos != ULINT_UNDEFINED); + + /* We optimize here only queries to InnoDB's internal system + tables, and they should not contain column prefix indexes. */ + + if (dict_index_get_nth_field(index, pos)->prefix_len != 0 + || dict_index_get_nth_field(clust_index, i) + ->prefix_len != 0) { + fprintf(stderr, +"InnoDB: Error in pars0opt.c: table %s has prefix_len != 0\n", + index->table_name); + } + *(plan->clust_map + i) = pos; ut_ad((pos != ULINT_UNDEFINED) diff --git a/innobase/pars/pars0pars.c b/innobase/pars/pars0pars.c index a4124672df0..5be0e52d0c8 100644 --- a/innobase/pars/pars0pars.c +++ b/innobase/pars/pars0pars.c @@ -259,9 +259,13 @@ pars_resolve_func_data_type( dtype_set(que_node_get_data_type(node), DATA_VARCHAR, DATA_ENGLISH, 0, 0); } else if (func == PARS_TO_BINARY_TOKEN) { - ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT); - dtype_set(que_node_get_data_type(node), DATA_VARCHAR, + if (dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT) { + dtype_set(que_node_get_data_type(node), DATA_VARCHAR, DATA_ENGLISH, 0, 0); + } else { + dtype_set(que_node_get_data_type(node), DATA_BINARY, + 0, 0, 0); + } } else if (func == PARS_TO_NUMBER_TOKEN) { ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_VARCHAR); |