Renamed 'use' database column as that is a keyword in MySQL.

Reported by Stefan Tomas.
This commit is contained in:
Tobias Brunner
2011-09-01 09:59:37 +02:00
parent d0e1b237be
commit f35578acb1
3 changed files with 10 additions and 10 deletions
@@ -53,7 +53,7 @@ METHOD(simaka_provider_t, get_triplet, bool,
snprintf(buf, sizeof(buf), "%Y", id); snprintf(buf, sizeof(buf), "%Y", id);
query = this->db->query(this->db, query = this->db->query(this->db,
"select rand, sres, kc from triplets where id = ? order by use", "select rand, sres, kc from triplets where id = ? order by used",
DB_TEXT, buf, DB_BLOB, DB_BLOB, DB_BLOB); DB_TEXT, buf, DB_BLOB, DB_BLOB, DB_BLOB);
if (query) if (query)
{ {
@@ -82,7 +82,7 @@ METHOD(simaka_provider_t, get_triplet, bool,
else else
{ {
this->db->execute(this->db, NULL, this->db->execute(this->db, NULL,
"update triplets set use = ? where id = ? and rand = ?", "update triplets set used = ? where id = ? and rand = ?",
DB_UINT, time(NULL), DB_TEXT, buf, DB_UINT, time(NULL), DB_TEXT, buf,
DB_BLOB, chunk_create(rand, SIM_RAND_LEN)); DB_BLOB, chunk_create(rand, SIM_RAND_LEN));
} }
@@ -102,7 +102,7 @@ METHOD(simaka_provider_t, get_quintuplet, bool,
snprintf(buf, sizeof(buf), "%Y", id); snprintf(buf, sizeof(buf), "%Y", id);
query = this->db->query(this->db, "select rand, res, ck, ik, autn " query = this->db->query(this->db, "select rand, res, ck, ik, autn "
"from quintuplets where id = ? order by use", DB_TEXT, buf, "from quintuplets where id = ? order by used", DB_TEXT, buf,
DB_BLOB, DB_BLOB, DB_BLOB, DB_BLOB, DB_BLOB); DB_BLOB, DB_BLOB, DB_BLOB, DB_BLOB, DB_BLOB);
if (query) if (query)
{ {
@@ -137,7 +137,7 @@ METHOD(simaka_provider_t, get_quintuplet, bool,
else else
{ {
this->db->execute(this->db, NULL, this->db->execute(this->db, NULL,
"update quintuplets set use = ? where id = ? and rand = ?", "update quintuplets set used = ? where id = ? and rand = ?",
DB_UINT, time(NULL), DB_TEXT, buf, DB_UINT, time(NULL), DB_TEXT, buf,
DB_BLOB, chunk_create(rand, AKA_RAND_LEN)); DB_BLOB, chunk_create(rand, AKA_RAND_LEN));
} }
@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS triplets; DROP TABLE IF EXISTS triplets;
CREATE TABLE triplets ( CREATE TABLE triplets (
id TEXT NOT NULL, id TEXT NOT NULL,
use INTEGER NOT NULL, used INTEGER NOT NULL,
rand BLOB NOT NULL, rand BLOB NOT NULL,
sres BLOB NOT NULL, sres BLOB NOT NULL,
kc BLOB NOT NULL kc BLOB NOT NULL
@@ -10,7 +10,7 @@ CREATE TABLE triplets (
DROP TABLE IF EXISTS quintuplets; DROP TABLE IF EXISTS quintuplets;
CREATE TABLE quintuplets ( CREATE TABLE quintuplets (
id TEXT NOT NULL, id TEXT NOT NULL,
use INTEGER NOT NULL, used INTEGER NOT NULL,
rand BLOB NOT NULL, rand BLOB NOT NULL,
autn BLOB NOT NULL, autn BLOB NOT NULL,
ck BLOB NOT NULL, ck BLOB NOT NULL,
@@ -2,23 +2,23 @@ DELETE FROM triplets;
DELETE FROM quintuplets; DELETE FROM quintuplets;
INSERT INTO triplets INSERT INTO triplets
(id, use, rand, sres, kc) VALUES (id, used, rand, sres, kc) VALUES
('[email protected]', 0, ('[email protected]', 0,
X'00112233445566778899AABBCCDDEEFF', X'01234567', X'0123456789ABCDEF' X'00112233445566778899AABBCCDDEEFF', X'01234567', X'0123456789ABCDEF'
); );
INSERT INTO triplets INSERT INTO triplets
(id, use, rand, sres, kc) VALUES (id, used, rand, sres, kc) VALUES
('[email protected]', 0, ('[email protected]', 0,
X'112233445566778899AABBCCDDEEFF00', X'12345678', X'123456789ABCDEF0' X'112233445566778899AABBCCDDEEFF00', X'12345678', X'123456789ABCDEF0'
); );
INSERT INTO triplets INSERT INTO triplets
(id, use, rand, sres, kc) VALUES (id, used, rand, sres, kc) VALUES
('[email protected]', 0, ('[email protected]', 0,
X'2233445566778899AABBCCDDEEFF0011', X'23456789', X'23456789ABCDEF01' X'2233445566778899AABBCCDDEEFF0011', X'23456789', X'23456789ABCDEF01'
); );
INSERT INTO quintuplets INSERT INTO quintuplets
(id, use, rand, autn, ck, ik, res) VALUES (id, used, rand, autn, ck, ik, res) VALUES
('[email protected]', 0, ('[email protected]', 0,
X'00112233445566778899AABBCCDDEEFF', X'00112233445566778899AABBCCDDEEFF',
X'112233445566778899AABBCCDDEEFF00', X'112233445566778899AABBCCDDEEFF00',