You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WL#10358: Implement table value constructors: VALUES
Implement the standard syntax for table value constructors (TVC).
The SQL standard lets us use VALUES syntax, i.e. TVC, wherever a SELECT
query specification may be used. This allows for statements such as
VALUES (1, 'one'), (2, 'two'), which previously only could be emulated
with UNIONS.
Note: The current MySQL server has a conflicting non-standard feature:
the VALUES() function of ON DUPLICATE KEY UPDATE update expressions,
which is a showstopper for the standard TVC syntax. However, the
standard also accepts a verbose form of TVC: VALUES ROW(), ROW() ..,
which is used instead.
Also extend <query specification> to allow an <explicit table> clause as
valid syntax. The syntax TABLE <table name> is equivalent to SELECT *
FROM <table name>.
The special syntax for INSERT statements, INSERT .. VALUES, remains as-is.
In addition, INSERT statements with VALUES that use the new verbose syntax
are rewritten to follow the same execution path as the old syntax.
Reviewed by: Roy Lyseng <roy.lyseng@oracle.com>
Copy file name to clipboardExpand all lines: mysql-test/suite/funcs_1/r/storedproc.result
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5605,7 +5605,7 @@ CREATE PROCEDURE sp1()
5605
5605
table:BEGIN
5606
5606
SELECT @x;
5607
5607
END//
5608
-
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table:BEGIN
5608
+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
5609
5609
SELECT @x;
5610
5610
END' at line 2
5611
5611
DROP PROCEDURE IF EXISTS sp1;
@@ -5779,7 +5779,7 @@ CREATE PROCEDURE sp1()
5779
5779
values:BEGIN
5780
5780
SELECT @x;
5781
5781
END//
5782
-
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values:BEGIN
5782
+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':BEGIN
Copy file name to clipboardExpand all lines: share/errmsg-utf8.txt
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9203,6 +9203,12 @@ ER_CONSTRAINT_NOT_FOUND
9203
9203
ER_ALTER_CONSTRAINT_ENFORCEMENT_NOT_SUPPORTED
9204
9204
eng "Altering constraint enforcement is not supported for the constraint '%-.192s'. Enforcement state alter is not supported for the PRIMARY, UNIQUE and FOREIGN KEY type constraints."
9205
9205
9206
+
ER_TABLE_VALUE_CONSTRUCTOR_MUST_HAVE_COLUMNS
9207
+
eng "Each row of a VALUES clause must have at least one column, unless when used as source in an INSERT statement."
9208
+
9209
+
ER_TABLE_VALUE_CONSTRUCTOR_CANNOT_HAVE_DEFAULT
9210
+
eng "A VALUES clause cannot use DEFAULT values, unless used as a source in an INSERT statement."
9211
+
9206
9212
#
9207
9213
# End of 8.0 error messages (server-to-client).
9208
9214
# Do NOT add messages intended for the error log above!
0 commit comments