[MCOL-331] INSERT() function misbehaves with our of range parameters Created: 2016-09-26 Updated: 2016-09-29 Resolved: 2016-09-29 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | PrimProc |
| Affects Version/s: | None |
| Fix Version/s: | 1.0.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Andrew Hutchings (Inactive) | Assignee: | Andrew Hutchings (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 2016-19 | ||||||||
| Description |
|
working_tpch1/qa_fe_cnxFunctions/insert.sql INSERT() is not following the documented behaviour for 'len' and 'pos' out of range. |
| Comments |
| Comment by Andrew Hutchings (Inactive) [ 2016-09-29 ] | |||||||||||||||||||||
|
Emailed to Ben: The thing to look for is: https://mariadb.com/kb/en/mariadb/insert-function/ "Returns the original string if pos is not within the length of the string. Replaces the rest of the string from position pos if len is not within the length of the rest of the string." The two rules there are not working. I've attached a zip with the SQL to test with. The ref log from InnoDB and the log from ColumnStore. You can use "diff -u" on the two logs to see where ColumnStore is going wrong. A good example is:
Here you can see pos is not within the length of the string so the original string should be returned which is what InnoDB (the '-') does. But ColumnStore (the '+') is increasing the length of the string instead. I suspect the logic behind this will be in the file utils/funcexp/func_insert.cpp but I haven't looked at this file yet. | |||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2016-09-29 ] | |||||||||||||||||||||
|
Good fix, test already in suite and I tested it against your patch. All good. | |||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2016-09-29 ] | |||||||||||||||||||||
|
Reopening as close didn't ask my why... |