瀏覽代碼

vlib/pg: fix writing text-based attributes, don't use G_str_to_sql()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54685 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年之前
父節點
當前提交
42b9640b8d
共有 1 個文件被更改,包括 1 次插入5 次删除
  1. 1 5
      lib/vector/Vlib/write_pg.c

+ 1 - 5
lib/vector/Vlib/write_pg.c

@@ -1008,7 +1008,6 @@ char *build_insert_stmt(const struct Format_info_pg *pg_info,
         int col, ncol, more;
         int sqltype, ctype, is_fid;
         char buf_val[DB_SQL_MAX], buf_tmp[DB_SQL_MAX];
-        char *str_val;
 
         const char *colname;
 
@@ -1091,10 +1090,7 @@ char *build_insert_stmt(const struct Format_info_pg *pg_info,
                                     db_get_value_double(value));
                             break;
                         case DB_C_TYPE_STRING:
-                            str_val = G_store(db_get_value_string(value));
-                            G_str_to_sql(str_val);
-                            sprintf(buf_tmp, "'%s'", str_val);
-                            G_free(str_val);
+			    sprintf(buf_tmp, "'%s'", db_get_value_string(value));
                             break;
                         case DB_C_TYPE_DATETIME:
                             db_convert_column_value_to_string(column,