[libgda] DbView: Improving implementation
- From: Pavlo Solntsev <psolntsev src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] DbView: Improving implementation
- Date: Sun, 12 Jul 2020 03:41:04 +0000 (UTC)
commit b095be52d95c2e86454609de9745eeed87c72ada
Author: Pavlo Solntsev <p sun fun gmail com>
Date: Wed Jun 3 22:48:04 2020 -0500
DbView: Improving implementation
* Adding missed unlock operation
* Removing unneeded code
* Rewriting function definition
libgda/gda-db-view.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
---
diff --git a/libgda/gda-db-view.c b/libgda/gda-db-view.c
index 964c7c4cc..0c20d7e69 100644
--- a/libgda/gda-db-view.c
+++ b/libgda/gda-db-view.c
@@ -523,15 +523,11 @@ gda_db_view_create (GdaDdlModifiable *self,
gpointer user_data,
GError **error)
{
- g_return_val_if_fail (self, FALSE);
- g_return_val_if_fail (cnc && gda_connection_is_opened(cnc), FALSE);
- g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
-
- gda_lockable_lock ((GdaLockable*)cnc);
-
GdaServerProvider *provider = NULL;
GdaServerOperation *op = NULL;
+ gda_lockable_lock ((GdaLockable*)cnc);
+
provider = gda_connection_get_provider (cnc);
GdaDbViewPrivate *priv = gda_db_view_get_instance_private (GDA_DB_VIEW (self));
@@ -652,9 +648,6 @@ gda_db_view_drop (GdaDdlModifiable *self,
gpointer user_data,
GError **error)
{
- g_return_val_if_fail (self, FALSE);
- g_return_val_if_fail (cnc && gda_connection_is_opened(cnc), FALSE);
-
gda_lockable_lock ((GdaLockable*)cnc);
GdaServerProvider *provider = NULL;
@@ -673,7 +666,7 @@ gda_db_view_drop (GdaDdlModifiable *self,
goto on_error;
if (!gda_server_operation_set_value_at (op,
- gda_db_base_get_full_name(GDA_DB_BASE(self)),
+ gda_db_base_get_full_name (GDA_DB_BASE (self)),
error,
"/VIEW_DESC_P/VIEW_NAME"))
goto on_error;
@@ -703,8 +696,8 @@ gda_db_view_drop (GdaDdlModifiable *self,
goto on_error;
g_object_unref (op);
- gda_lockable_unlock ((GdaLockable*)cnc);
g_free (action_str);
+ gda_lockable_unlock ((GdaLockable*)cnc);
return TRUE;
@@ -715,8 +708,14 @@ on_error:
return FALSE;
}
-static gboolean gda_db_view_rename (GdaDdlModifiable *old_name, GdaConnection *cnc,
- gpointer new_name, GError **error)
+static gboolean
+gda_db_view_rename (GdaDdlModifiable *old_name,
+ GdaConnection *cnc,
+ gpointer new_name,
+ GError **error)
{
- return TRUE;
+ g_set_error (error, GDA_DDL_MODIFIABLE_ERROR,
+ GDA_DDL_MODIFIABLE_NOT_IMPLEMENTED,
+ _("Operation is not implemented for the used provider"));
+ return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]