Skip to content

Commit 5a47677

Browse files
Add support for JSON column in column_info()
Field storage requirement for JSON column is approximately the same as for a LONGBLOB or LONGTEXT column. It's defined for MySQL database in https://dev.mysql.com/doc/refman/8.4/en/storage-requirements.html#data-types-storage-reqs-json
1 parent 7eb34b7 commit 5a47677

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/DBD/MariaDB.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ sub column_info {
399399
my @type_attr= split / /, $attr||'';
400400

401401
$info->{DATA_TYPE}= SQL_VARCHAR();
402-
if ($basetype =~ /^(char|varchar|\w*text|\w*blob)/)
402+
if ($basetype =~ /^(char|varchar|\w*text|\w*blob|json)/)
403403
{
404404
$info->{DATA_TYPE}= SQL_CHAR() if $basetype eq 'char';
405405
if ($type_params[0])
@@ -411,7 +411,7 @@ sub column_info {
411411
$info->{COLUMN_SIZE} = 65535;
412412
$info->{COLUMN_SIZE} = 255 if $basetype =~ /^tiny/;
413413
$info->{COLUMN_SIZE} = 16777215 if $basetype =~ /^medium/;
414-
$info->{COLUMN_SIZE} = 4294967295 if $basetype =~ /^long/;
414+
$info->{COLUMN_SIZE} = 4294967295 if $basetype =~ /^(long|json)/;
415415
}
416416
}
417417
elsif ($basetype =~ /^(binary|varbinary)/)

0 commit comments

Comments
 (0)