[MCOL-670] BLOB/TEXT updates truncated Created: 2017-04-19  Updated: 2017-04-21  Resolved: 2017-04-21

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.1.0
Fix Version/s: 1.1.0

Type: Bug Priority: Major
Reporter: Andrew Hutchings (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MCOL-267 TEXT and BLOB data types are not supp... Closed
Sprint: 2017-8

 Description   

PrimProc multi_token reading is breaking when reusing the same token. This causes junk data on a select on a multi-row table using TEXT/BLOB data longer than 8KB. Observed when doing an UPDATE on a constant column. Example:

MariaDB [test]> update b3 set b = repeat('hello world ', 5000);
Query OK, 7 rows affected (47.60 sec)
Rows matched: 0  Changed: 0  Warnings: 0
 
MariaDB [test]> select a, length(b) from b3;
+------+-----------+
| a    | length(b) |
+------+-----------+
|    1 |     60000 |
|    1 |      1192 |
|    1 |         0 |
|    1 |     60000 |
|    1 |     60000 |
|    1 |     60000 |
|    1 |     60000 |
+------+-----------+
7 rows in set (4.56 sec)

(ignore timings, debugger was running)



 Comments   
Comment by Andrew Hutchings (Inactive) [ 2017-04-19 ]

Main cause was due to PrimProc. We get the first block for every dictionary and then get the further blocks for each. Before the patch we only stored the pointer to the first block grab and the subsequent block grab erased this. When running a bulk projectRG on the same token this would cause corruption.
Update using a constant uses a single token so this is why it was observed with this.

Also modified dictionary writing so that updates don't use de-duplication caching for > 8000 bytes.

Comment by Andrew Hutchings (Inactive) [ 2017-04-19 ]

Regression suite pull request as well as develop

Comment by Daniel Lee (Inactive) [ 2017-04-20 ]

Build tested: Github source
[root@localhost mariadb-columnstore-server]# git show
commit 0a6aea3145f55cebffd86fdb6717284a83fbd2b7
Merge: ef372bf d9dbe2f
Author: david hill <david.hill@mariadb.com>
Date: Thu Apr 6 13:56:52 2017 -0500

Merge pull request #42 from mariadb-corporation/MCOL-377

Make audit plugin display columnstore original query in logging

[root@localhost mariadb-columnstore-server]# cd mariadb-columnstore-engine/
[root@localhost mariadb-columnstore-engine]# git show
commit e1a71a56285956ecabc6aa2e2a3a303e0f3e0988
Merge: 57af5d8 785e6c9
Author: dhall-InfiniDB <david.hall@mariadb.com>
Date: Wed Apr 19 16:56:06 2017 -0500

Merge pull request #154 from mariadb-corporation/MCOL-670

MCOL-670 Fix UPDATE with BLOB/TEXT

Update with literal value works now, but updating with another values from another column of the same data type still causing the an error.

[root@localhost tests.textblob.n]# cat text.n.update.column.sql
update text1 t1, text2 t2 set t1.c2=t2.c2;
select 'text1' as tableName, length(c2) from text1;

> ERROR 1815 (HY000) at line 1: Internal error: CAL0002: Update Failed: ExeMgr Error 1000

Comment by Andrew Hutchings (Inactive) [ 2017-04-21 ]

This is an error due to syntax and would fail the same way for all data types. Therefore out-of-scope for this bug. Moved back to test.

Comment by Daniel Lee (Inactive) [ 2017-04-21 ]

Verified:

[root@localhost mariadb-columnstore-server]# git show
commit 0a6aea3145f55cebffd86fdb6717284a83fbd2b7
Merge: ef372bf d9dbe2f
Author: david hill <david.hill@mariadb.com>
Date: Thu Apr 6 13:56:52 2017 -0500

Merge pull request #42 from mariadb-corporation/MCOL-377

Make audit plugin display columnstore original query in logging

[root@localhost mariadb-columnstore-server]# cd mariadb-columnstore-engine/
[root@localhost mariadb-columnstore-engine]# git show
commit f8f045f3a9792584e0b407f99c59483289e82aa1
Merge: e1a71a5 944d764
Author: dhall-InfiniDB <david.hall@mariadb.com>
Date: Thu Apr 20 14:14:50 2017 -0500

Merge pull request #155 from mariadb-corporation/MCOL-673

MCOL-673 Fix I_S/LDI for larger BLOBs

Generated at Thu Feb 08 02:22:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.