-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge 'Fix MustBeInt opcode semantics' from Vrishabh
In sqlite3 , we can create primary key with only integer column and during insert we can pass any value which can be parsed into integer as shown below. When I tried the same with limbo, it failed. The cause of this was due to MustBeInt opcode behaviour not aligned with sqlite. This PR aims to fix it. Sqlite output ``` SQLite version 3.45.3 sqlite> create table temp (t1 integer, primary key (t1)); sqlite> insert into temp values (1),(2.0),('3'),('4.0'); sqlite> select * from temp; 1 2 3 4 ``` Limbo output main branch ``` limbo> create table temp (t1 integer, primary key (t1)); limbo> insert into temp values (1),(2.0),('3'),('4.0'); Parse error: MustBeInt: the value in the register is not an integer limbo> select * from temp; 1 ``` Limbo output with this PR ``` limbo> create table temp (t1 integer, primary key (t1)); limbo> insert into temp values (1),(2.0),('3'),('4.0'); limbo> select * from temp; 1 2 3 4 ``` Closes #706
- Loading branch information
Showing
2 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters