[MDEV-22260] Add a comment about potentially missing table options on SHOW CREATE in ORACLE mode Created: 2020-04-16 Updated: 2020-10-15 Resolved: 2020-10-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Minor |
| Reporter: | Hartmut Holzgraefe | Assignee: | Ian Gilfillan |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
With sql_mode=ORACLE being active, SHOW CREATE TABLE does not show MariaDB specific table options like ENGINE, AUTO_INCREMENT, etc. This is fine as such options would not be understood when pasting such a CREATE statement back into an actual Oracle instance, but it is also easy to overlook. So I'd suggest to at least add an SQL comment that hints towards the output being potentially incomplete. Consider e.g. the following table:
With sql_mode=ORACLE this becomes:
I'd suggest adding at least a comment like:
|
| Comments |
| Comment by Alice Sherepa [ 2020-09-17 ] |
|
the same repeatable for sql_mode ANSI, DB2, POSTGRESQL,MSSQL,MAXDB on 5.5-10.5 |
| Comment by Sergei Golubchik [ 2020-09-17 ] |
|
This was the case since at least 2006. In any "non-mysql" (or, say, "foreign" or "emulation") sql mode SHOW CREATE TABLE will omit MariaDB/MySQL specific table attributes. Let's make sure it's documented properly. |
| Comment by Hartmut Holzgraefe [ 2020-09-17 ] |
|
We were not advertising these other modes as prominently as the new ORACLE mode though, and these older modes were really for mysqldump only, while now ORACLE is a mode that will be used on normal operations, and not just for mysqldump. So it is more likely to fool someone running SHOW CREATE interactively now, especially when not remembering that you have set sql_mode=ORACLE for the current session. So I still think adding a comment (or maybe a warning instead?) makes sense here, even if the documentation becomes clearer about this. |
| Comment by Sergei Golubchik [ 2020-09-18 ] |
|
okay, let's use this for the documentation and tackle the comment part in the linked MDEV-23743 |
| Comment by Ian Gilfillan [ 2020-10-15 ] |
|
Documented on https://mariadb.com/kb/en/sql_modeoracle-from-mariadb-103/, https://mariadb.com/kb/en/sql-mode/ and https://mariadb.com/kb/en/show-create-table/ |