sql: introduce SHOW CREATE TABLE statement
This patch introduces the SHOW CREATE TABLE statement. This statement can be used to obtain a description of a space in the form of a corresponding CREATE TABLE and CREATE INDEX statements. Closes #8098 @TarantoolBot document Title: SHOW CREATE TABLE statement Statement can be used to obtain a description of a space in the form of a corresponding `CREATE TABLE` and `CREATE INDEX` statements. Result will be in form of set of statements and set of found errors. If errors were not detected, set of the statements should be enough to completely serialize space definition. There is two types of `SHOW CREATE TABLE` statement: 1) Get a description of a single space: ``` SHOW CREATE TABLE table_name; ``` This statement can be used to obtain a description of a space in the form of the corresponding `CREATE TABLE` and `CREATE INDEX` statements. The result will be in the form of a set of statements and a set of found errors. If no errors are found, the set of statements should be sufficient to fully serialize the space definition. Otherwise, it will certainly not be a complete space definition, and a `CREATE TABLE` statement is generally not guaranteed to be syntactically correct. 2) Get descriptions of all available non-system spaces: ``` SHOW CREATE TABLE; ``` This statement returns descriptions for each available non-system space in the form described above.
Showing
- changelogs/unreleased/gh-8098-show-create-table.md 3 additions, 0 deletionschangelogs/unreleased/gh-8098-show-create-table.md
- extra/mkkeywordhash.c 1 addition, 0 deletionsextra/mkkeywordhash.c
- src/box/CMakeLists.txt 1 addition, 0 deletionssrc/box/CMakeLists.txt
- src/box/sql.h 5 additions, 0 deletionssrc/box/sql.h
- src/box/sql/build.c 66 additions, 0 deletionssrc/box/sql/build.c
- src/box/sql/func.c 21 additions, 0 deletionssrc/box/sql/func.c
- src/box/sql/parse.y 10 additions, 1 deletionsrc/box/sql/parse.y
- src/box/sql/show.c 496 additions, 0 deletionssrc/box/sql/show.c
- src/box/sql/sqlInt.h 19 additions, 0 deletionssrc/box/sql/sqlInt.h
- src/box/sql/util.c 22 additions, 0 deletionssrc/box/sql/util.c
- src/box/sql/vdbe.c 15 additions, 0 deletionssrc/box/sql/vdbe.c
- test/sql-luatest/show_create_table_test.lua 521 additions, 0 deletionstest/sql-luatest/show_create_table_test.lua
Loading
Please register or sign in to comment