anjuta/anjuta-symboldb-fix.patch
OBS User autobuild bea5542513 Accepting request 22550 from GNOME:Factory
Copy from GNOME:Factory/anjuta based on submit request 22550 from user dimstar

OBS-URL: https://build.opensuse.org/request/show/22550
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/anjuta?expand=0&rev=36
2009-10-20 21:43:19 +00:00

270 lines
6.4 KiB
Diff

From f8dc87e60d076f23b23609375747fe77af65ce3d Mon Sep 17 00:00:00 2001
From: Massimo Corà <mcora@src.gnome.org>
Date: Tue, 06 Oct 2009 17:04:06 +0000
Subject: symbol-db: fix #597113
The crash was probably due to #588485. Improved code.
---
diff --git a/plugins/symbol-db/symbol-db-engine-core.c b/plugins/symbol-db/symbol-db-engine-core.c
index 645a409..1541dfe 100644
--- a/plugins/symbol-db/symbol-db-engine-core.c
+++ b/plugins/symbol-db/symbol-db-engine-core.c
@@ -765,15 +765,16 @@ sdb_engine_get_tuple_id_by_unique_name (SymbolDBEngine * dbe, static_query_type
}
ret_value = gda_holder_take_static_value (param, param_value, &ret_bool, NULL);
- if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ if (ret_value != NULL)
{
- if (ret_value != NULL)
- MP_RETURN_OBJ_STR(priv, ret_value);
- }
- else
- {
- if (ret_value != NULL)
- MP_RETURN_OBJ_INT(priv, ret_value);
+ if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ {
+ MP_RETURN_OBJ_STR(priv, ret_value);
+ }
+ else
+ {
+ MP_RETURN_OBJ_INT(priv, ret_value);
+ }
}
/* execute the query with parametes just set */
@@ -845,16 +846,17 @@ sdb_engine_get_tuple_id_by_unique_name2 (SymbolDBEngine * dbe,
}
ret_value = gda_holder_take_static_value (param, value1, &ret_bool, NULL);
- if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ if (ret_value != NULL)
{
- if (ret_value != NULL)
+ if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ {
MP_RETURN_OBJ_STR(priv, ret_value);
+ }
+ else
+ {
+ MP_RETURN_OBJ_INT(priv, ret_value);
+ }
}
- else
- {
- if (ret_value != NULL)
- MP_RETURN_OBJ_INT(priv, ret_value);
- }
/* ...and the second one */
@@ -867,16 +869,17 @@ sdb_engine_get_tuple_id_by_unique_name2 (SymbolDBEngine * dbe,
}
ret_value = gda_holder_take_static_value (param, value2, &ret_bool, NULL);
- if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ if (ret_value != NULL)
{
- if (ret_value != NULL)
+ if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ {
MP_RETURN_OBJ_STR(priv, ret_value);
+ }
+ else
+ {
+ MP_RETURN_OBJ_INT(priv, ret_value);
+ }
}
- else
- {
- if (ret_value != NULL)
- MP_RETURN_OBJ_INT(priv, ret_value);
- }
/* execute the query with parametes just set */
data_model = gda_connection_statement_execute_select (priv->db_connection,
@@ -940,16 +943,17 @@ sdb_engine_get_tuple_id_by_unique_name3 (SymbolDBEngine * dbe,
}
ret_value = gda_holder_take_static_value (param, value1, &ret_bool, NULL);
- if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ if (ret_value != NULL)
{
- if (ret_value != NULL)
+ if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ {
MP_RETURN_OBJ_STR(priv, ret_value);
+ }
+ else
+ {
+ MP_RETURN_OBJ_INT(priv, ret_value);
+ }
}
- else
- {
- if (ret_value != NULL)
- MP_RETURN_OBJ_INT(priv, ret_value);
- }
/* ...and the second one */
@@ -962,16 +966,17 @@ sdb_engine_get_tuple_id_by_unique_name3 (SymbolDBEngine * dbe,
}
ret_value = gda_holder_take_static_value (param, value2, &ret_bool, NULL);
- if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ if (ret_value != NULL)
{
- if (ret_value != NULL)
+ if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ {
MP_RETURN_OBJ_STR(priv, ret_value);
+ }
+ else
+ {
+ MP_RETURN_OBJ_INT(priv, ret_value);
+ }
}
- else
- {
- if (ret_value != NULL)
- MP_RETURN_OBJ_INT(priv, ret_value);
- }
/* ...and the third one */
@@ -984,16 +989,17 @@ sdb_engine_get_tuple_id_by_unique_name3 (SymbolDBEngine * dbe,
}
ret_value = gda_holder_take_static_value (param, value3, &ret_bool, NULL);
- if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ if (ret_value != NULL)
{
- if (ret_value != NULL)
+ if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ {
MP_RETURN_OBJ_STR(priv, ret_value);
+ }
+ else
+ {
+ MP_RETURN_OBJ_INT(priv, ret_value);
+ }
}
- else
- {
- if (ret_value != NULL)
- MP_RETURN_OBJ_INT(priv, ret_value);
- }
/* execute the query with parametes just set */
@@ -1059,18 +1065,17 @@ sdb_engine_get_tuple_id_by_unique_name4 (SymbolDBEngine * dbe,
}
ret_value = gda_holder_take_static_value (param, value1, &ret_bool, NULL);
- if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ if (ret_value != NULL)
{
- if (ret_value != NULL)
+ if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ {
MP_RETURN_OBJ_STR(priv, ret_value);
+ }
+ else
+ {
+ MP_RETURN_OBJ_INT(priv, ret_value);
+ }
}
- else
- {
- if (ret_value != NULL)
- MP_RETURN_OBJ_INT(priv, ret_value);
- }
-
-
/* ...and the second one */
if ((param = gda_set_get_holder ((GdaSet*)plist, param_key2)) == NULL)
@@ -1081,17 +1086,17 @@ sdb_engine_get_tuple_id_by_unique_name4 (SymbolDBEngine * dbe,
}
ret_value = gda_holder_take_static_value (param, value2, &ret_bool, NULL);
- if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ if (ret_value != NULL)
{
- if (ret_value != NULL)
+ if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ {
MP_RETURN_OBJ_STR(priv, ret_value);
+ }
+ else
+ {
+ MP_RETURN_OBJ_INT(priv, ret_value);
+ }
}
- else
- {
- if (ret_value != NULL)
- MP_RETURN_OBJ_INT(priv, ret_value);
- }
-
/* ...and the third one */
if ((param = gda_set_get_holder ((GdaSet*)plist, param_key3)) == NULL)
@@ -1102,17 +1107,17 @@ sdb_engine_get_tuple_id_by_unique_name4 (SymbolDBEngine * dbe,
}
ret_value = gda_holder_take_static_value (param, value3, &ret_bool, NULL);
- if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ if (ret_value != NULL)
{
- if (ret_value != NULL)
+ if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ {
MP_RETURN_OBJ_STR(priv, ret_value);
+ }
+ else
+ {
+ MP_RETURN_OBJ_INT(priv, ret_value);
+ }
}
- else
- {
- if (ret_value != NULL)
- MP_RETURN_OBJ_INT(priv, ret_value);
- }
-
/* ...and the fourth one */
if ((param = gda_set_get_holder ((GdaSet*)plist, param_key4)) == NULL)
@@ -1123,17 +1128,17 @@ sdb_engine_get_tuple_id_by_unique_name4 (SymbolDBEngine * dbe,
}
ret_value = gda_holder_take_static_value (param, value4, &ret_bool, NULL);
- if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ if (ret_value != NULL)
{
- if (ret_value != NULL)
+ if (G_VALUE_HOLDS_STRING (ret_value) == TRUE)
+ {
MP_RETURN_OBJ_STR(priv, ret_value);
+ }
+ else
+ {
+ MP_RETURN_OBJ_INT(priv, ret_value);
+ }
}
- else
- {
- if (ret_value != NULL)
- MP_RETURN_OBJ_INT(priv, ret_value);
- }
-
/* execute the query with parametes just set */
data_model = gda_connection_statement_execute_select (priv->db_connection,
--
cgit v0.8.2