mirror of
				https://bitbucket.org/jsuto/piler.git
				synced 2025-10-31 07:22:26 +01:00 
			
		
		
		
	removed get_id_by_piler_id()
This commit is contained in:
		| @@ -16,79 +16,6 @@ | |||||||
| #include <piler.h> | #include <piler.h> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| uint64 get_id_by_piler_id(struct session_data *sdata, char *digest, char *bodydigest, struct __config *cfg){ |  | ||||||
|    char s[SMALLBUFSIZE]; |  | ||||||
|    MYSQL_STMT *stmt; |  | ||||||
|    MYSQL_BIND bind[3]; |  | ||||||
|    unsigned long len=0; |  | ||||||
|    uint64 id=0; |  | ||||||
|  |  | ||||||
|    memset(digest, 0, 2*DIGEST_LENGTH+1); |  | ||||||
|    memset(bodydigest, 0, 2*DIGEST_LENGTH+1); |  | ||||||
|  |  | ||||||
|    snprintf(s, SMALLBUFSIZE-1, "SELECT `id`,`digest`,`bodydigest` FROM %s WHERE piler_id=?", SQL_METADATA_TABLE); |  | ||||||
|  |  | ||||||
|    if(prepare_a_mysql_statement(sdata, &stmt, s) == ERR) goto ENDE; |  | ||||||
|  |  | ||||||
|    memset(bind, 0, sizeof(bind)); |  | ||||||
|  |  | ||||||
|    bind[0].buffer_type = MYSQL_TYPE_STRING; |  | ||||||
|    bind[0].buffer = sdata->ttmpfile; |  | ||||||
|    bind[0].is_null = 0; |  | ||||||
|    len = strlen(sdata->ttmpfile); bind[0].length = &len; |  | ||||||
|  |  | ||||||
|  |  | ||||||
|    if(mysql_stmt_bind_param(stmt, bind)){ |  | ||||||
|       goto CLOSE; |  | ||||||
|    } |  | ||||||
|  |  | ||||||
|  |  | ||||||
|    if(mysql_stmt_execute(stmt)){ |  | ||||||
|       goto CLOSE; |  | ||||||
|    } |  | ||||||
|  |  | ||||||
|  |  | ||||||
|    memset(bind, 0, sizeof(bind)); |  | ||||||
|  |  | ||||||
|    bind[0].buffer_type = MYSQL_TYPE_LONGLONG; |  | ||||||
|    bind[0].buffer = (char *)&id; |  | ||||||
|    bind[0].is_null = 0; |  | ||||||
|    bind[0].length = 0; |  | ||||||
|  |  | ||||||
|    bind[1].buffer_type = MYSQL_TYPE_STRING; |  | ||||||
|    bind[1].buffer = digest; |  | ||||||
|    bind[1].buffer_length = 2*DIGEST_LENGTH+1; |  | ||||||
|    bind[1].is_null = 0; |  | ||||||
|    bind[1].length = &len; |  | ||||||
|  |  | ||||||
|    bind[2].buffer_type = MYSQL_TYPE_STRING; |  | ||||||
|    bind[2].buffer = bodydigest; |  | ||||||
|    bind[2].buffer_length = 2*DIGEST_LENGTH+1; |  | ||||||
|    bind[2].is_null = 0; |  | ||||||
|    bind[2].length = &len; |  | ||||||
|  |  | ||||||
|    if(mysql_stmt_bind_result(stmt, bind)){ |  | ||||||
|       goto CLOSE; |  | ||||||
|    } |  | ||||||
|  |  | ||||||
|  |  | ||||||
|    if(mysql_stmt_store_result(stmt)){ |  | ||||||
|       goto CLOSE; |  | ||||||
|    } |  | ||||||
|  |  | ||||||
|    mysql_stmt_fetch(stmt); |  | ||||||
|  |  | ||||||
|  |  | ||||||
| CLOSE: |  | ||||||
|    mysql_stmt_close(stmt); |  | ||||||
|  |  | ||||||
| ENDE: |  | ||||||
|  |  | ||||||
|    return id; |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  |  | ||||||
| int main(int argc, char **argv){ | int main(int argc, char **argv){ | ||||||
|    int rc, readkey=1; |    int rc, readkey=1; | ||||||
|    struct session_data sdata; |    struct session_data sdata; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user