rust/hedgewars-server/src/server/database.rs
changeset 15074 c5a6e8566425
parent 14785 a1077e8d26f4
child 15075 e935b1ad23f3
equal deleted inserted replaced
15073:7732013ce64c 15074:c5a6e8566425
     1 use mysql;
     1 use mysql;
     2 use mysql::{error::DriverError, error::Error, from_row_opt, params};
     2 use mysql::{error::DriverError, error::Error, from_row_opt, params};
     3 use openssl::sha::sha1;
     3 use openssl::sha::sha1;
     4 
     4 
     5 use super::handlers::AccountInfo;
     5 use crate::{
     6 use crate::server::handlers::Sha1Digest;
     6     handlers::{Sha1Digest, AccountInfo}
       
     7 };
     7 
     8 
     8 const GET_ACCOUNT_QUERY: &str =
     9 const GET_ACCOUNT_QUERY: &str =
     9     r"SELECT CASE WHEN users.status = 1 THEN users.pass ELSE '' END,
    10     r"SELECT CASE WHEN users.status = 1 THEN users.pass ELSE '' END,
    10      (SELECT COUNT(users_roles.rid) FROM users_roles WHERE users.uid = users_roles.uid AND users_roles.rid = 3),
    11      (SELECT COUNT(users_roles.rid) FROM users_roles WHERE users.uid = users_roles.uid AND users_roles.rid = 3),
    11      (SELECT COUNT(users_roles.rid) FROM users_roles WHERE users.uid = users_roles.uid AND users_roles.rid = 13)
    12      (SELECT COUNT(users_roles.rid) FROM users_roles WHERE users.uid = users_roles.uid AND users_roles.rid = 13)