[glom/mysql2] MySQL: Fixes for column renaming



commit a41839aa87407583153ee8907e8cde058fcd7457
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jan 11 12:26:33 2013 +0100

    MySQL: Fixes for column renaming

 glom/libglom/connectionpool_backends/mysql.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glom/libglom/connectionpool_backends/mysql.cc b/glom/libglom/connectionpool_backends/mysql.cc
index 49b69ef..6f162d6 100644
--- a/glom/libglom/connectionpool_backends/mysql.cc
+++ b/glom/libglom/connectionpool_backends/mysql.cc
@@ -310,7 +310,7 @@ bool MySQL::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connectio
 		    drop_column(connection, table_name, old_fields[i]->get_name());
 
                     //This part is different compared to PostgreSQL:
-		    connection->statement_execute_non_select("ALTER TABLE " + DbUtils::escape_sql_id(table_name) + " CHANGE " + DbUtils::escape_sql_id(TEMP_COLUMN_NAME) + DbUtils::escape_sql_id(new_fields[i]->get_name()) + new_fields[i]->get_sql_type());
+		    connection->statement_execute_non_select("ALTER TABLE " + DbUtils::escape_sql_id(table_name) + " CHANGE " + DbUtils::escape_sql_id(TEMP_COLUMN_NAME) + " " + DbUtils::escape_sql_id(new_fields[i]->get_name()) + " " + new_fields[i]->get_sql_type());
 
 		    // Read primary key constraint
 		    if(new_fields[i]->get_primary_key())
@@ -378,7 +378,7 @@ bool MySQL::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connectio
 		    if(old_fields[i]->get_name() != new_fields[i]->get_name())
 		    {
                       //This part is different compared to PostgreSQL
-		      connection->statement_execute_non_select("ALTER TABLE " + DbUtils::escape_sql_id(table_name) + " CHANGE " + DbUtils::escape_sql_id(old_fields[i]->get_name()) + DbUtils::escape_sql_id(new_fields[i]->get_name()) + new_fields[i]->get_sql_type());
+		      connection->statement_execute_non_select("ALTER TABLE " + DbUtils::escape_sql_id(table_name) + " CHANGE " + DbUtils::escape_sql_id(old_fields[i]->get_name()) + " " + DbUtils::escape_sql_id(new_fields[i]->get_name()) + " " + new_fields[i]->get_sql_type());
 		    }
 		  }
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]