[MDEV-20263] sql_mode=ORACLE: BLOB(65535) should not translate to LONGBLOB Created: 2019-08-06 Updated: 2019-08-06 Resolved: 2019-08-06 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types |
| Affects Version/s: | 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.3.18, 10.4.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Oracle database has the following syntax for the BLOB data type:
The default BLOB length is two gigabytes (2,147,483,647). To satisfy the default length of 2Gb, when running with sql_mode=ORACLE, MariaDB translates:
to
But it also translates:
to
The latter looks wrong. When explicit length is specified, it should try to preserve the BLOB data type, corresponding to MYSQL_TYPE_BLOB (which uses 2 bytes per length). This script demonstrates the problem:
The expected output in the last script (with sql_mode=ORACLE) should be:
|