[libgda/LIBGDA_4.0] Added the new index information fetching to all the providers
- From: Vivien Malerba <vivien src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [libgda/LIBGDA_4.0] Added the new index information fetching to all the providers
- Date: Sat, 30 Jan 2010 15:20:57 +0000 (UTC)
commit f843eddaa7986954c60532da17d606b0e77fe31b
Author: Vivien Malerba <malerba gnome-db org>
Date: Sat Jan 30 16:19:35 2010 +0100
Added the new index information fetching to all the providers
real implementation needs to be added to each one
libgda/gda-meta-store.c | 2 +-
libgda/sqlite/gda-sqlite-meta.c | 36 ++++++++++++++++++
libgda/sqlite/gda-sqlite-meta.h | 15 +++++++
libgda/sqlite/gda-sqlite-provider.c | 4 ++
providers/jdbc/gda-jdbc-meta.c | 40 +++++++++++++++++++-
providers/jdbc/gda-jdbc-meta.h | 14 +++++++
providers/jdbc/gda-jdbc-provider.c | 6 ++-
providers/mysql/gda-mysql-meta.c | 37 ++++++++++++++++++
providers/mysql/gda-mysql-meta.h | 15 +++++++
providers/mysql/gda-mysql-provider.c | 5 ++-
providers/postgres/gda-postgres-meta.c | 10 +++--
providers/skel-implementation/capi/gda-capi-meta.c | 38 ++++++++++++++++++-
providers/skel-implementation/capi/gda-capi-meta.h | 16 +++++++-
.../skel-implementation/capi/gda-capi-provider.c | 6 ++-
14 files changed, 232 insertions(+), 12 deletions(-)
---
diff --git a/libgda/gda-meta-store.c b/libgda/gda-meta-store.c
index 947a1e2..cfe8cf9 100644
--- a/libgda/gda-meta-store.c
+++ b/libgda/gda-meta-store.c
@@ -460,7 +460,7 @@ gda_meta_store_class_init (GdaMetaStoreClass *klass)
compute_prepared_stmt (klass->cpriv->parser,
"INSERT INTO _attributes VALUES (##name::string, ##value::string::null)");
-#define GDA_DEBUG_GRAPH
+/*#define GDA_DEBUG_GRAPH*/
#ifdef GDA_DEBUG_GRAPH
#define INFORMATION_SCHEMA_GRAPH_FILE "information_schema.dot"
GString *string;
diff --git a/libgda/sqlite/gda-sqlite-meta.c b/libgda/sqlite/gda-sqlite-meta.c
index 731b20a..cdadb4c 100644
--- a/libgda/sqlite/gda-sqlite-meta.c
+++ b/libgda/sqlite/gda-sqlite-meta.c
@@ -2240,6 +2240,42 @@ _gda_sqlite_meta_routine_par (GdaServerProvider *prov, GdaConnection *cnc,
return TRUE;
}
+gboolean
+_gda_sqlite_meta__indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error)
+{
+ //TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_sqlite_meta_indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+ const GValue *index_name_n)
+{
+ //TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_sqlite_meta__index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error)
+{
+ //TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_sqlite_meta_index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema,
+ const GValue *table_name, const GValue *index_name)
+{
+ //TO_IMPLEMENT;
+ return TRUE;
+}
+
/*
* @...: a list of TRUE/FALSE, GValue* -- if TRUE then the following GValue must be freed
*/
diff --git a/libgda/sqlite/gda-sqlite-meta.h b/libgda/sqlite/gda-sqlite-meta.h
index 003f525..7e11ac5 100644
--- a/libgda/sqlite/gda-sqlite-meta.h
+++ b/libgda/sqlite/gda-sqlite-meta.h
@@ -190,6 +190,21 @@ gboolean _gda_sqlite_meta_routine_par (GdaServerProvider *prov, GdaConnecti
const GValue *rout_catalog, const GValue *rout_schema,
const GValue *rout_name);
+/* _table_indexes */
+gboolean _gda_sqlite_meta__indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error);
+gboolean _gda_sqlite_meta_indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+ const GValue *index_name_n);
+
+/* _index_column_usage */
+gboolean _gda_sqlite_meta__index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error);
+gboolean _gda_sqlite_meta_index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema,
+ const GValue *table_name, const GValue *index_name);
G_END_DECLS
diff --git a/libgda/sqlite/gda-sqlite-provider.c b/libgda/sqlite/gda-sqlite-provider.c
index 29518f8..53989f7 100644
--- a/libgda/sqlite/gda-sqlite-provider.c
+++ b/libgda/sqlite/gda-sqlite-provider.c
@@ -407,6 +407,10 @@ gda_sqlite_provider_class_init (GdaSqliteProviderClass *klass)
provider_class->meta_funcs.routine_col = _gda_sqlite_meta_routine_col;
provider_class->meta_funcs._routine_par = _gda_sqlite_meta__routine_par;
provider_class->meta_funcs.routine_par = _gda_sqlite_meta_routine_par;
+ provider_class->meta_funcs._indexes_tab = _gda_sqlite_meta__indexes_tab;
+ provider_class->meta_funcs.indexes_tab = _gda_sqlite_meta_indexes_tab;
+ provider_class->meta_funcs._index_cols = _gda_sqlite_meta__index_cols;
+ provider_class->meta_funcs.index_cols = _gda_sqlite_meta_index_cols;
/* SQLite doe not support distributed transactions */
provider_class->xa_funcs = NULL;
diff --git a/providers/jdbc/gda-jdbc-meta.c b/providers/jdbc/gda-jdbc-meta.c
index 7abce74..7afd081 100644
--- a/providers/jdbc/gda-jdbc-meta.c
+++ b/providers/jdbc/gda-jdbc-meta.c
@@ -1,5 +1,5 @@
/* GDA jdbc provider
- * Copyright (C) 2008 The GNOME Foundation.
+ * Copyright (C) 2008 - 2009 The GNOME Foundation.
*
* AUTHORS:
* Vivien Malerba <malerba gnome-db org>
@@ -144,7 +144,7 @@ _gda_jdbc_meta_udt (GdaServerProvider *prov, GdaConnection *cnc,
GdaMetaStore *store, GdaMetaContext *context, GError **error,
const GValue *udt_catalog, const GValue *udt_schema)
{
- GdaDataModel *model;
+ GdaDataModel *model = NULL;
gboolean retval = TRUE;
TO_IMPLEMENT;
@@ -729,3 +729,39 @@ _gda_jdbc_meta_routine_par (GdaServerProvider *prov, GdaConnection *cnc,
TO_IMPLEMENT;
return TRUE;
}
+
+gboolean
+_gda_mysql_meta__indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error)
+{
+ TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_jdbc_meta_indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+ const GValue *index_name_n)
+{
+ TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_jdbc_meta__index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error)
+{
+ TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_jdbc_meta_index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema,
+ const GValue *table_name, const GValue *index_name)
+{
+ TO_IMPLEMENT;
+ return TRUE;
+}
diff --git a/providers/jdbc/gda-jdbc-meta.h b/providers/jdbc/gda-jdbc-meta.h
index d51a6a4..6487302 100644
--- a/providers/jdbc/gda-jdbc-meta.h
+++ b/providers/jdbc/gda-jdbc-meta.h
@@ -190,7 +190,21 @@ gboolean _gda_jdbc_meta_routine_par (GdaServerProvider *prov, GdaConnection
const GValue *rout_catalog, const GValue *rout_schema,
const GValue *rout_name);
+/* _table_indexes */
+gboolean _gda_jdbc_meta__indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error);
+gboolean _gda_jdbc_meta_indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+ const GValue *index_name_n);
+/* _index_column_usage */
+gboolean _gda_jdbc_meta__index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error);
+gboolean _gda_jdbc_meta_index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema,
+ const GValue *table_name, const GValue *index_name);
G_END_DECLS
#endif
diff --git a/providers/jdbc/gda-jdbc-provider.c b/providers/jdbc/gda-jdbc-provider.c
index a51c99b..64b0460 100644
--- a/providers/jdbc/gda-jdbc-provider.c
+++ b/providers/jdbc/gda-jdbc-provider.c
@@ -1,5 +1,5 @@
/* GDA Jdbc provider
- * Copyright (C) 2008 The GNOME Foundation.
+ * Copyright (C) 2008 - 2009 The GNOME Foundation.
*
* AUTHORS:
* Vivien Malerba <malerba gnome-db org>
@@ -239,6 +239,10 @@ gda_jdbc_provider_class_init (GdaJdbcProviderClass *klass)
provider_class->meta_funcs.routine_col = _gda_jdbc_meta_routine_col;
provider_class->meta_funcs._routine_par = _gda_jdbc_meta__routine_par;
provider_class->meta_funcs.routine_par = _gda_jdbc_meta_routine_par;
+ provider_class->meta_funcs._indexes_tab = _gda_jdbc_meta__indexes_tab;
+ provider_class->meta_funcs.indexes_tab = _gda_jdbc_meta_indexes_tab;
+ provider_class->meta_funcs._index_cols = _gda_jdbc_meta__index_cols;
+ provider_class->meta_funcs.index_cols = _gda_jdbc_meta_index_cols;
/* distributed transactions: if not supported, then provider_class->xa_funcs should be set to NULL */
provider_class->xa_funcs = g_new0 (GdaServerProviderXa, 1);
diff --git a/providers/mysql/gda-mysql-meta.c b/providers/mysql/gda-mysql-meta.c
index fe56682..bf1c695 100644
--- a/providers/mysql/gda-mysql-meta.c
+++ b/providers/mysql/gda-mysql-meta.c
@@ -1651,3 +1651,40 @@ _gda_mysql_meta_routine_par (GdaServerProvider *prov,
//TO_IMPLEMENT;
return TRUE;
}
+
+gboolean
+_gda_mysql_meta__indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error)
+{
+ //TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_mysql_meta_indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+ const GValue *index_name_n)
+{
+ //TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_mysql_meta__index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error)
+{
+ //TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_mysql_meta_index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema,
+ const GValue *table_name, const GValue *index_name)
+{
+ //TO_IMPLEMENT;
+ return TRUE;
+}
+
diff --git a/providers/mysql/gda-mysql-meta.h b/providers/mysql/gda-mysql-meta.h
index b9e78a1..e6cfd86 100644
--- a/providers/mysql/gda-mysql-meta.h
+++ b/providers/mysql/gda-mysql-meta.h
@@ -383,6 +383,21 @@ _gda_mysql_meta_routine_par (GdaServerProvider *prov,
const GValue *rout_schema,
const GValue *rout_name);
+/* _table_indexes */
+gboolean _gda_mysql_meta__indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error);
+gboolean _gda_mysql_meta_indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+ const GValue *index_name_n);
+
+/* _index_column_usage */
+gboolean _gda_mysql_meta__index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error);
+gboolean _gda_mysql_meta_index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema,
+ const GValue *table_name, const GValue *index_name);
G_END_DECLS
diff --git a/providers/mysql/gda-mysql-provider.c b/providers/mysql/gda-mysql-provider.c
index 668dd3b..a1ae13b 100644
--- a/providers/mysql/gda-mysql-provider.c
+++ b/providers/mysql/gda-mysql-provider.c
@@ -330,7 +330,10 @@ gda_mysql_provider_class_init (GdaMysqlProviderClass *klass)
provider_class->meta_funcs.routine_col = _gda_mysql_meta_routine_col;
provider_class->meta_funcs._routine_par = _gda_mysql_meta__routine_par;
provider_class->meta_funcs.routine_par = _gda_mysql_meta_routine_par;
-
+ provider_class->meta_funcs._indexes_tab = _gda_mysql_meta__indexes_tab;
+ provider_class->meta_funcs.indexes_tab = _gda_mysql_meta_indexes_tab;
+ provider_class->meta_funcs._index_cols = _gda_mysql_meta__index_cols;
+ provider_class->meta_funcs.index_cols = _gda_mysql_meta_index_cols;
/* distributed transactions: if not supported, then provider_class->xa_funcs should be set to NULL */
provider_class->xa_funcs = g_new0 (GdaServerProviderXa, 1);
diff --git a/providers/postgres/gda-postgres-meta.c b/providers/postgres/gda-postgres-meta.c
index 9db3b47..7cab6da 100644
--- a/providers/postgres/gda-postgres-meta.c
+++ b/providers/postgres/gda-postgres-meta.c
@@ -374,8 +374,8 @@ _gda_postgres_meta__btypes (GdaServerProvider *prov, GdaConnection *cnc,
retval = FALSE;
break;
}
-
- type = _gda_postgres_type_oid_to_gda (cdata, g_value_get_int64 (value));
+ guint oid = (guint) g_ascii_strtoull (g_value_get_string (value), NULL, 10);
+ type = _gda_postgres_type_oid_to_gda (cdata, oid);
if (type != G_TYPE_STRING) {
GValue *v;
g_value_set_string (v = gda_value_new (G_TYPE_STRING), g_type_name (type));
@@ -1038,7 +1038,8 @@ gboolean _gda_postgres_meta__columns (GdaServerProvider *prov, GdaConnection *cn
break;
}
- type = _gda_postgres_type_oid_to_gda (cdata, g_value_get_int64 (value));
+ guint oid = (guint) g_ascii_strtoull (g_value_get_string (value), NULL, 10);
+ type = _gda_postgres_type_oid_to_gda (cdata, oid);
if (type != G_TYPE_STRING) {
GValue *v;
g_value_set_string (v = gda_value_new (G_TYPE_STRING), g_type_name (type));
@@ -1143,7 +1144,8 @@ _gda_postgres_meta_columns (GdaServerProvider *prov, GdaConnection *cnc,
break;
}
- type = _gda_postgres_type_oid_to_gda (cdata, g_value_get_int64 (value));
+ guint oid = (guint) g_ascii_strtoull (g_value_get_string (value), NULL, 10);
+ type = _gda_postgres_type_oid_to_gda (cdata, oid);
if (type != G_TYPE_STRING) {
GValue *v;
g_value_set_string (v = gda_value_new (G_TYPE_STRING), g_type_name (type));
diff --git a/providers/skel-implementation/capi/gda-capi-meta.c b/providers/skel-implementation/capi/gda-capi-meta.c
index ec70d31..3c6dffc 100644
--- a/providers/skel-implementation/capi/gda-capi-meta.c
+++ b/providers/skel-implementation/capi/gda-capi-meta.c
@@ -1,5 +1,5 @@
/* GDA capi provider
- * Copyright (C) 2008 The GNOME Foundation.
+ * Copyright (C) 2008 - 2009 The GNOME Foundation.
*
* AUTHORS:
* TO_ADD: your name and email
@@ -489,3 +489,39 @@ _gda_capi_meta_routine_par (GdaServerProvider *prov, GdaConnection *cnc,
TO_IMPLEMENT;
return TRUE;
}
+
+gboolean
+_gda_capi_meta__indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error)
+{
+ TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_capi_meta_indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+ const GValue *index_name_n)
+{
+ TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_capi_meta__index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error)
+{
+ TO_IMPLEMENT;
+ return TRUE;
+}
+
+gboolean
+_gda_capi_meta_index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema,
+ const GValue *table_name, const GValue *index_name)
+{
+ TO_IMPLEMENT;
+ return TRUE;
+}
diff --git a/providers/skel-implementation/capi/gda-capi-meta.h b/providers/skel-implementation/capi/gda-capi-meta.h
index b652414..797c923 100644
--- a/providers/skel-implementation/capi/gda-capi-meta.h
+++ b/providers/skel-implementation/capi/gda-capi-meta.h
@@ -1,5 +1,5 @@
/* GDA capi provider
- * Copyright (C) 2008 The GNOME Foundation.
+ * Copyright (C) 2008 - 2009 The GNOME Foundation.
*
* AUTHORS:
* TO_ADD: your name and email
@@ -190,7 +190,21 @@ gboolean _gda_capi_meta_routine_par (GdaServerProvider *prov, GdaConnection
const GValue *rout_catalog, const GValue *rout_schema,
const GValue *rout_name);
+/* _table_indexes */
+gboolean _gda_capi_meta__indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error);
+gboolean _gda_capi_meta_indexes_tab (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema, const GValue *table_name,
+ const GValue *index_name_n);
+/* _index_column_usage */
+gboolean _gda_capi_meta__index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error);
+gboolean _gda_capi_meta_index_cols (GdaServerProvider *prov, GdaConnection *cnc,
+ GdaMetaStore *store, GdaMetaContext *context, GError **error,
+ const GValue *table_catalog, const GValue *table_schema,
+ const GValue *table_name, const GValue *index_name);
G_END_DECLS
#endif
diff --git a/providers/skel-implementation/capi/gda-capi-provider.c b/providers/skel-implementation/capi/gda-capi-provider.c
index ed609ac..7909add 100644
--- a/providers/skel-implementation/capi/gda-capi-provider.c
+++ b/providers/skel-implementation/capi/gda-capi-provider.c
@@ -1,5 +1,5 @@
/* GDA Capi provider
- * Copyright (C) 2008 The GNOME Foundation.
+ * Copyright (C) 2008 - 2009 The GNOME Foundation.
*
* AUTHORS:
* TO_ADD: your name and email
@@ -239,6 +239,10 @@ gda_capi_provider_class_init (GdaCapiProviderClass *klass)
provider_class->meta_funcs.routine_col = _gda_capi_meta_routine_col;
provider_class->meta_funcs._routine_par = _gda_capi_meta__routine_par;
provider_class->meta_funcs.routine_par = _gda_capi_meta_routine_par;
+ provider_class->meta_funcs._indexes_tab = _gda_capi_meta__indexes_tab;
+ provider_class->meta_funcs.indexes_tab = _gda_capi_meta_indexes_tab;
+ provider_class->meta_funcs._index_cols = _gda_capi_meta__index_cols;
+ provider_class->meta_funcs.index_cols = _gda_capi_meta_index_cols;
/* distributed transactions: if not supported, then provider_class->xa_funcs should be set to NULL */
provider_class->xa_funcs = g_new0 (GdaServerProviderXa, 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]