Permalink
Browse files

Set the same database as meta store. Refs gh-144

  • Loading branch information...
1 parent bbc6f57 commit e1895fdeb535e4ba90f2c134ffc23189129a3713 @piotras piotras committed Mar 7, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −3 src/midgard_connection.c
  2. +0 −2 src/midgard_core_query.c
View
@@ -405,8 +405,7 @@ __mysql_reconnect (MidgardConnection *mgd)
opened = gda_connection_open (mgd->priv->connection, NULL);
- if (opened) {
-
+ if (opened) {
g_signal_emit (mgd, MIDGARD_CONNECTION_GET_CLASS (mgd)->signal_id_connected, 0);
g_debug ("Successfully reopened connection");
return TRUE;
@@ -565,7 +564,6 @@ __midgard_connection_open(MidgardConnection *mgd, gboolean init_schema, GError *
g_free(auth);
if(connection == NULL) {
-
MIDGARD_ERRNO_SET_STRING (mgd, MGD_ERR_NOT_CONNECTED,
" Database [%s]. %s", tmpstr, err->message);
if (err) {
@@ -585,6 +583,12 @@ __midgard_connection_open(MidgardConnection *mgd, gboolean init_schema, GError *
mgd->priv->parser = gda_sql_parser_new();
g_assert (mgd->priv->parser != NULL);
+ /* Set the same database as meta store */
+ GdaMetaStore *store;
+ store = GDA_META_STORE (g_object_new (GDA_TYPE_META_STORE, "cnc", connection, NULL));
+ g_object_set (G_OBJECT (connection), "meta-store", store, NULL);
+ g_object_unref (store);
+
mgd->priv->connection = connection;
midgard_core_connection_connect_error_callback (mgd);
View
@@ -1068,8 +1068,6 @@ gboolean __table_exists(MidgardConnection *mgd, const gchar *tablename)
mcontext.column_values = g_new (GValue *, 1);
g_value_set_string ((mcontext.column_values[0] = gda_value_new (G_TYPE_STRING)), tablename);
GError *error = NULL;
-
- _update_gda_meta_store_table (mgd->priv->connection, tablename, NULL);
GdaDataModel *dm_schema =
gda_connection_get_meta_store_data (mgd->priv->connection,

0 comments on commit e1895fd

Please sign in to comment.