Commit Graph

933 Commits

Author SHA1 Message Date
김선우
910c69aaef Remove unused tcl proc 2024-09-22 08:43:50 -04:00
Pekka Enberg
bd94303377 scripts/merge-pr.py: Manually map Github username to email address
You can get pretty much any old email address out of Github API, so
let's just map the emails manually.
2024-09-22 07:05:08 -04:00
jussisaurio
c738674c5d Merge 'fix: cmp integer/float' from Jean Arhancet
Closes https://github.com/penberg/limbo/issues/339

Reviewed-by: Lauri Virtanen <pere-altea@hotmail.com>

Closes #340
2024-09-21 18:06:04 +03:00
jussisaurio
927d9a67b0 Merge 'Add typeof(X) scalar function' from Lauri Virtanen
See SQLite documentation:
https://www.sqlite.org/lang_corefunc.html#typeof
Relates to issue #144 Scalar function support

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #310
2024-09-21 18:04:02 +03:00
JeanArhancet
41c1708ee7 fix: cmp integer/float 2024-09-21 16:10:42 +02:00
Lauri Virtanen
67573e12e5 Add typeof(X) scalar function 2024-09-21 15:56:29 +03:00
Pekka Enberg
dc0e6f7fcd Merge 'Add support for parenthesized conditions' from Kim Seon Woo
### Motivation
Add support for WHERE parenthesized conditions
- closes #153

Closes #338
2024-09-21 12:27:18 +03:00
김선우
eb55b7379c Fix failing test 2024-09-21 16:12:10 +09:00
김선우
bbd1eea9ae Add support for parenthesized conditions 2024-09-21 16:03:49 +09:00
Pekka Enberg
d4cc5151fb Merge 'github: Fix stale workflow' from Pekka Enberg
Bump operations per run but more importantly turn "ascending" option so
that we process pull requests with smaller IDs first that are more
likely to be stale.

Closes #337
2024-09-21 08:54:07 +03:00
Pekka Enberg
8380c0740b github: Fix stale workflow
Bump operations per run but more importantly turn "ascending" option so
that we process pull requests with smaller IDs first that are more
likely to be stale.
2024-09-21 08:20:42 +03:00
Pekka Enberg
b67640c437 Merge 'core: constraint check uniqueness' from Pere Diaz Bou
```bash
limbo> insert into products values (1, 'asdf', 432);
Runtime error: UNIQUE constraint failed: products.id (19)
```

Closes #336
2024-09-20 13:27:10 +03:00
Pere Diaz Bou
c8e5673f7a core: constraint check uniqueness 2024-09-20 11:45:55 +02:00
Pekka Enberg
c57e971eb3 Merge 'Add support for sqlite_version() scalar function ' from Kim Seon Woo
### sqlite
<img width="792" alt="image" src="https://github.com/user-
attachments/assets/1a9238db-d948-4583-a808-f9adfec7c534">
### limbo
<img width="809" alt="image" src="https://github.com/user-
attachments/assets/ea3e5f7e-bb3e-450d-be34-59ca00128beb">
### Changes
- Add support for `sqlite_version()` function
- Update function's explain message depending on the number of arguments

Closes #335
2024-09-18 13:50:51 +03:00
김선우
f7304a15a6 Fix clippy 2024-09-18 17:59:11 +09:00
김선우
e9ba458514 Add support for sqlite_version 2024-09-18 17:57:51 +09:00
Pekka Enberg
ac6dd71de6 Update CHANGELOG.md 2024-09-18 09:47:05 +03:00
Pekka Enberg
a8b8c1d2c9 Merge 'Fix clippy ' from Kim Seon Woo
### Changes
- Remove clippy warning messages
- Add `#[allow(clippy...)]` in places where it might be better not to
fix
### TODO
recommended changes by `cargo fmt` on my local and github differs on
`sqlite3/src/lib.rs`. Should check for the reason
=> just upgrade the rust toolchain

Closes #329
2024-09-18 09:46:07 +03:00
Pekka Enberg
e364d10d9a Merge 'Implementation of scalar function glob() and GLOB operator' from RJ Barman
Related to #144
- Separates `glob` and `like` regex caches, since the same pattern would
result in a different regex depending on which rules you apply
- Also fixes the value of `constant_mask` when translating LIKE
expressions now that non-constant pattern values are supported.
Note that LIKE and GLOB are almost entirely the same, the only
difference being the matching rules (so in our case, the regex
construction).

Closes #334
2024-09-18 09:44:51 +03:00
Pekka Enberg
8bc467bca8 Update CHANGELOG.md 2024-09-18 09:44:25 +03:00
Pekka Enberg
35032395e7 Merge 'Make LIKE expressions case-insensitive' from RJ Barman
Per the sqlite docs, LIKE is case-insensitive.
> The LIKE operator does a pattern matching comparison. The operand to
the right of the LIKE operator contains the pattern and the left hand
operand contains the string to match against the pattern. A percent
symbol ("%") in the LIKE pattern matches any sequence of zero or more
characters in the string. An underscore ("_") in the LIKE pattern
matches any single character in the string. **Any other character
matches itself or its lower/upper case equivalent (i.e. case-insensitive
matching)**. Important Note: SQLite only understands upper/lower case
for ASCII characters by default. The LIKE operator is case sensitive by
default for unicode characters that are beyond the ASCII range. For
example, the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE.
The ICU extension to SQLite includes an enhanced version of the LIKE
operator that does case folding across all unicode characters.
Note that sqlite does not support case-insensitive comparisons of
unicode characters by default. This PR _does not_ match that behavior
currently. I can change things to not support unicode-case-
insensitivity, but as I understand it, doing so may require disable the
unicode-case feature on the regex crate, and potentially using a
`regex::bytes::Regex`, instead of a `regex::Regex`. (Basically, doing
some stuff that would not match anyone's initial assumptions about how
this would work).

Closes #333
2024-09-18 09:44:00 +03:00
rjhallsted
f6b7a3fba4 Remove duplication of glob and like translation 2024-09-16 16:31:37 -07:00
rjhallsted
338effa0ca Separate glob and like regex caches 2024-09-16 16:22:31 -07:00
rjhallsted
af09f0b7f4 Add testing 2024-09-16 16:18:26 -07:00
rjhallsted
f39dc534a6 add glob execution 2024-09-16 16:12:53 -07:00
rjhallsted
b87b874ed0 WIP commit on glob support 2024-09-16 15:51:32 -07:00
rjhallsted
4aaa0b0989 Make LIKE expressions case-insensitive 2024-09-16 14:43:39 -07:00
김선우
9e2756fabc Nit 2024-09-16 23:07:50 +09:00
김선우
905b34c9a8 Nit 2024-09-16 22:03:53 +09:00
김선우
7f5d9dbb90 Apply fmt 2024-09-16 22:00:36 +09:00
김선우
b68efa32d9 Merge branch 'main' into feature/fix-clippy 2024-09-16 21:58:07 +09:00
Pekka Enberg
19d2d92115 Merge 'test: Switch to bundled SQLite for rusqlite' from Pekka Enberg
We're seeing build errors on Windows so let's see if this fixes it.

Closes #332
2024-09-16 15:03:39 +03:00
Pekka Enberg
2760049a89 test: Ignore failing tests... 2024-09-16 14:43:43 +03:00
Pekka Enberg
f3ce6a91ba test: Switch to bundled SQLite for rusqlite
We're seeing build errors on Windows so let's see if this fixes it.
2024-09-16 14:29:13 +03:00
Pekka Enberg
9bbfdab5fa Revert "Merge 'Add support for sqlite_version() scalar function' from Kim Seon Woo"
This reverts commit e365c12ce0, reversing
changes made to 21bd1a961e. The pull request broke some tests:

```
thread 'main' panicked at core/vdbe/mod.rs:1713:72:
index out of bounds: the len is 3 but the index is 3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    while executing
"exec {*}$command"
    (procedure "evaluate_sql" line 3)
    invoked from within
"evaluate_sql $sqlite_exec $sql"
    (procedure "run_test" line 2)
    invoked from within
"run_test $::sqlite_exec $combined_sql $combined_expected_output"
    (procedure "do_execsql_test" line 5)
    invoked from within
"do_execsql_test sqlite_version {
  SELECT sqlite_version();
} {3.46.1}"
    (file "./testing/scalar-functions.test" line 434)
    invoked from within
"source $testdir/scalar-functions.test"
    (file "./testing/all.test" line 16)
make: *** [Makefile:59: test-compat] Error 1
```
2024-09-16 14:28:18 +03:00
Pekka Enberg
e365c12ce0 Merge 'Add support for sqlite_version() scalar function' from Kim Seon Woo
### sqlite
<img width="792" alt="image" src="https://github.com/user-
attachments/assets/1a9238db-d948-4583-a808-f9adfec7c534">
### limbo
<img width="809" alt="image" src="https://github.com/user-
attachments/assets/ea3e5f7e-bb3e-450d-be34-59ca00128beb">
### Changes
- Add support for `sqlite_version()` function
- Update function's explain message depending on the number of arguments

Closes #331
2024-09-16 14:18:19 +03:00
Pekka Enberg
21bd1a961e Merge 'Fix three issues with LIKE operator (#319)' from Jussi Saurio
Closes #319
1. Allow using a column as the pattern
2. Construct LIKE regexes with `^` and `$` so that eg the string
`'foobar'` does not match the pattern `'fooba'` unless the pattern
specifically has a wildcard
3. Support function expressions as the LIKE pattern

Closes #327
2024-09-16 14:17:48 +03:00
Pekka Enberg
95987f9824 Merge 'Support grouping by a function expression' from Jussi Saurio
Closes #326
2024-09-16 14:17:03 +03:00
김선우
469f345c16 Fix explain message for function depending on the number of args 2024-09-16 18:47:53 +09:00
김선우
6b40acabbc Add support for sqlite_version() scalar function 2024-09-16 18:38:42 +09:00
김선우
f592ed15c1 Add test to verify root and leaf splitting 2024-09-16 16:50:30 +09:00
김선우
2086d0e264 Revert max_iterations 2024-09-16 03:25:49 +09:00
jussisaurio
9f1ce53d18 Merge 'implementation of scalar function sign(X)' from Jean Arhancet
This is related to the issue
https://github.com/penberg/limbo/issues/144. Add the scalar function
`sign(X)`

Closes #328
2024-09-15 16:03:09 +03:00
JeanArhancet
d03a734f21 feat: add sign function 2024-09-15 14:57:01 +02:00
김선우
ff1c38e0bb Rewrite test to use temp dir 2024-09-15 17:31:55 +09:00
김선우
07c4ca9edd Nit 2024-09-15 17:16:33 +09:00
김선우
f08dc9e2c0 Revert sqlite3/src/lib 2024-09-15 16:32:12 +09:00
김선우
28884181be Fix clippy 2024-09-15 16:23:27 +09:00
jussisaurio
3f0162c76c Support grouping by a function expression 2024-09-15 09:58:46 +03:00
jussisaurio
6b8cd02f71 Fix function expressions in like pattern not working 2024-09-15 09:57:54 +03:00