1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called

When executing INSERT over a view with calculated columns it was assuming all
  elements of the fields collection are actually Item_field instances.
  This may not be true when inserting into a view and that view has columns that are 
  such expressions that allow updating (like setting a collation for example).
  Corrected to access field information through the filed_for_view_update() function and 
  retrieve correctly the field info even for "update-friendly" non-Item_field items.
This commit is contained in:
gkodinov/kgeorge@macbook.gmz
2006-07-25 18:42:49 +03:00
parent 9e9fb3e4e4
commit f5b0dd6a00
4 changed files with 40 additions and 3 deletions

View File

@@ -2807,3 +2807,16 @@ yadda
yad
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (s1 char);
INSERT INTO t1 VALUES ('Z');
CREATE VIEW v1 AS SELECT s1 collate latin1_german1_ci AS col FROM t1;
CREATE VIEW v2 (col) AS SELECT s1 collate latin1_german1_ci FROM t1;
INSERT INTO v1 (col) VALUES ('b');
INSERT INTO v2 (col) VALUES ('c');
SELECT s1 FROM t1;
s1
Z
b
c
DROP VIEW v1, v2;
DROP TABLE t1;