1 /*
2  * Copyright (C) 2008 - 2011 Vivien Malerba <malerba@gnome-db.org>
3  * Copyright (C) 2010 David King <davidk@openismus.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA  02110-1301, USA.
19  */
20 
21 #include <string.h>
22 #include "gda-jdbc.h"
23 #include "gda-jdbc-meta.h"
24 #include "gda-jdbc-provider.h"
25 #include <libgda/gda-meta-store.h>
26 #include <libgda/sql-parser/gda-sql-parser.h>
27 #include <glib/gi18n-lib.h>
28 #include <libgda/gda-server-provider-extra.h>
29 #include <libgda/gda-connection-private.h>
30 #include <libgda/gda-data-model-array.h>
31 #include <libgda/gda-set.h>
32 #include <libgda/gda-holder.h>
33 #include "jni-globals.h"
34 #include "gda-jdbc-util.h"
35 #include "gda-jdbc-recordset.h"
36 #include <libgda/gda-debug-macros.h>
37 
38 /*
39  * Meta initialization
40  */
41 void
_gda_jdbc_provider_meta_init(G_GNUC_UNUSED GdaServerProvider * provider)42 _gda_jdbc_provider_meta_init (G_GNUC_UNUSED GdaServerProvider *provider)
43 {
44 }
45 
46 static gboolean
init_meta_obj(GdaConnection * cnc,JNIEnv * jenv,JdbcConnectionData * cdata,GError ** error)47 init_meta_obj (GdaConnection *cnc, JNIEnv *jenv, JdbcConnectionData *cdata, GError **error)
48 {
49 	GError *lerror = NULL;
50 	static GMutex init_mutex;
51 
52 	g_mutex_lock (&init_mutex);
53 
54 	if (cdata->jmeta_obj)
55 		return TRUE;
56 	cdata->jmeta_obj = jni_wrapper_method_call (jenv, GdaJConnection__getJMeta,
57 						    cdata->jcnc_obj, NULL, NULL, &lerror);
58 	g_mutex_unlock (&init_mutex);
59 	if (!cdata->jmeta_obj) {
60 		if (error && lerror)
61 			*error = g_error_copy (lerror);
62 		_gda_jdbc_make_error (cnc, 0, NULL, lerror);
63 
64 		return FALSE;
65 	}
66 	return TRUE;
67 }
68 
69 gboolean
_gda_jdbc_meta__info(G_GNUC_UNUSED GdaServerProvider * prov,GdaConnection * cnc,GdaMetaStore * store,GdaMetaContext * context,GError ** error)70 _gda_jdbc_meta__info (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnection *cnc,
71 		      GdaMetaStore *store, GdaMetaContext *context, GError **error)
72 {
73 	JdbcConnectionData *cdata;
74 	GdaDataModel *model = NULL;
75 	gboolean retval = FALSE;
76 	gint error_code;
77 	gchar *sql_state;
78 	GValue *jexec_res;
79 	GError *lerror = NULL;
80 
81 	JNIEnv *jenv = NULL;
82 	gboolean jni_detach;
83 
84 	/* Get private data */
85 	cdata = (JdbcConnectionData*) gda_connection_internal_get_provider_data_error (cnc, error);
86 	if (!cdata)
87 		return FALSE;
88 
89 	jenv = _gda_jdbc_get_jenv (&jni_detach, error);
90 	if (!jenv)
91 		return FALSE;
92 
93 	if (! cdata->jmeta_obj && !init_meta_obj (cnc, jenv, cdata, error))
94 		goto out;
95 
96 	jexec_res = jni_wrapper_method_call (jenv, GdaJMeta__getCatalog,
97 					     cdata->jmeta_obj, &error_code, &sql_state, &lerror);
98 	if (!jexec_res) {
99 		if (error && lerror)
100 			*error = g_error_copy (lerror);
101 		_gda_jdbc_make_error (cnc, error_code, sql_state, lerror);
102 		goto out;
103 	}
104 
105 	model = gda_data_model_array_new_with_g_types (1, G_TYPE_STRING);
106 	GList *values;
107 	gint res;
108 	values = g_list_prepend (NULL, jexec_res);
109 	res = gda_data_model_append_values (model, values, error);
110 	gda_value_free (jexec_res);
111 	g_list_free (values);
112 	if (res == -1)
113 		goto out;
114 
115 	retval = gda_meta_store_modify_with_context (store, context, model, error);
116 
117  out:
118 	if (model)
119 		g_object_unref (model);
120 	_gda_jdbc_release_jenv (jni_detach);
121 
122 	return retval;
123 }
124 
125 gboolean
_gda_jdbc_meta__btypes(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)126 _gda_jdbc_meta__btypes (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
127 			G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
128 			G_GNUC_UNUSED GError **error)
129 {
130 	TO_IMPLEMENT;
131 	return TRUE;
132 }
133 
134 gboolean
_gda_jdbc_meta__udt(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)135 _gda_jdbc_meta__udt (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
136 		     G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
137 		     G_GNUC_UNUSED GError **error)
138 {
139 	TO_IMPLEMENT;
140 	return TRUE;
141 }
142 
143 gboolean
_gda_jdbc_meta_udt(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,GdaMetaStore * store,GdaMetaContext * context,GError ** error,G_GNUC_UNUSED const GValue * udt_catalog,G_GNUC_UNUSED const GValue * udt_schema)144 _gda_jdbc_meta_udt (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
145 		    GdaMetaStore *store, GdaMetaContext *context, GError **error,
146 		    G_GNUC_UNUSED const GValue *udt_catalog, G_GNUC_UNUSED const GValue *udt_schema)
147 {
148 	GdaDataModel *model = NULL;
149 	gboolean retval = TRUE;
150 
151 	TO_IMPLEMENT;
152 	/* fill in @model, with something like:
153 	 * model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_UDT], i_set, error);
154 	 */
155 	if (!model)
156 		return FALSE;
157 	retval = gda_meta_store_modify_with_context (store, context, model, error);
158 	g_object_unref (model);
159 
160 	return retval;
161 }
162 
163 
164 gboolean
_gda_jdbc_meta__udt_cols(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)165 _gda_jdbc_meta__udt_cols (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
166 			  G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
167 			  G_GNUC_UNUSED GError **error)
168 {
169 	TO_IMPLEMENT;
170 	return TRUE;
171 }
172 
173 gboolean
_gda_jdbc_meta_udt_cols(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * udt_catalog,G_GNUC_UNUSED const GValue * udt_schema,G_GNUC_UNUSED const GValue * udt_name)174 _gda_jdbc_meta_udt_cols (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
175 			 G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
176 			 G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *udt_catalog,
177 			 G_GNUC_UNUSED const GValue *udt_schema, G_GNUC_UNUSED const GValue *udt_name)
178 {
179 	TO_IMPLEMENT;
180 	return TRUE;
181 }
182 
183 gboolean
_gda_jdbc_meta__enums(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)184 _gda_jdbc_meta__enums (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
185 		       G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
186 		       G_GNUC_UNUSED GError **error)
187 {
188 	TO_IMPLEMENT;
189 	return TRUE;
190 }
191 
192 gboolean
_gda_jdbc_meta_enums(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * udt_catalog,G_GNUC_UNUSED const GValue * udt_schema,G_GNUC_UNUSED const GValue * udt_name)193 _gda_jdbc_meta_enums (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
194 		      G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
195 		      G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *udt_catalog,
196 		      G_GNUC_UNUSED const GValue *udt_schema, G_GNUC_UNUSED const GValue *udt_name)
197 {
198 	TO_IMPLEMENT;
199 	return TRUE;
200 }
201 
202 
203 gboolean
_gda_jdbc_meta__domains(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)204 _gda_jdbc_meta__domains (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
205 			 G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
206 			 G_GNUC_UNUSED GError **error)
207 {
208 	TO_IMPLEMENT;
209 	return TRUE;
210 }
211 
212 gboolean
_gda_jdbc_meta_domains(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * domain_catalog,G_GNUC_UNUSED const GValue * domain_schema)213 _gda_jdbc_meta_domains (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
214 			G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
215 			G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *domain_catalog,
216 			G_GNUC_UNUSED const GValue *domain_schema)
217 {
218 	TO_IMPLEMENT;
219 	return TRUE;
220 }
221 
222 gboolean
_gda_jdbc_meta__constraints_dom(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)223 _gda_jdbc_meta__constraints_dom (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
224 				 G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
225 				 G_GNUC_UNUSED GError **error)
226 {
227 	TO_IMPLEMENT;
228 	return TRUE;
229 }
230 
231 gboolean
_gda_jdbc_meta_constraints_dom(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * domain_catalog,G_GNUC_UNUSED const GValue * domain_schema,G_GNUC_UNUSED const GValue * domain_name)232 _gda_jdbc_meta_constraints_dom (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
233 				G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
234 				G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *domain_catalog,
235 				G_GNUC_UNUSED const GValue *domain_schema,
236 				G_GNUC_UNUSED const GValue *domain_name)
237 {
238 	TO_IMPLEMENT;
239 	return TRUE;
240 }
241 
242 gboolean
_gda_jdbc_meta__el_types(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)243 _gda_jdbc_meta__el_types (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
244 			  G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
245 			  G_GNUC_UNUSED GError **error)
246 {
247 	TO_IMPLEMENT;
248 	return TRUE;
249 }
250 
251 gboolean
_gda_jdbc_meta_el_types(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * specific_name)252 _gda_jdbc_meta_el_types (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
253 			 G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
254 			 G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *specific_name)
255 {
256 	TO_IMPLEMENT;
257 	return TRUE;
258 }
259 
260 gboolean
_gda_jdbc_meta__collations(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)261 _gda_jdbc_meta__collations (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
262 			    G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
263 			    G_GNUC_UNUSED GError **error)
264 {
265 	TO_IMPLEMENT;
266 	return TRUE;
267 }
268 
269 gboolean
_gda_jdbc_meta_collations(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * collation_catalog,G_GNUC_UNUSED const GValue * collation_schema,G_GNUC_UNUSED const GValue * collation_name_n)270 _gda_jdbc_meta_collations (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
271 			   G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
272 			   G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *collation_catalog,
273 			   G_GNUC_UNUSED const GValue *collation_schema,
274 			   G_GNUC_UNUSED const GValue *collation_name_n)
275 {
276 	TO_IMPLEMENT;
277 	return TRUE;
278 }
279 
280 gboolean
_gda_jdbc_meta__character_sets(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)281 _gda_jdbc_meta__character_sets (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
282 				G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
283 				G_GNUC_UNUSED GError **error)
284 {
285 	TO_IMPLEMENT;
286 	return TRUE;
287 }
288 
289 gboolean
_gda_jdbc_meta_character_sets(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * chset_catalog,G_GNUC_UNUSED const GValue * chset_schema,G_GNUC_UNUSED const GValue * chset_name_n)290 _gda_jdbc_meta_character_sets (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
291 			       G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
292 			       G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *chset_catalog,
293 			       G_GNUC_UNUSED const GValue *chset_schema,
294 			       G_GNUC_UNUSED const GValue *chset_name_n)
295 {
296 	TO_IMPLEMENT;
297 	return TRUE;
298 }
299 
300 gboolean
_gda_jdbc_meta__schemata(GdaServerProvider * prov,GdaConnection * cnc,GdaMetaStore * store,GdaMetaContext * context,GError ** error)301 _gda_jdbc_meta__schemata (GdaServerProvider *prov, GdaConnection *cnc,
302 			  GdaMetaStore *store, GdaMetaContext *context, GError **error)
303 {
304 	return _gda_jdbc_meta_schemata (prov, cnc, store, context, error, NULL, NULL);
305 }
306 
307 gboolean
_gda_jdbc_meta_schemata(G_GNUC_UNUSED GdaServerProvider * prov,GdaConnection * cnc,GdaMetaStore * store,GdaMetaContext * context,GError ** error,const GValue * catalog_name,const GValue * schema_name_n)308 _gda_jdbc_meta_schemata (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnection *cnc,
309 			 GdaMetaStore *store, GdaMetaContext *context, GError **error,
310 			 const GValue *catalog_name, const GValue *schema_name_n)
311 {
312 	JdbcConnectionData *cdata;
313 	GdaDataModel *model = NULL;
314 	gboolean retval = FALSE;
315 	gint error_code;
316 	gchar *sql_state;
317 	GValue *jexec_res;
318 	GError *lerror = NULL;
319 
320 	JNIEnv *jenv = NULL;
321 	gboolean jni_detach;
322 
323 	jstring catalog = NULL, schema = NULL;
324 
325 	/* Get private data */
326 	cdata = (JdbcConnectionData*) gda_connection_internal_get_provider_data_error (cnc, error);
327 	if (!cdata)
328 		return FALSE;
329 
330 	jenv = _gda_jdbc_get_jenv (&jni_detach, error);
331 	if (!jenv)
332 		return FALSE;
333 
334 	if (! cdata->jmeta_obj && !init_meta_obj (cnc, jenv, cdata, error))
335 		goto out;
336 
337 	if (catalog_name) {
338 		catalog = (*jenv)->NewStringUTF (jenv, g_value_get_string (catalog_name));
339 		if ((*jenv)->ExceptionCheck (jenv))
340 			goto out;
341 	}
342 
343 	if (schema_name_n) {
344 		schema = (*jenv)->NewStringUTF (jenv, g_value_get_string (schema_name_n));
345 		if ((*jenv)->ExceptionCheck (jenv))
346 			goto out;
347 	}
348 
349 	/* get data from JDBC */
350 	jexec_res = jni_wrapper_method_call (jenv, GdaJMeta__getSchemas,
351 					     cdata->jmeta_obj, &error_code, &sql_state, &lerror,
352 					     catalog, schema);
353 	if (!jexec_res) {
354 		if (error && lerror)
355 			*error = g_error_copy (lerror);
356 		_gda_jdbc_make_error (cnc, error_code, sql_state, lerror);
357 		_gda_jdbc_release_jenv (jni_detach);
358 		return FALSE;
359 	}
360 
361 	model = (GdaDataModel *) gda_jdbc_recordset_new (cnc, NULL, NULL, jenv,
362 							 jexec_res, GDA_DATA_MODEL_ACCESS_RANDOM, NULL);
363 	if (!model)
364 		goto out;
365 
366 	retval = gda_meta_store_modify_with_context (store, context, model, error);
367 
368  out:
369 	if (catalog)
370 		(*jenv)-> DeleteLocalRef (jenv, catalog);
371 	if (schema)
372 		(*jenv)-> DeleteLocalRef (jenv, schema);
373 	if (model)
374 		g_object_unref (model);
375 	_gda_jdbc_release_jenv (jni_detach);
376 
377 	return retval;
378 }
379 
380 gboolean
_gda_jdbc_meta__tables_views(GdaServerProvider * prov,GdaConnection * cnc,GdaMetaStore * store,GdaMetaContext * context,GError ** error)381 _gda_jdbc_meta__tables_views (GdaServerProvider *prov, GdaConnection *cnc,
382 			      GdaMetaStore *store, GdaMetaContext *context, GError **error)
383 {
384 	return _gda_jdbc_meta_tables_views (prov, cnc, store, context, error, NULL, NULL, NULL);
385 }
386 
387 gboolean
_gda_jdbc_meta_tables_views(G_GNUC_UNUSED GdaServerProvider * prov,GdaConnection * cnc,GdaMetaStore * store,GdaMetaContext * context,GError ** error,const GValue * table_catalog,const GValue * table_schema,const GValue * table_name_n)388 _gda_jdbc_meta_tables_views (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnection *cnc,
389 			     GdaMetaStore *store, GdaMetaContext *context, GError **error,
390 			     const GValue *table_catalog, const GValue *table_schema,
391 			     const GValue *table_name_n)
392 {
393 	JdbcConnectionData *cdata;
394 	GdaDataModel *model = NULL;
395 	gboolean retval = FALSE;
396 	gint error_code;
397 	gchar *sql_state;
398 	GValue *jexec_res;
399 	GError *lerror = NULL;
400 
401 	JNIEnv *jenv = NULL;
402 	gboolean jni_detach;
403 
404 	jstring catalog = NULL, schema = NULL, name = NULL;
405 
406 	/* Get private data */
407 	cdata = (JdbcConnectionData*) gda_connection_internal_get_provider_data_error (cnc, error);
408 	if (!cdata)
409 		return FALSE;
410 
411 	jenv = _gda_jdbc_get_jenv (&jni_detach, error);
412 	if (!jenv)
413 		return FALSE;
414 
415 	if (! cdata->jmeta_obj && !init_meta_obj (cnc, jenv, cdata, error))
416 		goto out;
417 
418 	if (table_catalog) {
419 		catalog = (*jenv)->NewStringUTF (jenv, g_value_get_string (table_catalog));
420 		if ((*jenv)->ExceptionCheck (jenv))
421 			goto out;
422 	}
423 
424 	if (table_schema) {
425 		schema = (*jenv)->NewStringUTF (jenv, g_value_get_string (table_schema));
426 		if ((*jenv)->ExceptionCheck (jenv))
427 			goto out;
428 	}
429 
430 	if (table_name_n) {
431 		name = (*jenv)->NewStringUTF (jenv, g_value_get_string (table_name_n));
432 		if ((*jenv)->ExceptionCheck (jenv))
433 			goto out;
434 	}
435 
436 	/* get data from JDBC: Tables */
437 	jexec_res = jni_wrapper_method_call (jenv, GdaJMeta__getTables,
438 					     cdata->jmeta_obj, &error_code, &sql_state, &lerror,
439 					     catalog, schema, name);
440 	if (!jexec_res) {
441 		if (error && lerror)
442 			*error = g_error_copy (lerror);
443 		_gda_jdbc_make_error (cnc, error_code, sql_state, lerror);
444 		_gda_jdbc_release_jenv (jni_detach);
445 		return FALSE;
446 	}
447 
448 	model = (GdaDataModel *) gda_jdbc_recordset_new (cnc, NULL, NULL, jenv,
449 							 jexec_res, GDA_DATA_MODEL_ACCESS_RANDOM, NULL);
450 	if (!model)
451 		goto out;
452 
453 	GdaMetaContext c2;
454 	c2 = *context; /* copy contents, just because we need to modify @context->table_name */
455 	c2.table_name = "_tables";
456 	retval = gda_meta_store_modify_with_context (store, &c2, model, error);
457 	if (!retval)
458 		goto out;
459 
460 	g_object_unref (model);
461 
462 	/* get data from JDBC: Views */
463 	jexec_res = jni_wrapper_method_call (jenv, GdaJMeta__getViews,
464 					     cdata->jmeta_obj, &error_code, &sql_state, &lerror,
465 					     catalog, schema, name);
466 	if (!jexec_res) {
467 		if (error && lerror)
468 			*error = g_error_copy (lerror);
469 		_gda_jdbc_make_error (cnc, error_code, sql_state, lerror);
470 		_gda_jdbc_release_jenv (jni_detach);
471 		return FALSE;
472 	}
473 
474 	model = (GdaDataModel *) gda_jdbc_recordset_new (cnc, NULL, NULL, jenv,
475 							 jexec_res, GDA_DATA_MODEL_ACCESS_RANDOM, NULL);
476 	if (!model)
477 		goto out;
478 
479 	c2.table_name = "_views";
480 	retval = gda_meta_store_modify_with_context (store, &c2, model, error);
481 
482  out:
483 	if (catalog)
484 		(*jenv)-> DeleteLocalRef (jenv, catalog);
485 	if (schema)
486 		(*jenv)-> DeleteLocalRef (jenv, schema);
487 	if (name)
488 		(*jenv)-> DeleteLocalRef (jenv, name);
489 	if (model)
490 		g_object_unref (model);
491 	_gda_jdbc_release_jenv (jni_detach);
492 
493 	return retval;
494 }
495 
496 gboolean
_gda_jdbc_meta__columns(GdaServerProvider * prov,GdaConnection * cnc,GdaMetaStore * store,GdaMetaContext * context,GError ** error)497 _gda_jdbc_meta__columns (GdaServerProvider *prov, GdaConnection *cnc,
498 			 GdaMetaStore *store, GdaMetaContext *context, GError **error)
499 {
500 	return _gda_jdbc_meta_columns (prov, cnc, store, context, error, NULL, NULL, NULL);
501 }
502 
503 gboolean
_gda_jdbc_meta_columns(G_GNUC_UNUSED GdaServerProvider * prov,GdaConnection * cnc,GdaMetaStore * store,GdaMetaContext * context,GError ** error,const GValue * table_catalog,const GValue * table_schema,const GValue * table_name)504 _gda_jdbc_meta_columns (G_GNUC_UNUSED GdaServerProvider *prov, GdaConnection *cnc,
505 			GdaMetaStore *store, GdaMetaContext *context, GError **error,
506 			const GValue *table_catalog, const GValue *table_schema,
507 			const GValue *table_name)
508 {
509 	JdbcConnectionData *cdata;
510 	GdaDataModel *model = NULL;
511 	gboolean retval = FALSE;
512 	gint error_code;
513 	gchar *sql_state;
514 	GValue *jexec_res;
515 	GError *lerror = NULL;
516 
517 	JNIEnv *jenv = NULL;
518 	gboolean jni_detach;
519 
520 	jstring catalog = NULL, schema = NULL, table = NULL;
521 
522 	/* Get private data */
523 	cdata = (JdbcConnectionData*) gda_connection_internal_get_provider_data_error (cnc, error);
524 	if (!cdata)
525 		return FALSE;
526 
527 	jenv = _gda_jdbc_get_jenv (&jni_detach, error);
528 	if (!jenv)
529 		return FALSE;
530 
531 	if (! cdata->jmeta_obj && !init_meta_obj (cnc, jenv, cdata, error))
532 		goto out;
533 
534 	if (table_catalog) {
535 		catalog = (*jenv)->NewStringUTF (jenv, g_value_get_string (table_catalog));
536 		if ((*jenv)->ExceptionCheck (jenv))
537 			goto out;
538 	}
539 
540 	if (table_schema) {
541 		schema = (*jenv)->NewStringUTF (jenv, g_value_get_string (table_schema));
542 		if ((*jenv)->ExceptionCheck (jenv))
543 			goto out;
544 	}
545 
546 	if (table_name) {
547 		table = (*jenv)->NewStringUTF (jenv, g_value_get_string (table_name));
548 		if ((*jenv)->ExceptionCheck (jenv))
549 			goto out;
550 	}
551 
552 	/* get data from JDBC */
553 	jexec_res = jni_wrapper_method_call (jenv, GdaJMeta__getColumns,
554 					     cdata->jmeta_obj, &error_code, &sql_state, &lerror,
555 					     catalog, schema, table);
556 	if (!jexec_res) {
557 		if (error && lerror)
558 			*error = g_error_copy (lerror);
559 		_gda_jdbc_make_error (cnc, error_code, sql_state, lerror);
560 		_gda_jdbc_release_jenv (jni_detach);
561 		return FALSE;
562 	}
563 
564 	model = (GdaDataModel *) gda_jdbc_recordset_new (cnc, NULL, NULL, jenv,
565 							 jexec_res, GDA_DATA_MODEL_ACCESS_RANDOM, NULL);
566 	if (!model)
567 		goto out;
568 
569 	retval = gda_meta_store_modify_with_context (store, context, model, error);
570 
571  out:
572 	if (catalog)
573 		(*jenv)-> DeleteLocalRef (jenv, catalog);
574 	if (schema)
575 		(*jenv)-> DeleteLocalRef (jenv, schema);
576 	if (table)
577 		(*jenv)-> DeleteLocalRef (jenv, table);
578 	if (model)
579 		g_object_unref (model);
580 	_gda_jdbc_release_jenv (jni_detach);
581 
582 	return retval;
583 }
584 
585 gboolean
_gda_jdbc_meta__view_cols(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)586 _gda_jdbc_meta__view_cols (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
587 			   G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
588 			   G_GNUC_UNUSED GError **error)
589 {
590 	TO_IMPLEMENT;
591 	return TRUE;
592 }
593 
594 gboolean
_gda_jdbc_meta_view_cols(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * view_catalog,G_GNUC_UNUSED const GValue * view_schema,G_GNUC_UNUSED const GValue * view_name)595 _gda_jdbc_meta_view_cols (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
596 			  G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
597 			  G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *view_catalog,
598 			  G_GNUC_UNUSED const GValue *view_schema, G_GNUC_UNUSED const GValue *view_name)
599 {
600 	TO_IMPLEMENT;
601 	return TRUE;
602 }
603 
604 gboolean
_gda_jdbc_meta__constraints_tab(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)605 _gda_jdbc_meta__constraints_tab (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
606 				 G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
607 				 G_GNUC_UNUSED GError **error)
608 {
609 	TO_IMPLEMENT;
610 	return TRUE;
611 }
612 
613 gboolean
_gda_jdbc_meta_constraints_tab(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * table_catalog,G_GNUC_UNUSED const GValue * table_schema,G_GNUC_UNUSED const GValue * table_name,G_GNUC_UNUSED const GValue * constraint_name_n)614 _gda_jdbc_meta_constraints_tab (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
615 				G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
616 				G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *table_catalog,
617 				G_GNUC_UNUSED const GValue *table_schema,
618 				G_GNUC_UNUSED const GValue *table_name,
619 				G_GNUC_UNUSED const GValue *constraint_name_n)
620 {
621 	TO_IMPLEMENT;
622 	return TRUE;
623 }
624 
625 gboolean
_gda_jdbc_meta__constraints_ref(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)626 _gda_jdbc_meta__constraints_ref (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
627 				 G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
628 				 G_GNUC_UNUSED GError **error)
629 {
630 	TO_IMPLEMENT;
631 	return TRUE;
632 }
633 
634 gboolean
_gda_jdbc_meta_constraints_ref(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * table_catalog,G_GNUC_UNUSED const GValue * table_schema,G_GNUC_UNUSED const GValue * table_name,G_GNUC_UNUSED const GValue * constraint_name)635 _gda_jdbc_meta_constraints_ref (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
636 				G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
637 				G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *table_catalog,
638 				G_GNUC_UNUSED const GValue *table_schema,
639 				G_GNUC_UNUSED const GValue *table_name,
640 				G_GNUC_UNUSED const GValue *constraint_name)
641 {
642 	TO_IMPLEMENT;
643 	return TRUE;
644 }
645 
646 gboolean
_gda_jdbc_meta__key_columns(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)647 _gda_jdbc_meta__key_columns (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
648 			     G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
649 			     G_GNUC_UNUSED GError **error)
650 {
651 	TO_IMPLEMENT;
652 	return TRUE;
653 }
654 
655 gboolean
_gda_jdbc_meta_key_columns(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * table_catalog,G_GNUC_UNUSED const GValue * table_schema,G_GNUC_UNUSED const GValue * table_name,G_GNUC_UNUSED const GValue * constraint_name)656 _gda_jdbc_meta_key_columns (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
657 			    G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
658 			    G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *table_catalog,
659 			    G_GNUC_UNUSED const GValue *table_schema, G_GNUC_UNUSED const GValue *table_name,
660 			    G_GNUC_UNUSED const GValue *constraint_name)
661 {
662 	TO_IMPLEMENT;
663 	return TRUE;
664 }
665 
666 gboolean
_gda_jdbc_meta__check_columns(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)667 _gda_jdbc_meta__check_columns (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
668 			       G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
669 			       G_GNUC_UNUSED GError **error)
670 {
671 	TO_IMPLEMENT;
672 	return TRUE;
673 }
674 
675 gboolean
_gda_jdbc_meta_check_columns(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * table_catalog,G_GNUC_UNUSED const GValue * table_schema,G_GNUC_UNUSED const GValue * table_name,G_GNUC_UNUSED const GValue * constraint_name)676 _gda_jdbc_meta_check_columns (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
677 			      G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
678 			      G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *table_catalog,
679 			      G_GNUC_UNUSED const GValue *table_schema,
680 			      G_GNUC_UNUSED const GValue *table_name,
681 			      G_GNUC_UNUSED const GValue *constraint_name)
682 {
683 	TO_IMPLEMENT;
684 	return TRUE;
685 }
686 
687 gboolean
_gda_jdbc_meta__triggers(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)688 _gda_jdbc_meta__triggers (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
689 			  G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
690 			  G_GNUC_UNUSED GError **error)
691 {
692 	TO_IMPLEMENT;
693 	return TRUE;
694 }
695 
696 gboolean
_gda_jdbc_meta_triggers(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * table_catalog,G_GNUC_UNUSED const GValue * table_schema,G_GNUC_UNUSED const GValue * table_name)697 _gda_jdbc_meta_triggers (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
698 			 G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
699 			 G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *table_catalog,
700 			 G_GNUC_UNUSED const GValue *table_schema,
701 			 G_GNUC_UNUSED const GValue *table_name)
702 {
703 	TO_IMPLEMENT;
704 	return TRUE;
705 }
706 
707 gboolean
_gda_jdbc_meta__routines(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)708 _gda_jdbc_meta__routines (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
709 			  G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
710 			  G_GNUC_UNUSED GError **error)
711 {
712 	TO_IMPLEMENT;
713 	return TRUE;
714 }
715 
716 gboolean
_gda_jdbc_meta_routines(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * routine_catalog,G_GNUC_UNUSED const GValue * routine_schema,G_GNUC_UNUSED const GValue * routine_name_n)717 _gda_jdbc_meta_routines (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
718 			 G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
719 			 G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *routine_catalog,
720 			 G_GNUC_UNUSED const GValue *routine_schema,
721 			 G_GNUC_UNUSED const GValue *routine_name_n)
722 {
723 	TO_IMPLEMENT;
724 	return TRUE;
725 }
726 
727 gboolean
_gda_jdbc_meta__routine_col(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)728 _gda_jdbc_meta__routine_col (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
729 			     G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
730 			     G_GNUC_UNUSED GError **error)
731 {
732 	TO_IMPLEMENT;
733 	return TRUE;
734 }
735 
736 gboolean
_gda_jdbc_meta_routine_col(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * rout_catalog,G_GNUC_UNUSED const GValue * rout_schema,G_GNUC_UNUSED const GValue * rout_name)737 _gda_jdbc_meta_routine_col (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
738 			    G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
739 			    G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *rout_catalog,
740 			    G_GNUC_UNUSED const GValue *rout_schema, G_GNUC_UNUSED const GValue *rout_name)
741 {
742 	TO_IMPLEMENT;
743 	return TRUE;
744 }
745 
746 gboolean
_gda_jdbc_meta__routine_par(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)747 _gda_jdbc_meta__routine_par (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
748 			     G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
749 			     G_GNUC_UNUSED GError **error)
750 {
751 	TO_IMPLEMENT;
752 	return TRUE;
753 }
754 
755 gboolean
_gda_jdbc_meta_routine_par(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * rout_catalog,G_GNUC_UNUSED const GValue * rout_schema,G_GNUC_UNUSED const GValue * rout_name)756 _gda_jdbc_meta_routine_par (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
757 			    G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
758 			    G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *rout_catalog,
759 			    G_GNUC_UNUSED const GValue *rout_schema, G_GNUC_UNUSED const GValue *rout_name)
760 {
761 	TO_IMPLEMENT;
762 	return TRUE;
763 }
764 
765 gboolean
_gda_jdbc_meta__indexes_tab(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)766 _gda_jdbc_meta__indexes_tab (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
767 			     G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
768 			     G_GNUC_UNUSED GError **error)
769 {
770 	TO_IMPLEMENT;
771 	return TRUE;
772 }
773 
774 gboolean
_gda_jdbc_meta_indexes_tab(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * table_catalog,G_GNUC_UNUSED const GValue * table_schema,G_GNUC_UNUSED const GValue * table_name,G_GNUC_UNUSED const GValue * index_name_n)775 _gda_jdbc_meta_indexes_tab (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
776 			    G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
777 			    G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *table_catalog,
778 			    G_GNUC_UNUSED const GValue *table_schema, G_GNUC_UNUSED const GValue *table_name,
779 			    G_GNUC_UNUSED const GValue *index_name_n)
780 {
781 	TO_IMPLEMENT;
782 	return TRUE;
783 }
784 
785 gboolean
_gda_jdbc_meta__index_cols(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error)786 _gda_jdbc_meta__index_cols (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
787 			    G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
788 			    G_GNUC_UNUSED GError **error)
789 {
790 	TO_IMPLEMENT;
791 	return TRUE;
792 }
793 
794 gboolean
_gda_jdbc_meta_index_cols(G_GNUC_UNUSED GdaServerProvider * prov,G_GNUC_UNUSED GdaConnection * cnc,G_GNUC_UNUSED GdaMetaStore * store,G_GNUC_UNUSED GdaMetaContext * context,G_GNUC_UNUSED GError ** error,G_GNUC_UNUSED const GValue * table_catalog,G_GNUC_UNUSED const GValue * table_schema,G_GNUC_UNUSED const GValue * table_name,G_GNUC_UNUSED const GValue * index_name)795 _gda_jdbc_meta_index_cols (G_GNUC_UNUSED GdaServerProvider *prov, G_GNUC_UNUSED GdaConnection *cnc,
796 			   G_GNUC_UNUSED GdaMetaStore *store, G_GNUC_UNUSED GdaMetaContext *context,
797 			   G_GNUC_UNUSED GError **error, G_GNUC_UNUSED const GValue *table_catalog,
798 			   G_GNUC_UNUSED const GValue *table_schema, G_GNUC_UNUSED const GValue *table_name,
799 			   G_GNUC_UNUSED const GValue *index_name)
800 {
801 	TO_IMPLEMENT;
802 	return TRUE;
803 }
804