aboutsummaryrefslogtreecommitdiff
path: root/src/my/my_query_helper.c
diff options
context:
space:
mode:
authorChristophe Genevey Metat <genevey.christophe@gmail.com>2016-06-01 17:13:39 +0000
committerChristophe Genevey Metat <genevey.christophe@gmail.com>2016-06-01 17:13:39 +0000
commit88dd25332f857f13724442b7d60980a44fae6350 (patch)
tree2fc025e95553244b13ca9ca291bc3c1ab2b72907 /src/my/my_query_helper.c
parent1ac9ef013b0e9c737d6909ab41a38b45a3d36e43 (diff)
downloadgnunet-88dd25332f857f13724442b7d60980a44fae6350.tar.gz
gnunet-88dd25332f857f13724442b7d60980a44fae6350.zip
fixing insert query
Diffstat (limited to 'src/my/my_query_helper.c')
-rw-r--r--src/my/my_query_helper.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/my/my_query_helper.c b/src/my/my_query_helper.c
index a8a9ce7b6..4ea1b4ffe 100644
--- a/src/my/my_query_helper.c
+++ b/src/my/my_query_helper.c
@@ -43,9 +43,8 @@ my_conv_fixed_size (void *cls,
43 43
44 qbind->buffer = (void *) qp->data; 44 qbind->buffer = (void *) qp->data;
45 qbind->buffer_length = qp->data_len; 45 qbind->buffer_length = qp->data_len;
46 qbind->buffer_type = 1; 46 qbind->buffer_type = MYSQL_TYPE_BLOB;
47 47
48 //return 0;
49 return 1; 48 return 1;
50} 49}
51 50
@@ -100,18 +99,18 @@ my_conv_uint16 (void *cls,
100 const uint16_t *u_hbo = qp->data; 99 const uint16_t *u_hbo = qp->data;
101 uint16_t *u_nbo; 100 uint16_t *u_nbo;
102 101
103 fprintf(stderr, "input data : %u\n", (unsigned)u_hbo);
104
105 GNUNET_assert (1 == qp->num_params); 102 GNUNET_assert (1 == qp->num_params);
106 103
107 104
108 u_nbo = GNUNET_new (uint16_t); 105 u_nbo = GNUNET_new (uint16_t);
106 if (NULL == u_nbo)
107 return -1;
108
109 *u_nbo = htons (*u_hbo); 109 *u_nbo = htons (*u_hbo);
110 110
111 fprintf(stderr, "output data : %u\n", (unsigned)u_nbo);
112 qbind->buffer = (void *) u_nbo; 111 qbind->buffer = (void *) u_nbo;
113 qbind->buffer_length = sizeof(uint16_t); 112 qbind->buffer_length = sizeof(uint16_t);
114 qbind->buffer_type = 1; 113 qbind->buffer_type = MYSQL_TYPE_SHORT;
115 114
116 return 1; 115 return 1;
117} 116}
@@ -158,7 +157,7 @@ my_conv_uint32 (void *cls,
158 157
159 qbind->buffer = (void *) u_nbo; 158 qbind->buffer = (void *) u_nbo;
160 qbind->buffer_length = sizeof(uint32_t); 159 qbind->buffer_length = sizeof(uint32_t);
161 qbind->buffer_type = 1; 160 qbind->buffer_type = MYSQL_TYPE_LONG;
162 161
163 return 1; 162 return 1;
164} 163}
@@ -205,7 +204,7 @@ my_conv_uint64 (void *cls,
205 204
206 qbind->buffer = (void *) u_nbo; 205 qbind->buffer = (void *) u_nbo;
207 qbind->buffer_length = sizeof (uint64_t); 206 qbind->buffer_length = sizeof (uint64_t);
208 qbind->buffer_type = 1; 207 qbind->buffer_type = MYSQL_TYPE_LONGLONG;
209 208
210 return 1; 209 return 1;
211} 210}
@@ -252,7 +251,7 @@ my_conv_rsa_public_key (void *cls,
252 251
253 qbind->buffer = (void *)buf; 252 qbind->buffer = (void *)buf;
254 qbind->buffer_length = buf_size - 1; 253 qbind->buffer_length = buf_size - 1;
255 qbind->buffer_type = 1; 254 qbind->buffer_type = MYSQL_TYPE_LONG;
256 255
257 return 1; 256 return 1;
258 } 257 }
@@ -302,7 +301,7 @@ my_conv_rsa_signature (void *cls,
302 301
303 qbind->buffer = (void *)buf; 302 qbind->buffer = (void *)buf;
304 qbind->buffer_length = buf_size - 1; 303 qbind->buffer_length = buf_size - 1;
305 qbind->buffer_type = 1; 304 qbind->buffer_type = MYSQL_TYPE_LONG;
306 305
307 return 1; 306 return 1;
308} 307}