[libgda/LIBGDA_4.2] Correctly order columns in gda_connection_get_meta_store_data()



commit 402a7afab293df97f77e41934ebdd6f4db673478
Author: Vivien Malerba <malerba gnome-db org>
Date:   Thu Sep 1 19:58:16 2011 +0200

    Correctly order columns in gda_connection_get_meta_store_data()
    
    where the type is GDA_CONNECTION_META_FIELDS

 libgda/gda-connection.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/libgda/gda-connection.c b/libgda/gda-connection.c
index b628fd0..6de10ca 100644
--- a/libgda/gda-connection.c
+++ b/libgda/gda-connection.c
@@ -5314,7 +5314,7 @@ prepare_meta_statements_hash (void)
 	key->meta_type = GDA_CONNECTION_META_FIELDS;
 	key->nb_filters = 1;
 	key->filters = name_array;
-	sql = "SELECT c.column_name, c.data_type, c.gtype, c.numeric_precision, c.numeric_scale, c.is_nullable AS 'Nullable', c.column_default, c.extra FROM _columns as c NATURAL JOIN _tables as t WHERE t.table_short_name=##name::string";
+	sql = "SELECT c.column_name, c.data_type, c.gtype, c.numeric_precision, c.numeric_scale, c.is_nullable AS 'Nullable', c.column_default, c.extra FROM _columns as c NATURAL JOIN _tables as t WHERE t.table_short_name=##name::string ORDER BY c.ordinal_position";
 	stmt = gda_sql_parser_parse_string (parser, sql, NULL, NULL);
 	if (!stmt)
 		g_error ("Could not parse internal statement: %s\n", sql);
@@ -5324,7 +5324,7 @@ prepare_meta_statements_hash (void)
 	key->meta_type = GDA_CONNECTION_META_FIELDS;
 	key->nb_filters = 2;
 	key->filters = name_col_array;
-	sql = "SELECT c.column_name, c.data_type, c.gtype, c.numeric_precision, c.numeric_scale, c.is_nullable AS 'Nullable', c.column_default, c.extra FROM _columns as c NATURAL JOIN _tables as t WHERE t.table_short_name=##name::string AND c.column_name = ##field_name::string";
+	sql = "SELECT c.column_name, c.data_type, c.gtype, c.numeric_precision, c.numeric_scale, c.is_nullable AS 'Nullable', c.column_default, c.extra FROM _columns as c NATURAL JOIN _tables as t WHERE t.table_short_name=##name::string AND c.column_name = ##field_name::string ORDER BY c.ordinal_position";
 	stmt = gda_sql_parser_parse_string (parser, sql, NULL, NULL);
 	if (!stmt)
 		g_error ("Could not parse internal statement: %s\n", sql);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]