From: Rafael Kitover Date: Wed, 19 Oct 2011 20:46:09 +0000 (-0400) Subject: remove placeholders from tab/col comments queries X-Git-Tag: 0.07011~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3bad938aefd5c8724b3a4c54f6d42f4e877bb001;p=dbsrgits%2FDBIx-Class-Schema-Loader.git remove placeholders from tab/col comments queries Changes the use placeholders in ::DBI _table_comment and _column_comment methods to inline $dbh->quote protected values. This is for DBD::Sybase with ASE versions that do not support placeholders and MSSQL connections with a low tds version. At some point we'll have methods for doing queries that do the right thing depending on what the driver/database supports. --- diff --git a/lib/DBIx/Class/Schema/Loader/DBI.pm b/lib/DBIx/Class/Schema/Loader/DBI.pm index baf1372..e242655 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI.pm @@ -326,10 +326,10 @@ sub _table_comment { my $comments_table = $self->table_comments_table; - my ($comment) = try { $self->dbh->selectrow_array(<<"EOF", {}, $table->name) }; + my ($comment) = try { $self->dbh->selectrow_array(<<"EOF") }; SELECT comment_text FROM $comments_table -WHERE table_name = ? +WHERE table_name = @{[ $self->dbh->quote($table->name) ]} EOF return $comment; @@ -340,11 +340,11 @@ sub _column_comment { my $comments_table = $self->column_comments_table; - my ($comment) = try { $self->dbh->selectrow_array(<<"EOF", {}, $table->name, $column_name) }; + my ($comment) = try { $self->dbh->selectrow_array(<<"EOF") }; SELECT comment_text FROM $comments_table -WHERE table_name = ? -AND column_name = ? +WHERE table_name = @{[ $self->dbh->quote($table->name) ]} +AND column_name = @{[ $self->dbh->quote($column_name) ]} EOF return $comment;