summaryrefslogtreecommitdiff
path: root/mysql-test/main/func_analyse.result
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-05-28 16:57:59 +0400
committerAlexander Barkov <bar@mariadb.com>2018-05-28 16:57:59 +0400
commit637af7838316a49267e55cde7cf96e23f63e5c9d (patch)
treef3ef34e94f1942ae3c8f572abdeac146ddcf8aee /mysql-test/main/func_analyse.result
parent13f7ac226982acc1aff53aff605e2821a42c8443 (diff)
downloadmariadb-git-637af7838316a49267e55cde7cf96e23f63e5c9d.tar.gz
MDEV-16309 Split ::create_tmp_field() into virtual methods in Item
Detailed: changes: 1. Moving Field specific code into new methods on Field: - Field *Field::create_tmp_field(...) - virtual void init_for_tmp_table(...) 2. Removing virtual Item::create_tmp_field(). Adding instead a new virtual method Item::create_tmp_field_ex(). Note, a virtual create_tmp_field() still exists, but only for Item_sum. This resembles 10.0 code structure. Perhaps create_tmp_field() should be removed from Item_sum and Item_sum descendants should override create_tmp_field_ex() directly. This can be done in a separate commit. 3. Adding helper classes Tmp_field_src and Tmp_field_param, to make the API for Item::create_tmp_field_ex() smaller and easier to extend in the future. 4. Decomposing the public function create_tmp_field() into virtual implementations for Item and a number of its descendants: - Item_basic_value - Item_sp_variable - Item_name_const - Item_result_field - Item_field - Item_ref - Item_type_holder - Item_row - Item_func_sp - Item_func_user_var - Item_sum - Item_sum_field - Item_proc 5. Adding DBUG_ASSERT-only virtual implementations for Item types that should not appear in create_tmp_table_ex(), for easier debugging: - Item_nodeset_func - Item_nodeset_to_const_comparator - Item_null_result - Item_copy - Item_ident_for_show - Item_user_var_as_out_param 6. Moving public function create_tmp_field_from_field() as a method to Item_field. 7. Removing Item::set_result_field(). It's not needed any more. 8. Cleanup: Removing the enum value "EXPR_CACHE_ITEM", as it's not used for a very long time.
Diffstat (limited to 'mysql-test/main/func_analyse.result')
-rw-r--r--mysql-test/main/func_analyse.result45
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/main/func_analyse.result b/mysql-test/main/func_analyse.result
index 1e78e603bca..068693bd028 100644
--- a/mysql-test/main/func_analyse.result
+++ b/mysql-test/main/func_analyse.result
@@ -171,3 +171,48 @@ SELECT (SELECT 1 FROM t1 PROCEDURE ANALYSE()) FROM t2;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PROCEDURE ANALYSE()) FROM t2' at line 1
SELECT ((SELECT 1 FROM t1 PROCEDURE ANALYSE())) FROM t2;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PROCEDURE ANALYSE())) FROM t2' at line 1
+#
+# Start of 10.4 tests
+#
+#
+# MDEV-16309 Split ::create_tmp_field() into virtual methods in Item
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3);
+BEGIN NOT ATOMIC
+DECLARE rec ROW(Field_name TEXT,
+Min_value TEXT,
+Max_value TEXT,
+Min_length TEXT,
+Max_length TEXT,
+Empties_or_zeros TEXT,
+Nulls TEXT,
+Avg_value_or_avg_length TEXT,
+Std TEXT,
+Optimal_fieldtype TEXT);
+DECLARE c CURSOR FOR SELECT * FROM t1 PROCEDURE analyse();
+OPEN c;
+FETCH c INTO rec;
+CLOSE c;
+SELECT rec.field_name,
+rec.Min_value, rec.Max_value,
+rec.Min_length, rec. Max_length,
+rec.Empties_or_zeros, rec.Nulls,
+rec.Avg_value_or_avg_length, rec.Std,
+rec.Optimal_fieldtype;
+END;
+$$
+rec.field_name test.t1.a
+rec.Min_value 1
+rec.Max_value 3
+rec.Min_length 1
+rec. Max_length 1
+rec.Empties_or_zeros 0
+rec.Nulls 0
+rec.Avg_value_or_avg_length 2.0000
+rec.Std 0.8165
+rec.Optimal_fieldtype ENUM('1','2','3') NOT NULL
+DROP TABLE t1;
+#
+# End of 10.4 tests
+#