[Rt-commit] r5724 - in DBIx-SearchBuilder/trunk: .
SearchBuilder/Handle
ruz at bestpractical.com
ruz at bestpractical.com
Tue Aug 8 20:38:26 EDT 2006
Author: ruz
Date: Tue Aug 8 20:38:26 2006
New Revision: 5724
Modified:
DBIx-SearchBuilder/trunk/ (props changed)
DBIx-SearchBuilder/trunk/SearchBuilder/Handle.pm
DBIx-SearchBuilder/trunk/SearchBuilder/Handle/Pg.pm
Log:
r8660 at cubic-pc: cubic | 2006-08-09 01:31:54 +0400
::Handle::InsertQueryString
* use old style 'INSERT INTO table () VALUES ();' as
mysql doesn't like short 'INSERT INTO table;'
Modified: DBIx-SearchBuilder/trunk/SearchBuilder/Handle.pm
==============================================================================
--- DBIx-SearchBuilder/trunk/SearchBuilder/Handle.pm (original)
+++ DBIx-SearchBuilder/trunk/SearchBuilder/Handle.pm Tue Aug 8 20:38:26 2006
@@ -375,8 +375,8 @@
}
my $QueryString = "INSERT INTO $table";
- $QueryString .= " (". join(", ", @cols) .")" if @cols;
- $QueryString .= " VALUES (". join(", ", @vals). ")" if @vals;
+ $QueryString .= " (". join(", ", @cols) .")";
+ $QueryString .= " VALUES (". join(", ", @vals). ")";
return ($QueryString, @bind);
}
Modified: DBIx-SearchBuilder/trunk/SearchBuilder/Handle/Pg.pm
==============================================================================
--- DBIx-SearchBuilder/trunk/SearchBuilder/Handle/Pg.pm (original)
+++ DBIx-SearchBuilder/trunk/SearchBuilder/Handle/Pg.pm Tue Aug 8 20:38:26 2006
@@ -91,7 +91,7 @@
sub InsertQueryString {
my $self = shift;
my ($query_string, @bind) = $self->SUPER::InsertQueryString( @_ );
- $query_string .= ' DEFAULT VALUES' unless $query_string =~ /\bVALUES\s+\(/i;
+ $query_string =~ s/\(\s*\)\s+VALUES\s+\(\s*\)\s*$/DEFAULT VALUES/;
return ($query_string, @bind);
}
More information about the Rt-commit
mailing list