[MCOL-360] Internal error: Un-recognized Arithmetic Operand during query with timestamp Created: 2016-10-14 Updated: 2016-12-15 Resolved: 2016-12-15 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | MariaDB Server |
| Affects Version/s: | 1.0.3 |
| Fix Version/s: | Icebox |
| Type: | Bug | Priority: | Major |
| Reporter: | Kumar Saurav Sonu | Assignee: | Andrew Hutchings (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | community | ||
| Sprint: | 2016-22, 2016-24 |
| Description |
|
Steps to reproduce :- 2)Insert data in table_1 -> insert into table_1 values(1,60); 3)Create another table -> table_2 4)Insert data into table_2 :- insert into table_2 values (1,'2016-10-10 08:00:00','2016-10-10 09:00:00'); 5)Run below query :- This will give ERROR 1815 (HY000): Internal error: Un-recognized Arithmetic Operand. And if i replace tb1.time_slice_size with some hard coded values like 60.It work fine. select tb1.time_slice_size,tb2.id bm_id, tb2.end_timestamp, tb2.start_timestamp FROM table_1 tb1, table_2 tb2 where tb1.id = tb2.id AND '1970-01-01 06:30:00' >= from_unixtime((unix_timestamp(tb2.end_timestamp)-unix_timestamp(tb2.start_timestamp))%60); |
| Comments |
| Comment by David Thompson (Inactive) [ 2016-10-18 ] |
|
The query also works if you use tb2.id so that the column value is coming from the myisam table. Would seem to be a bug / limitation in cross engine queries. |
| Comment by David Thompson (Inactive) [ 2016-11-29 ] |
|
The original query also works if you make table_2 a columnstore table. It's possible that this query is considered spaghetti by the engine because you have a query that needs to be evaluated on a non cs table that needs the cs table values to compute. Cross engine joins are more designed for star schema type joins where a smaller result set is used to hashjoin a larger table. |
| Comment by Andrew Hutchings (Inactive) [ 2016-12-15 ] |
|
When a MyISAM table has 0 or 1 rows in it the MariaDB optimizer does a shortcut called "system" in the explain plan. This is a condition which is not pushed down to ColumnStore (and neither is the table itself) so it sees the LHS of the '%' operand in the query as empty triggering the error. 1. Add another row in the MyISAM table. As long as there are 2 or more rows it will be fine 2. Use InnoDB. I'd recommend this anyway. There are many reasons why joining to MyISAM is probably not a good idea. I'll document this in the KB and then close as won't fix. |
| Comment by Andrew Hutchings (Inactive) [ 2016-12-15 ] |
|
Documented in the notes section: |