X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2Fmysql.pm;h=9fa6d31ca5bd428bc7dc85a2e632c2fa42773b68;hb=d3944540917a76cd054d1bf4ed98f2571c077b2d;hp=89624f49891cc2c11ac9db72b6f89592768eb866;hpb=84ccbc01107eeadbbac452d5368b4dd74f12ab8e;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI/mysql.pm b/lib/DBIx/Class/Storage/DBI/mysql.pm index 89624f4..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'; } @@ -81,7 +96,7 @@ DBIx::Class::Storage::DBI::mysql - Storage::DBI class implementing MySQL specifi Storage::DBI autodetects the underlying MySQL database, and re-blesses the C<$storage> object into this class. - my $schema = MyDb::Schema->connect( $dsn, $user, $pass, { set_strict_mode => 1 } ); + my $schema = MyDb::Schema->connect( $dsn, $user, $pass, { on_connect_call => 'set_strict_mode' } ); =head1 DESCRIPTION