After I did that, accessing the table (say, by doing a mysqldump of its database) causes the server to segfault. If I remove the date_format() calls or the if(), the server doesn't segfault.
Attachments
Issue Links
duplicates
MDEV-24176Server crashes after insert in the table with virtual column generated using date_format() and if()
I have a table containing two date fields, a text field and a varchar(128) field. I did a
alter table event add full_event_name text as (concat(
date_format(event_starts_on, '%Y-%m-%d '),
if(event_starts_on <> event_ends_on, date_format(event_ends_on, 'to %Y-%m-%d '), ''),
event_location_id, ' ',
event_name));
After I did that, accessing the table (say, by doing a mysqldump of its database) causes the server to segfault. If I remove the date_format() calls or the if(), the server doesn't segfault.
I have a table containing two date fields, a text field and a varchar(128) field. I did a
{code:java}
alter table event add full_event_name text as (concat(
date_format(event_starts_on, '%Y-%m-%d '),
if(event_starts_on <> event_ends_on, date_format(event_ends_on, 'to %Y-%m-%d '), ''),
event_location_id, ' ',
event_name));
{code}
After I did that, accessing the table (say, by doing a mysqldump of its database) causes the server to segfault. If I remove the date_format() calls or the if(), the server doesn't segfault.
I'm having trouble reproducing this. Maybe its got some element of the data or FK tables related. Can you include the stack trace and a set of data that can reproduce this?
MariaDB [test]> flush tables;
Query OK, 0 rows affected (0.001 sec)
MariaDB [test]> alter table event add full_event_name text as (concat( date_format(event_starts_on, '%Y-%m-%d '),
| 454 | sunday | 2020-11-08 | 2020-11-08 | 44 | 33 | oh what a day | 42 | somewhere under the rainbow | 2020-11-08 somewhere under the rainbow sunday |
| 455 | stresstime | 2020-11-04 | 2020-11-12 | 44 | 33 | yaya | 42 | somewhere under the bridge | 2020-11-04 to 2020-11-12 somewhere under the bridge stresstime |
dajt, Could you please take a look at MDEV-24176-does it look the same as yours? - I got it, while tried to reproduce this bug, but reported it separately - in case it is different.
Alice Sherepa
added a comment - dajt , Could you please take a look at MDEV-24176 -does it look the same as yours? - I got it, while tried to reproduce this bug, but reported it separately - in case it is different.
@Alice It looks to me like MDEV-24176 is probably the same bug, although I don't think I made any changes to the event table data when I found it. Did you notice that the second "INSERT INTO t1..." would throw an error if it didn't segfault first, because there are now three columns in the table and you only provided two values? But the server segfaults before it gets that far. And if you remove the mysqldump between the first insert and second, it doesn't segfault.
You've got a nice elegant reproducer there. Should we close this ticket and track the bug under MDEV-24176?
Jay Fenlason (Inactive)
added a comment - @Alice It looks to me like MDEV-24176 is probably the same bug, although I don't think I made any changes to the event table data when I found it. Did you notice that the second "INSERT INTO t1..." would throw an error if it didn't segfault first, because there are now three columns in the table and you only provided two values? But the server segfaults before it gets that far. And if you remove the mysqldump between the first insert and second, it doesn't segfault.
You've got a nice elegant reproducer there. Should we close this ticket and track the bug under MDEV-24176 ?
@Jay, Thank you, I am glad to hear it!
Let's track it there, but in case you will get a problem even after the fix of MDEV-24176- please comment here and we will investigate it further.
Alice Sherepa
added a comment - @Jay, Thank you, I am glad to hear it!
Let's track it there, but in case you will get a problem even after the fix of MDEV-24176 - please comment here and we will investigate it further.
for completeness can you include the `show create table event` output before the table was altered.