-
-
Notifications
You must be signed in to change notification settings - Fork 540
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
Similar queries return different results with different orderings of the where clause #7048
Comments
It's emulated MySQL. We will look into this Monday. |
I am unable to repro if I change the double quotes to single quotes:
Potentially this is a hell issue with the query terminating at the first double quote? Notice how I had to |
Hi @algotr34. Using dolt stocks> Explain SELECT *,LENGTH(o.act_symbol) FROM ohlcv o WHERE LENGTH(o.act_symbol)<5 AND o.date>"2023-11-01" AND o.act_symbol='ACHR';
+-----------------------------------------------------------------------------------------------------+
| plan |
+-----------------------------------------------------------------------------------------------------+
| Project |
| ├─ columns: [o.date, o.act_symbol, o.open, o.high, o.low, o.close, o.volume, length(o.act_symbol)] |
| └─ Filter |
| ├─ (((length(o.act_symbol) < 5) AND (o.date > '2023-11-01')) AND (o.act_symbol = 'ACHR')) |
| └─ TableAlias(o) |
| └─ IndexedTableAccess(ohlcv) |
| ├─ index: [ohlcv.date,ohlcv.act_symbol] |
| ├─ filters: [{(2023-11-01, ∞), [ACHR, ACHR]}] |
| └─ columns: [date act_symbol open high low close volume] |
+-----------------------------------------------------------------------------------------------------+
9 rows in set (0.00 sec)
stocks> SELECT *,LENGTH(act_symbol) FROM ohlcv WHERE date>"2023-11-01" AND act_symbol='ACHR' AND LENGTH(act_symbol)<5;
+------------+------------+------+------+------+-------+---------+--------------------+
| date | act_symbol | open | high | low | close | volume | LENGTH(act_symbol) |
+------------+------------+------+------+------+-------+---------+--------------------+
| 2023-11-02 | ACHR | 4.93 | 5.20 | 4.88 | 5.13 | 6424569 | 4 |
| 2023-11-03 | ACHR | 5.20 | 5.50 | 5.20 | 5.47 | 4632925 | 4 |
| 2023-11-06 | ACHR | 5.52 | 5.61 | 5.23 | 5.35 | 4554518 | 4 |
| 2023-11-07 | ACHR | 5.32 | 5.49 | 5.21 | 5.36 | 3422180 | 4 |
| 2023-11-08 | ACHR | 5.36 | 5.51 | 5.20 | 5.21 | 4770496 | 4 |
| 2023-11-09 | ACHR | 5.27 | 5.40 | 5.12 | 5.26 | 6423177 | 4 |
| 2023-11-10 | ACHR | 5.11 | 5.29 | 4.78 | 4.97 | 6779428 | 4 |
| 2023-11-13 | ACHR | 4.99 | 5.20 | 4.88 | 5.20 | 6193570 | 4 |
| 2023-11-14 | ACHR | 5.48 | 5.99 | 5.48 | 5.98 | 9265805 | 4 |
| 2023-11-15 | ACHR | 6.10 | 6.58 | 6.03 | 6.45 | 9699982 | 4 |
| 2023-11-16 | ACHR | 6.39 | 6.41 | 6.10 | 6.26 | 7903983 | 4 |
| 2023-11-17 | ACHR | 6.37 | 6.44 | 6.17 | 6.32 | 5141332 | 4 |
| 2023-11-20 | ACHR | 6.44 | 6.65 | 6.13 | 6.24 | 6745410 | 4 |
| 2023-11-21 | ACHR | 6.15 | 6.22 | 5.83 | 5.90 | 6232083 | 4 |
| 2023-11-22 | ACHR | 5.96 | 6.09 | 5.86 | 6.02 | 3017880 | 4 |
| 2023-11-24 | ACHR | 5.86 | 6.34 | 5.85 | 6.12 | 2910114 | 4 |
+------------+------------+------+------+------+-------+---------+--------------------+
16 rows in set (0.18 sec) I do see timeouts in the DoltHub UI, but all of the plans are the same and LIMIT 1 returns results for all. I am asking the DoltHub team to gather more info about this. Is there a specific version of Dolt/specific database commit that you see correctness issues? Or are the DoltHub timeouts the issue? |
I still get a different behavior between the queries. INFODolt version 1.24.2 QUERIES
EXPLAIN QUERIES
|
@algotr34 I can repro your observations with |
I checked again with dolt version 1.28.2 and it seems to be fixed. |
Great. Keep any bugs you find coming. |
Is dolt running mysql or just an emulated mysql? because I get strange behavior from dolt sometimes, on very simple queries.
I am running these sample queries against the database at https://www.dolthub.com/repositories/post-no-preference/stocks
The test queries are:
Please notice that these 4 queries are actually the same query. And they all should return data!
Now, when I run these queries through dbeaver (after loading the server by running: dolt sql-server), i get the following results:
Wtf?
When i try dolt sql -q "(query)", even the first query is getting stuck, and eventually returns no data.
Huh?
I'm guessing that its not a mysql bug... but you will be able to tell me...
The text was updated successfully, but these errors were encountered: