X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSQLAHacks%2FMySQL.pm;h=d58e420755ab321fd5d68a121587922a06e9c1c3;hb=534521dac62f6ab58e83a42d4e8e3cb586db464b;hp=cc177f13f46dd5287d96b26bf6ed90c7d3f6e9eb;hpb=b8391c875ed35fd7c5c20aed6dcae724d9366a56;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/SQLAHacks/MySQL.pm b/lib/DBIx/Class/SQLAHacks/MySQL.pm index cc177f1..d58e420 100644 --- a/lib/DBIx/Class/SQLAHacks/MySQL.pm +++ b/lib/DBIx/Class/SQLAHacks/MySQL.pm @@ -1,34 +1,9 @@ package # Hide from PAUSE DBIx::Class::SQLAHacks::MySQL; -use base qw( DBIx::Class::SQLAHacks ); -use Carp::Clan qw/^DBIx::Class|^SQL::Abstract/; +use warnings; +use strict; -# -# MySQL does not understand the standard INSERT INTO $table DEFAULT VALUES -# Adjust SQL here instead -# -sub insert { - my $self = shift; +use base qw( DBIx::Class::SQLMaker::MySQL ); - my $table = $_[0]; - $table = $self->_quote($table); - - if (! $_[1] or (ref $_[1] eq 'HASH' and !keys %{$_[1]} ) ) { - return "INSERT INTO ${table} () VALUES ()" - } - - return $self->SUPER::insert (@_); -} - -# Allow STRAIGHT_JOIN's -sub _generate_join_clause { - my ($self, $join_type) = @_; - - if( $join_type && $join_type =~ /^STRAIGHT\z/i ) { - return ' STRAIGHT_JOIN ' - } - - return $self->SUPER::_generate_join_clause( $join_type ); -} 1;