summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton <anton@picapica>2024-08-11 23:46:16 +0400
committerAnton <anton@picapica>2024-08-11 23:46:16 +0400
commitc3d7214d09448e8fe5253213a4770edf2abaae9f (patch)
tree2ff81336d43d6cc5215ee302be68013c62a6fcc0
parentf3e70e541ef32a0c2b7eba226e5040de03bb8d9c (diff)
downloadpica-pica-c3d7214d09448e8fe5253213a4770edf2abaae9f.tar.gz
pica-pica-c3d7214d09448e8fe5253213a4770edf2abaae9f.zip
Use single-quotes around string literals in SQL, make sqlite with strict configuration happy.
-rw-r--r--nodelist_db_create.sql6
-rw-r--r--pica-client/main.cpp8
2 files changed, 7 insertions, 7 deletions
diff --git a/nodelist_db_create.sql b/nodelist_db_create.sql
index 73b8259..9d3236a 100644
--- a/nodelist_db_create.sql
+++ b/nodelist_db_create.sql
@@ -22,6 +22,6 @@ create table if not exists nodes
inactive_count int not null,
constraint pk primary key (address,port) on conflict replace
);
-insert into nodes values("picapica.im", 2233, 0, 0);
-insert into nodes values("picapica.im", 2299, 0, 0);
-insert into nodes values("picapica.ge", 2299, 0, 0);
+insert into nodes values('picapica.im', 2233, 0, 0);
+insert into nodes values('picapica.im', 2299, 0, 0);
+insert into nodes values('picapica.ge', 2299, 0, 0);
diff --git a/pica-client/main.cpp b/pica-client/main.cpp
index d44025d..c021209 100644
--- a/pica-client/main.cpp
+++ b/pica-client/main.cpp
@@ -112,9 +112,9 @@ static bool create_database()
inactive_count int not null,\
constraint pk primary key (address,port) on conflict replace \
);");
- query.exec("insert into nodes values(\"picapica.im\", 2233, 0, 0);");
- query.exec("insert into nodes values(\"picapica.im\", 2299, 0, 0);");
- query.exec("insert into nodes values(\"picapica.ge\", 2299, 0, 0);");
+ query.exec("insert into nodes values('picapica.im', 2233, 0, 0);");
+ query.exec("insert into nodes values('picapica.im', 2299, 0, 0);");
+ query.exec("insert into nodes values('picapica.ge', 2299, 0, 0);");
if (query.lastError().isValid())
goto showerror;
@@ -187,7 +187,7 @@ static bool update_database()
QSqlQuery query;
//checking if table schema_version exists. If not, then database belongs to pica-client before 0.5.3 version
- query.exec("select count(*) from sqlite_master where name=\"schema_version\"");
+ query.exec("select count(*) from sqlite_master where name='schema_version'");
query.next();
if (query.lastError().isValid())