From 822c4514614d388ab5bf848d3784418de718e0ee Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 3 Apr 2020 08:47:24 +0100 Subject: [PATCH] Handle current_timestamp() from MariaDB DESCRIBE At some point, MariaDB started outputing 'current_timestamp()' in the default field when DESCRIBE is called on the table. This is a change from 'CURRENT_TIMESTAMP' in mysql and older versions of mariadb. As such, our equality match started to fail and resulting schema dumps produced `current_timestamp()` instead of `\"current_timestamp"` --- lib/DBIx/Class/Schema/Loader/DBI/mysql.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm index 1b8611906..8225c462e 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm @@ -302,7 +302,7 @@ sub _extra_column_info { $extra_info{extra}{list} = $dbi_info->{mysql_values}; } if ((not blessed $dbi_info) # isa $sth - && lc($dbi_info->{COLUMN_DEF}) eq 'current_timestamp' + && lc($dbi_info->{COLUMN_DEF}) =~ m/^current_timestamp/ && lc($dbi_info->{mysql_type_name}) eq 'timestamp') { my $current_timestamp = 'current_timestamp';