[libgda/LIBGDA_4.2] Correction for bug #661164
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/LIBGDA_4.2] Correction for bug #661164
- Date: Tue, 11 Oct 2011 20:34:08 +0000 (UTC)
commit 9da2487ebf946b87c1663e8fed5526fffe7f322c
Author: Vivien Malerba <malerba gnome-db org>
Date: Mon Oct 10 21:15:14 2011 +0200
Correction for bug #661164
libgda/gda-statement.c | 34 ++++++++++++++++++++++++++++++----
1 files changed, 30 insertions(+), 4 deletions(-)
---
diff --git a/libgda/gda-statement.c b/libgda/gda-statement.c
index afdbb4f..b708313 100644
--- a/libgda/gda-statement.c
+++ b/libgda/gda-statement.c
@@ -1972,8 +1972,21 @@ default_render_select_field (GdaSqlSelectField *field, GdaSqlRenderingContext *c
g_string_append (string, str);
g_free (str);
- if (field->as)
- g_string_append_printf (string, " AS %s", field->as);
+ if (field->as) {
+ if ((*field->as != '\'') && (*field->as != '"')) {
+ GdaConnectionOptions cncoptions = 0;
+ gchar *tmp;
+ if (context->cnc)
+ g_object_get (G_OBJECT (context->cnc), "options", &cncoptions, NULL);
+ tmp = gda_sql_identifier_quote (field->as, context->cnc,
+ context->provider, FALSE,
+ cncoptions & GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE);
+ g_string_append_printf (string, " AS %s", tmp);
+ g_free (tmp);
+ }
+ else
+ g_string_append_printf (string, " AS %s", field->as);
+ }
str = string->str;
g_string_free (string, FALSE);
@@ -2013,8 +2026,21 @@ default_render_select_target (GdaSqlSelectTarget *target, GdaSqlRenderingContext
g_free (str);
}
- if (target->as)
- g_string_append_printf (string, " AS %s", target->as);
+ if (target->as) {
+ if ((*target->as != '\'') && (*target->as != '"')) {
+ GdaConnectionOptions cncoptions = 0;
+ gchar *tmp;
+ if (context->cnc)
+ g_object_get (G_OBJECT (context->cnc), "options", &cncoptions, NULL);
+ tmp = gda_sql_identifier_quote (target->as, context->cnc,
+ context->provider, FALSE,
+ cncoptions & GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE);
+ g_string_append_printf (string, " AS %s", tmp);
+ g_free (tmp);
+ }
+ else
+ g_string_append_printf (string, " AS %s", target->as);
+ }
str = string->str;
g_string_free (string, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]