[MCOL-696] REVERSE may reverse all strings that are the same. Created: 2017-05-02 Updated: 2017-06-07 Resolved: 2017-06-07 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | PrimProc |
| Affects Version/s: | 1.1.0 |
| Fix Version/s: | 1.1.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | David Hall (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The changes made for BLOB re-engineered the string dictionary. It exposed a problem where, with some compilers, std::string buffers are reused with a ref count behind the scenes. This meant that a simple query such as the following ended up reversing more than was intended: MariaDB [tpch1]> select n_name, REVERSE(n_name) from nation;
---------------
--------------- |
| Comments |
| Comment by David Hall (Inactive) [ 2017-05-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The fix is to make a copy of the string into a c-buffer before reversing. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-05-02 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Note for testing: I was only able to reproduce this on CentOS 7. Not on Ubuntu 16.04. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2017-06-07 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build verified: Github source 1.1.0 [root@localhost mariadb-columnstore-server]# git show [root@localhost mariadb-columnstore-engine]# git show Server version: 10.2.6-MariaDB-log Columnstore 1.1.0-1 Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [tpch1c]> select n_name, REVERSE(n_name) from nation;
---------------
--------------- MariaDB [tpch1c]> |