diff options
Diffstat (limited to 'src/my/test_my.c')
-rw-r--r-- | src/my/test_my.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/my/test_my.c b/src/my/test_my.c index 3cd6881c1..067d70a6e 100644 --- a/src/my/test_my.c +++ b/src/my/test_my.c | |||
@@ -47,8 +47,8 @@ run_queries (struct GNUNET_MYSQL_Context *context) | |||
47 | uint32_t u32; | 47 | uint32_t u32; |
48 | uint64_t u64; | 48 | uint64_t u64; |
49 | 49 | ||
50 | // struct GNUNET_MYSQL_StatementHandle *statements_handle_insert; | 50 | struct GNUNET_MYSQL_StatementHandle *statements_handle_insert; |
51 | struct GNUNET_MYSQL_StatementHandle *statements_handle_select; | 51 | // struct GNUNET_MYSQL_StatementHandle *statements_handle_select; |
52 | 52 | ||
53 | struct GNUNET_CRYPTO_RsaPrivateKey *priv; | 53 | struct GNUNET_CRYPTO_RsaPrivateKey *priv; |
54 | struct GNUNET_HashCode hmsg; | 54 | struct GNUNET_HashCode hmsg; |
@@ -62,7 +62,7 @@ run_queries (struct GNUNET_MYSQL_Context *context) | |||
62 | u32 = 32; | 62 | u32 = 32; |
63 | u64 = 64; | 63 | u64 = 64; |
64 | 64 | ||
65 | /* FIXE THE INSERT QUERY | 65 | // FIXE THE INSERT QUERY |
66 | statements_handle_insert = GNUNET_MYSQL_statement_prepare (context, | 66 | statements_handle_insert = GNUNET_MYSQL_statement_prepare (context, |
67 | "INSERT INTO test_my (" | 67 | "INSERT INTO test_my (" |
68 | " pub" | 68 | " pub" |
@@ -75,15 +75,16 @@ run_queries (struct GNUNET_MYSQL_Context *context) | |||
75 | ",u32" | 75 | ",u32" |
76 | ",u64" | 76 | ",u64" |
77 | ") VALUES " | 77 | ") VALUES " |
78 | "(@1, @2, @3, @4, @5, @6," | 78 | "(?, ?, ?, ?, ?, ?," |
79 | "@7, @8, @9);"); | 79 | "?, ?, ?)"); |
80 | 80 | ||
81 | if (NULL == statements_handle_insert) | 81 | if (NULL == statements_handle_insert) |
82 | { | 82 | { |
83 | fprintf(stderr, "Failed to prepared statement INSERT\n"); | 83 | fprintf (stderr, "Failed to prepared statement INSERT\n"); |
84 | return 1; | 84 | return 1; |
85 | } | 85 | } |
86 | 86 | ||
87 | //ERROR WITH MSG | ||
87 | struct GNUNET_MY_QueryParam params_insert[] = { | 88 | struct GNUNET_MY_QueryParam params_insert[] = { |
88 | GNUNET_MY_query_param_rsa_public_key (pub), | 89 | GNUNET_MY_query_param_rsa_public_key (pub), |
89 | GNUNET_MY_query_param_rsa_signature (sig), | 90 | GNUNET_MY_query_param_rsa_signature (sig), |
@@ -97,6 +98,9 @@ run_queries (struct GNUNET_MYSQL_Context *context) | |||
97 | GNUNET_MY_query_param_end | 98 | GNUNET_MY_query_param_end |
98 | }; | 99 | }; |
99 | 100 | ||
101 | fprintf(stderr, " u16 : %u\n", (unsigned)params_insert[6].data); | ||
102 | fprintf(stderr, " &u16 : %u\n", (unsigned)&u16); | ||
103 | |||
100 | //FAIL HERE | 104 | //FAIL HERE |
101 | if (GNUNET_OK != GNUNET_MY_exec_prepared (context, | 105 | if (GNUNET_OK != GNUNET_MY_exec_prepared (context, |
102 | statements_handle_insert, | 106 | statements_handle_insert, |
@@ -106,7 +110,8 @@ run_queries (struct GNUNET_MYSQL_Context *context) | |||
106 | "Failed to execute prepared statement\n"); | 110 | "Failed to execute prepared statement\n"); |
107 | return 22; | 111 | return 22; |
108 | } | 112 | } |
109 | */ | 113 | |
114 | /* NOT THE GOOD FUNCTION -> TO FIXE | ||
110 | statements_handle_select = GNUNET_MYSQL_statement_prepare (context, | 115 | statements_handle_select = GNUNET_MYSQL_statement_prepare (context, |
111 | "SELECT" | 116 | "SELECT" |
112 | " pub" | 117 | " pub" |
@@ -139,7 +144,7 @@ run_queries (struct GNUNET_MYSQL_Context *context) | |||
139 | fprintf (stderr, "Failed to execute prepared statement\n"); | 144 | fprintf (stderr, "Failed to execute prepared statement\n"); |
140 | return 22; | 145 | return 22; |
141 | } | 146 | } |
142 | 147 | */ | |
143 | return 0; | 148 | return 0; |
144 | } | 149 | } |
145 | 150 | ||