[svn:dbi] r14479 - in dbi/branches/sqlengine: . lib/DBI/DBD

[email protected] Wed, 13 Oct 2010 14:51:52 -0700 (PDT)
Newsgroups perl.dbi.changes
Message-ID <[email protected]>
Author: REHSACK
Date: Wed Oct 13 14:51:51 2010
New Revision: 14479

Modified:
   dbi/branches/sqlengine/Changes
   dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm

Log:
Adding new attribute "sql_dialect" to DBI::DBD::SqlEngine to allow users
control used SQL dialect (ANSI, CSV or AnyData), defaults to CSV


Modified: dbi/branches/sqlengine/Changes
==============================================================================
--- dbi/branches/sqlengine/Changes	(original)
+++ dbi/branches/sqlengine/Changes	Wed Oct 13 14:51:51 2010
@@ -11,6 +11,8 @@
   Optimized connect() to remove redundant FETCH of \%attrib values.
   Adding fix to recognize SQL::Statement errors even if instantiated
     with RaiseError=0 (Jens Rehsack)
+  Adding new attribute "sql_dialect" to DBI::DBD::SqlEngine to allow
+    users control used SQL dialect (ANSI, CSV or AnyData), defaults to CSV
 
 =head2 Changes in DBI 1.615 (svn r14438) 21st September 2010
 

Modified: dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm
==============================================================================
--- dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm	(original)
+++ dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm	Wed Oct 13 14:51:51 2010
@@ -317,6 +317,7 @@
                                sql_nano_version           => 1,    # Nano version
                                sql_statement_version      => 1,    # S:S version
                                sql_flags                  => 1,    # flags for SQL::Parser
+                               sql_dialect                => 1,    # dialect for SQL::Parser
                                sql_quoted_identifier_case => 1,    # case for quoted identifiers
                                sql_identifier_case        => 1,    # case for non-quoted identifiers
                                sql_parser_object          => 1,    # SQL::Parser instance
@@ -360,6 +361,8 @@
         $dbh->{sql_identifier_case}        = 2;    # SQL_IC_LOWER
         $dbh->{sql_quoted_identifier_case} = 3;    # SQL_IC_SENSITIVE
 
+	$dbh->{sql_dialect} = "CSV";
+
         $dbh->{sql_init_phase} = $given_phase;
 
         # complete derived attributes, if required
@@ -399,7 +402,7 @@
 {
     my $dbh = $_[0];
     my $parser = {
-                   dialect    => "CSV",
+                   dialect    => $dbh->{sql_dialect} || "CSV",
                    RaiseError => $dbh->FETCH("RaiseError"),
                    PrintError => $dbh->FETCH("PrintError"),
                  };