From 089c17ccff8395648ecc0832a3447c0e1e2e6fc5 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Tue, 30 Oct 2007 15:53:56 +0200 Subject: [PATCH] Add sql for other other way languages. Finalize all sql statements properly. --- src/osm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/osm.c b/src/osm.c index cb2869a..9cebb34 100644 --- a/src/osm.c +++ b/src/osm.c @@ -359,11 +359,13 @@ struct sql_stmt { sqlite3_stmt *insert_way_data; sqlite3_stmt *insert_way_ref; sqlite3_stmt *insert_way_name; + sqlite3_stmt *insert_way_names_nls; sqlite3_stmt *insert_way_n2n; sqlite3_stmt *delete_way; sqlite3_stmt *delete_way_n2n; sqlite3_stmt *delete_way_seg_wsid; sqlite3_stmt *delete_way_name; + sqlite3_stmt *delete_way_names_nls; sqlite3_stmt *delete_way_ref; sqlite3_stmt *insert_place; @@ -423,6 +425,18 @@ sqlite3_finalize(sql.update_node); sqlite3_finalize(sql.insert_place); sqlite3_finalize(sql.delete_place); +sqlite3_finalize(sql.delete_way); +sqlite3_finalize(sql.insert_way_data); + +sqlite3_finalize(sql.delete_way_name); +sqlite3_finalize(sql.insert_way_name); + +sqlite3_finalize(sql.delete_way_n2n); +sqlite3_finalize(sql.insert_way_n2n); + +sqlite3_finalize(sql.delete_way_names_nls); +sqlite3_finalize(sql.insert_way_names_nls); + return sqlite3_close(db)==SQLITE_OK ? TRUE : FALSE; } @@ -456,6 +470,10 @@ sqlite3_prepare_v2(db, "delete from way_n2n where wsid=?", -1, &sql.delete_way_n sqlite3_prepare_v2(db, "insert or replace into way_names (wid,name) values (?, ?)", -1, &sql.insert_way_name, NULL); sqlite3_prepare_v2(db, "delete from way_names", -1, &sql.delete_way_name, NULL); +/* Other language names for ways */ +sqlite3_prepare_v2(db, "insert into way_names_nls (wid,lang,name) values (?, ?, ?)", -1, &sql.insert_way_names_nls, NULL); +sqlite3_prepare_v2(db, "delete from way_names_nls where wid=?", -1, &sql.delete_way_names_nls, NULL); + /* Way ref and int_ref */ sqlite3_prepare_v2(db, "insert or replace into way_ref (rid,ref,int_ref) values (?, ?, ?)", -1, &sql.insert_way_ref, NULL); sqlite3_prepare_v2(db, "delete from way_ref", -1, &sql.delete_way_ref, NULL); -- 2.39.5