summaryrefslogtreecommitdiff
path: root/mysql-test/r/select.result
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@station.>2007-10-23 18:03:51 +0400
committerunknown <anozdrin/alik@station.>2007-10-23 18:03:51 +0400
commit6044965c4fe14785eb7294c68067486f7451a85f (patch)
treeeaae216f32a03ef82da350e4dcf6edb1038c090f /mysql-test/r/select.result
parentd927461052084fc876151c42ea9502b5bf3fef4a (diff)
downloadmariadb-git-6044965c4fe14785eb7294c68067486f7451a85f.tar.gz
Patch for BUG#30736: Row Size Too Large Error Creating a Table and
Inserting Data. The problem was that under some circumstances Field class was not properly initialized before calling create_length_to_internal_length() function, which led to assert failure. The fix is to do the proper initialization. The user-visible problem was that under some circumstances CREATE TABLE ... SELECT statement crashed the server or led to wrong error message (wrong results). mysql-test/r/select.result: Update result file. mysql-test/t/select.test: Add a test case for BUG#30736: Row Size Too Large Error Creating a Table and Inserting Data. sql/sql_table.cc: Move sql_field->decimals initialization before sql_field->create_length_to_internal_length() call.
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r--mysql-test/r/select.result35
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index ed120a1bbb8..76022053702 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -4096,4 +4096,39 @@ SELECT `x` FROM v3;
x
1
DROP VIEW v1, v2, v3;
+
+#
+# Bug#30736: Row Size Too Large Error Creating a Table and
+# Inserting Data.
+#
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+
+CREATE TABLE t1(
+c1 DECIMAL(10, 2),
+c2 FLOAT);
+
+INSERT INTO t1 VALUES (0, 1), (2, 3), (4, 5);
+
+CREATE TABLE t2(
+c3 DECIMAL(10, 2))
+SELECT
+c1 * c2 AS c3
+FROM t1;
+
+SELECT * FROM t1;
+c1 c2
+0.00 1
+2.00 3
+4.00 5
+
+SELECT * FROM t2;
+c3
+0.00
+6.00
+20.00
+
+DROP TABLE t1;
+DROP TABLE t2;
+
End of 5.0 tests