[MCOL-3749] Truncate may cause mysqld to assert during update Created: 2020-01-29  Updated: 2020-11-12  Resolved: 2020-02-11

Status: Closed
Project: MariaDB ColumnStore
Component/s: MDB Plugin
Affects Version/s: 1.4.2
Fix Version/s: 1.4.3, 1.5.1

Type: Bug Priority: Critical
Reporter: David Hall (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
PartOf
is part of MCOL-3594 Failed tests in the 001 suite in 1.4 Closed
Sprint: 2020-1, 2020-2

 Description   

The following query crashes mysqld:
update datatypetestm set cdecimal9=cast(cbigint as decimal(9,2));



 Comments   
Comment by David Hall (Inactive) [ 2020-01-29 ]

During the update, we add warnings that we truncated. During the final my_ok call, we try to set the message to number of mods etc. This causes an assertion that a message is already set.

The problem is that we think we should error on warnings (strict), but we don't. The strict causes the final message to be an error about truncation. Then we try to add the normal update final message – assertion. (Do we actually do the update? Need to look into that.) Also, we don't seem to pay attention to the keyword IGNORE in the query, which causes InnoDB to not error, but issue warnings.

Comment by David Hall (Inactive) [ 2020-01-29 ]

Upon range warning, we set thd->abort_on_warning to true. Theoretically, this was supposed to stop the problem from happening. It doesn't do what we want.

Comment by David Hall (Inactive) [ 2020-01-29 ]

We need to return the error code from doUpdateDelete() which in turn sends it on th handler. Without a return code, handler isn't smart enough to know there was an error.

Comment by David Hall (Inactive) [ 2020-02-07 ]

QA: This only breaks immediately for debug builds. Release builds may or may not ever show symptoms. To test, just attempt to update a char(8) field (longer doesn't break) with a string > 8 bytes.

Comment by Daniel Lee (Inactive) [ 2020-02-07 ]

Build verified: 1.4.3-1 source

server commit 90fb6f56db926337d1dd900a9f87c7db9e37a566
engine commit 5efa6a4dc52129be2de49fdfc23e44020401b86b

Non-debug does not have the issue.
There is no debug build for 1.4.2-1 for reproducing the issue and I am not able to build it from source.
Verified that the issue is not happening in 1.4.3-1 debug build.

Comment by Daniel Lee (Inactive) [ 2020-02-11 ]

Build verified: 1.5.0-1 source

server
commit 57950ded281731263f6aa358d43c7b9d51f3dbfb
engine
commit 46f30be5561f65eec488d61e011b727ca358720b

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