From: Peter Rabbitson Date: Wed, 2 Sep 2009 11:00:07 +0000 (+0000) Subject: Mysql v3 support (ick) X-Git-Tag: v0.08111~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d3944540917a76cd054d1bf4ed98f2571c077b2d;p=dbsrgits%2FDBIx-Class.git Mysql v3 support (ick) --- diff --git a/lib/DBIx/Class/Storage/DBI/mysql.pm b/lib/DBIx/Class/Storage/DBI/mysql.pm index 6224d53..9fa6d31 100644 --- a/lib/DBIx/Class/Storage/DBI/mysql.pm +++ b/lib/DBIx/Class/Storage/DBI/mysql.pm @@ -33,6 +33,21 @@ sub _dbh_last_insert_id { $dbh->{mysql_insertid}; } +# we need to figure out what mysql version we're running +sub sql_maker { + my $self = shift; + + unless ($self->_sql_maker) { + my $maker = $self->next::method (@_); + + # mysql 3 does not understand a bare JOIN + my $mysql_ver = $self->_get_dbh->get_info(18); + $maker->{_default_jointype} = 'INNER' if $mysql_ver =~ /^3/; + } + + return $self->_sql_maker; +} + sub sqlt_type { return 'MySQL'; }