Loading cmd-line-utils/libedit/chared.c +2 −2 Original line number Diff line number Diff line Loading @@ -51,13 +51,13 @@ cv_undo(EditLine *el) { c_undo_t *vu = &el->el_chared.c_undo; c_redo_t *r = &el->el_chared.c_redo; uint size; int size; /* Save entire line for undo */ size = el->el_line.lastchar - el->el_line.buffer; vu->len = size; vu->cursor = el->el_line.cursor - el->el_line.buffer; memcpy(vu->buf, el->el_line.buffer, size); memcpy(vu->buf, el->el_line.buffer, (size_t)size); /* save command info for redo */ r->count = el->el_state.doingarg ? el->el_state.argument : 0; Loading mysql-test/r/subselect.result +6 −0 Original line number Diff line number Diff line Loading @@ -2837,3 +2837,9 @@ WHERE select_id = 0 OR select_id = 1); values_id 1 DROP TABLE t1, t2; create table t1 (fld enum('0','1')); insert into t1 values ('1'); select * from (select max(fld) from t1) as foo; max(fld) 1 drop table t1; mysql-test/r/view.result +27 −0 Original line number Diff line number Diff line Loading @@ -1923,6 +1923,14 @@ ERROR HY000: Field of view 'test.v2' underlying table doesn't have a default val set sql_mode=default; drop view v2,v1; drop table t1; create table t1 (f1 int); insert into t1 values (1); create view v1 as select f1 from t1; select f1 as alias from v1; alias 1 drop view v1; drop table t1; CREATE TABLE t1 (s1 int, s2 int); INSERT INTO t1 VALUES (1,2); CREATE VIEW v1 AS SELECT s2 AS s1, s1 AS s2 FROM t1; Loading @@ -1937,6 +1945,25 @@ ALTER VIEW v1 AS SELECT s1 AS s1, s2 AS s2 FROM t1; CALL p1(); s1 s2 1 2 DROP VIEW v1; CREATE VIEW v1 AS SELECT s2 AS s1, s1 AS s2 FROM t1; CALL p1(); s1 s2 2 1 DROP PROCEDURE p1; DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (f1 char) ENGINE = innodb; INSERT INTO t1 VALUES ('A'); CREATE VIEW v1 AS SELECT * FROM t1; INSERT INTO t1 VALUES('B'); SELECT * FROM v1; f1 A B SELECT * FROM t1; f1 A B DROP VIEW v1; DROP TABLE t1; mysql-test/t/subselect.test +8 −0 Original line number Diff line number Diff line Loading @@ -1859,3 +1859,11 @@ WHERE values_id IN (SELECT values_id FROM t2 WHERE select_id = 0 OR select_id = 1); DROP TABLE t1, t2; # BUG#11821 : Select from subselect using aggregate function on an enum # segfaults: create table t1 (fld enum('0','1')); insert into t1 values ('1'); select * from (select max(fld) from t1) as foo; drop table t1; mysql-test/t/view.test +28 −0 Original line number Diff line number Diff line Loading @@ -1762,6 +1762,16 @@ set sql_mode=default; drop view v2,v1; drop table t1; # # Bug#11399 Use an alias in a select statement on a view # create table t1 (f1 int); insert into t1 values (1); create view v1 as select f1 from t1; select f1 as alias from v1; drop view v1; drop table t1; # # Test for bug #6120: SP cache to be invalidated when altering a view # Loading @@ -1774,7 +1784,25 @@ CREATE PROCEDURE p1 () SELECT * FROM v1; CALL p1(); ALTER VIEW v1 AS SELECT s1 AS s1, s2 AS s2 FROM t1; CALL p1(); DROP VIEW v1; CREATE VIEW v1 AS SELECT s2 AS s1, s1 AS s2 FROM t1; CALL p1(); DROP PROCEDURE p1; DROP VIEW v1; DROP TABLE t1; # # Test for bug #11771: wrong query_id in SELECT * FROM <view> # CREATE TABLE t1 (f1 char) ENGINE = innodb; INSERT INTO t1 VALUES ('A'); CREATE VIEW v1 AS SELECT * FROM t1; INSERT INTO t1 VALUES('B'); SELECT * FROM v1; SELECT * FROM t1; DROP VIEW v1; DROP TABLE t1; Loading
cmd-line-utils/libedit/chared.c +2 −2 Original line number Diff line number Diff line Loading @@ -51,13 +51,13 @@ cv_undo(EditLine *el) { c_undo_t *vu = &el->el_chared.c_undo; c_redo_t *r = &el->el_chared.c_redo; uint size; int size; /* Save entire line for undo */ size = el->el_line.lastchar - el->el_line.buffer; vu->len = size; vu->cursor = el->el_line.cursor - el->el_line.buffer; memcpy(vu->buf, el->el_line.buffer, size); memcpy(vu->buf, el->el_line.buffer, (size_t)size); /* save command info for redo */ r->count = el->el_state.doingarg ? el->el_state.argument : 0; Loading
mysql-test/r/subselect.result +6 −0 Original line number Diff line number Diff line Loading @@ -2837,3 +2837,9 @@ WHERE select_id = 0 OR select_id = 1); values_id 1 DROP TABLE t1, t2; create table t1 (fld enum('0','1')); insert into t1 values ('1'); select * from (select max(fld) from t1) as foo; max(fld) 1 drop table t1;
mysql-test/r/view.result +27 −0 Original line number Diff line number Diff line Loading @@ -1923,6 +1923,14 @@ ERROR HY000: Field of view 'test.v2' underlying table doesn't have a default val set sql_mode=default; drop view v2,v1; drop table t1; create table t1 (f1 int); insert into t1 values (1); create view v1 as select f1 from t1; select f1 as alias from v1; alias 1 drop view v1; drop table t1; CREATE TABLE t1 (s1 int, s2 int); INSERT INTO t1 VALUES (1,2); CREATE VIEW v1 AS SELECT s2 AS s1, s1 AS s2 FROM t1; Loading @@ -1937,6 +1945,25 @@ ALTER VIEW v1 AS SELECT s1 AS s1, s2 AS s2 FROM t1; CALL p1(); s1 s2 1 2 DROP VIEW v1; CREATE VIEW v1 AS SELECT s2 AS s1, s1 AS s2 FROM t1; CALL p1(); s1 s2 2 1 DROP PROCEDURE p1; DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (f1 char) ENGINE = innodb; INSERT INTO t1 VALUES ('A'); CREATE VIEW v1 AS SELECT * FROM t1; INSERT INTO t1 VALUES('B'); SELECT * FROM v1; f1 A B SELECT * FROM t1; f1 A B DROP VIEW v1; DROP TABLE t1;
mysql-test/t/subselect.test +8 −0 Original line number Diff line number Diff line Loading @@ -1859,3 +1859,11 @@ WHERE values_id IN (SELECT values_id FROM t2 WHERE select_id = 0 OR select_id = 1); DROP TABLE t1, t2; # BUG#11821 : Select from subselect using aggregate function on an enum # segfaults: create table t1 (fld enum('0','1')); insert into t1 values ('1'); select * from (select max(fld) from t1) as foo; drop table t1;
mysql-test/t/view.test +28 −0 Original line number Diff line number Diff line Loading @@ -1762,6 +1762,16 @@ set sql_mode=default; drop view v2,v1; drop table t1; # # Bug#11399 Use an alias in a select statement on a view # create table t1 (f1 int); insert into t1 values (1); create view v1 as select f1 from t1; select f1 as alias from v1; drop view v1; drop table t1; # # Test for bug #6120: SP cache to be invalidated when altering a view # Loading @@ -1774,7 +1784,25 @@ CREATE PROCEDURE p1 () SELECT * FROM v1; CALL p1(); ALTER VIEW v1 AS SELECT s1 AS s1, s2 AS s2 FROM t1; CALL p1(); DROP VIEW v1; CREATE VIEW v1 AS SELECT s2 AS s1, s1 AS s2 FROM t1; CALL p1(); DROP PROCEDURE p1; DROP VIEW v1; DROP TABLE t1; # # Test for bug #11771: wrong query_id in SELECT * FROM <view> # CREATE TABLE t1 (f1 char) ENGINE = innodb; INSERT INTO t1 VALUES ('A'); CREATE VIEW v1 AS SELECT * FROM t1; INSERT INTO t1 VALUES('B'); SELECT * FROM v1; SELECT * FROM t1; DROP VIEW v1; DROP TABLE t1;