-
Notifications
You must be signed in to change notification settings - Fork 386
Column definition in SQL #2351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
So, should we default s2 to value s1? |
I'm sure it would be easier to just make it |
Moving to SQL-standard data support does not require
x. DECIMAL(x,y) and NUMERIC(x,y)
See also: |
There has been a behaviour change. Now the result of the example statements is an assertion: |
I moved this bug to separate issue: #3695 |
@pgulutzan
It is done (but still not hit the trunk - it is on the branch). Now every column must feature type.
Almost all of these types are supported by syntax, but they are mapped onto poor set of available types in Tarantool (in fact, only integer, number, string and scalar for blob).
First example now results in error:
Other two examples are related to issues mentioned above (so obviously now they don't raise an error). Note that query like The rest of notes are irrelevant now, since they are related to not yet implemented types. |
Examples from original issue are invalid now, so I guess we can close this ticket. |
Closing as done. |
Some problems with column definition in SQL.
I can put any words at the end of a column definition; they're ignored.
So I can say ASC|DESC, COLLATE RTRIM, REFERENCES table-name,
ON CONFLICT IGNORE, NOT NULL NULL, INTEGER moonbat, etc.
-- but they all do nothing.
box.sql.execute("CREATE TABLE te13 (s1 INT CHAR NOT NULL NULL, PRIMARY KEY (s1));")
Result = No error
"s1 INT, s2 INT DEFAULT s1" is allowed, but the result
is not that s2 has default = the value in the s1 column,
instead it has default = 's1'. There seems to be a general
rule that single quotes don't matter much.
box.sql.execute("CREATE TABLE te14 (s1 INT PRIMARY KEY, s2 INT DEFAULT s1);")
box.sql.execute("INSERT INTO te14 (s1) VALUES (1);")
box.sql.execute("SELECT s2 FROM te14;")
Result = ['s1']
The text was updated successfully, but these errors were encountered: