Error codes › 1287
MySQL & MariaDB error 1287 ER_WARN_DEPRECATED_SYNTAX
Example from our test runs:
Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELE (8.0.46) · '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' in (10.6.28) | MySQL | MariaDB | |
|---|---|---|
| Symbol | ER_WARN_DEPRECATED_SYNTAX | ER_WARN_DEPRECATED_SYNTAX |
| SQLSTATE | HY000 | HY000 |
| Type | Server error | Server error |
| Versions | every release since 5.0 active | every release since 5.5 active |
Where this error shows up in our guides
- OUTFILE syntax · SELECT ... INTO OUTFILE '/tmp/...' (original) MariaDB 10.6 10.11
- OUTFILE syntax · SELECT ... INTO OUTFILE in the secure_file_priv directory (modern) MariaDB 10.6 10.11
- OUTFILE syntax · Writing the same OUTFILE twice (expect 1086 file exists) MariaDB 10.6 10.11
- Running totals/determine row position · Row position with @position := @position + 1 (original) MySQL 8.0 8.4 9
- Running totals/determine row position · Running total with @total over derived table (original) MySQL 8.0 8.4 9
- Renumber field values · UPDATE ... SET id = @x:=@x+1 ORDER BY id (original) MySQL 8.0 8.4 9
- Renumber field values · UPDATE ... SET id = @x:=@x+1 ORDER BY name (original) MySQL 8.0 8.4 9
- Counting repetitions in a specific order · Number the runs with @x / @data (original) MySQL 8.0 8.4 9
- Counting repetitions in a specific order · Run length and number of runs via nested derived tables (original) MySQL 8.0 8.4 9
- Minimum privileges to take a backup · GRANT ... IDENTIFIED BY (original) MySQL 5.7
- Update rows reversing column values · Swap via session variables f1=@f1:=f1, f1=@f2:=f2, f2=@f1 (original) MySQL 8.0 8.4 9
- Update table with new id values · UPDATE emp SET empid = @empid := @empid + 1 (original) MySQL 8.0 8.4 9
- OUTFILE example · SELECT ... FROM t1 INTO OUTFILE ... (INTO at the end) MariaDB 10.6 10.11
- INTO OUTFILE and headers · INTO OUTFILE at the end of the whole UNION, sorted with a sort key (modern) MariaDB 10.6 10.11
- Exporting/importing confidential information · ENCODE() to CSV, LOAD DATA with DECODE() (original) MySQL 5.7MariaDB 10.6 10.11
- Update rank on a table · Same UPDATE with the alias renamed to rnk (minimal fix) MySQL 8.0 8.4 9
- Get time difference between successive records · Difference using @diff carried between rows (original) MySQL 8.0 8.4 9
- How to generate a timeline based on duration · Running start/end times with @starttime (original) MySQL 8.0 8.4 9
- How to generate a timeline based on duration · Same with a 5 second gap, variables initialised in a derived table (original) MySQL 8.0 8.4 9
How the message changed between versions
| MySQL from | Symbol | Message |
|---|---|---|
| 5.0.96 | ER_WARN_DEPRECATED_SYNTAX | '%s' is deprecated; use '%s' instead |
| 5.1.77 | ER_WARN_DEPRECATED_SYNTAX | '%s' is deprecated and will be removed in a future release. Please use %s instead |
| MariaDB from | Symbol | Message |
|---|---|---|
| 5.5.68 | ER_WARN_DEPRECATED_SYNTAX | '%s' is deprecated and will be removed in a future release. Please use %s instead |
| 11.5.2 | ER_WARN_DEPRECATED_SYNTAX | '%s' is deprecated and will be removed in a future release. Please use '%s' instead |