Re: [Maria-developers] Review request for MDEV-12325 Unexpected data type and truncation when using CTE

Hello Monty. The patch looks OK for me. I have just one question below: On 8/5/22 7:15 PM, Michael Widenius wrote:
<cut>
Why do you need above changes in select_unit::send_data()? Shouldn't it be enough just to have below changes in select_union_recursive::send_data()?

Hello Monty, On 8/5/22 10:35 PM, Alexander Barkov wrote:
I compiled your patch. The changes to select_unit::send_data() are not needed. We only need to fix select_union_recursive::send_data(). Also, in non-strict mode it should produce warnings on tructation, without aborting SELECT or CREATE..SELECT statements. After some experimenting I came to this patch:
In strict mode it still works fine and cte_recursive.test passes. In non-strict modes it: - now continues the statement (in your original version it aborted the statement on error). - SELECT and CREATE..SELECT produce the same result set, with the same set of warnings. - Issues truncation warnings Please consider applying this version of the patch. Note, a test for non-strict mode is additionally needed. Also, I think the patch should be further extended to handle IGNORE properly: CREATE TABLE t2 IGNORE AS WITH RECURSIVE .. SELECT ..; "Strict mode + IGNORE" should work like non-strict mode. A new test is also needed here. In order to process IGNORE easy, a "bool ignore;" member can be added to the class select_union_recursive and initialized in constructor: - either from a new constructor parameter - or using thd_arg->lex->ignore. Please investigate what is more appropriate. See classes st_copy_info, multi_update, Alter_inplace_info as examples having "ignore" as a member. Greetings.
participants (1)
-
Alexander Barkov