Commit e19c83db authored by Philippe Pebay's avatar Philippe Pebay
Browse files

BUG: Table creation preamble goes immediately after CREATE TABLE.

parent 3f822dad
......@@ -136,7 +136,7 @@ public:
// "CREATE TABLE" SQL statement.
// NB: this method implements the MySQL-specific IF NOT EXISTS syntax,
// used when b = false.
virtual vtkStdString GetTablePreamble( bool b ) { return b ? 0 :" IF NOT EXISTS"; }
virtual vtkStdString GetTablePreamble( bool b ) { return b ? 0 :"IF NOT EXISTS "; }
// Description:
// Return the SQL string with the syntax to create a column inside a
......
......@@ -38,7 +38,7 @@ PURPOSE. See the above copyright notice for more information.
#include <vtksys/SystemTools.hxx>
vtkCxxRevisionMacro(vtkSQLDatabase, "1.27");
vtkCxxRevisionMacro(vtkSQLDatabase, "1.28");
// ----------------------------------------------------------------------
vtkSQLDatabase::vtkSQLDatabase()
......@@ -111,7 +111,7 @@ vtkStdString vtkSQLDatabase::GetColumnSpecification( vtkSQLDatabaseSchema* schem
queryStr += " ";
queryStr += colTypeStr;
}
else // if ( colTypeStr )
else // if ( colTypeStr.size() )
{
vtkGenericWarningMacro( "Unable to get column specification: unsupported data type " << colType );
return vtkStdString();
......@@ -357,8 +357,8 @@ bool vtkSQLDatabase::EffectSchema( vtkSQLDatabaseSchema* schema, bool dropIfExis
{
// Construct the query string for this table
vtkStdString queryStr( "CREATE TABLE " );
queryStr += schema->GetTableNameFromHandle( tblHandle );
queryStr += this->GetTablePreamble( dropIfExists );
queryStr += schema->GetTableNameFromHandle( tblHandle );
queryStr += " (";
// Loop over all columns of the current table
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment