diff --git a/tokenserver-db-sqlite/src/models.rs b/tokenserver-db-sqlite/src/models.rs index f552739eb2..6c95c93d76 100644 --- a/tokenserver-db-sqlite/src/models.rs +++ b/tokenserver-db-sqlite/src/models.rs @@ -4,6 +4,7 @@ SELECT rowid as id FROM nodes WHERE service = ? AND node = ?"#; +// FIXME: MySQL specific pub const REPLACE_USERS_SYNC_QUERY: &str = r#" UPDATE users SET replaced_at = ? @@ -30,6 +31,7 @@ AND email = ? AND generation <= ? AND COALESCE(keys_changed_at, 0) <= COALESCE(?, keys_changed_at, 0) AND replaced_at IS NULL"#; +// FIXME: MySQL specific pub const POST_USER_SYNC_QUERY: &str = r#" INSERT INTO users (service, email, generation, client_state, created_at, nodeid, keys_changed_at, replaced_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"#; @@ -51,6 +53,7 @@ WHERE service = ? AND available <= 0 AND capacity > current_load AND downed = 0"#; +// FIXME: MySQL specific pub const GET_BEST_NODE_SPANNER_QUERY: &str = r#" SELECT id, node FROM nodes diff --git a/tokenserver-db/src/models.rs b/tokenserver-db/src/models.rs index 5b0f5f49db..c530af069c 100644 --- a/tokenserver-db/src/models.rs +++ b/tokenserver-db/src/models.rs @@ -55,7 +55,7 @@ struct DbInner { impl TokenserverDb { // Note that this only works because an instance of `TokenserverDb` has *exclusive access* to - // a connection from the r2d2 pool for its lifetime. `LAST_INSERT_ID()`/`LAST_INSERT_ROWID()` + // a connection from the r2d2 pool for its lifetime. `LAST_INSERT_ID_QUERY` // returns the ID of the most recently-inserted record *for a given connection*. // If connections were shared across requests, using this function would introduce a race condition, // as we could potentially get IDs from records created during other requests. @@ -163,7 +163,6 @@ impl TokenserverDb { .execute(&self.inner.conn)?; diesel::sql_query(LAST_INSERT_ID_QUERY) - .bind::(&user.email) .get_result::(&self.inner.conn) .map_err(Into::into) }