diff options
Diffstat (limited to 'src/my/my_query_helper.c')
-rw-r--r-- | src/my/my_query_helper.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/my/my_query_helper.c b/src/my/my_query_helper.c index ee266ddc1..a8a9ce7b6 100644 --- a/src/my/my_query_helper.c +++ b/src/my/my_query_helper.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <mysql/mysql.h> | 26 | #include <mysql/mysql.h> |
27 | #include "gnunet_my_lib.h" | 27 | #include "gnunet_my_lib.h" |
28 | 28 | ||
29 | |||
30 | /** | 29 | /** |
31 | * Function called to convert input argument into SQL parameters. | 30 | * Function called to convert input argument into SQL parameters. |
32 | * | 31 | * |
@@ -41,11 +40,13 @@ my_conv_fixed_size (void *cls, | |||
41 | MYSQL_BIND *qbind) | 40 | MYSQL_BIND *qbind) |
42 | { | 41 | { |
43 | GNUNET_assert (1 == qp->num_params); | 42 | GNUNET_assert (1 == qp->num_params); |
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->length = (unsigned long *) &qp->data_len; | ||
47 | qbind->buffer_type = 1; | 46 | qbind->buffer_type = 1; |
48 | return 0; | 47 | |
48 | //return 0; | ||
49 | return 1; | ||
49 | } | 50 | } |
50 | 51 | ||
51 | 52 | ||
@@ -99,10 +100,15 @@ my_conv_uint16 (void *cls, | |||
99 | const uint16_t *u_hbo = qp->data; | 100 | const uint16_t *u_hbo = qp->data; |
100 | uint16_t *u_nbo; | 101 | uint16_t *u_nbo; |
101 | 102 | ||
103 | fprintf(stderr, "input data : %u\n", (unsigned)u_hbo); | ||
104 | |||
102 | GNUNET_assert (1 == qp->num_params); | 105 | GNUNET_assert (1 == qp->num_params); |
103 | 106 | ||
107 | |||
104 | u_nbo = GNUNET_new (uint16_t); | 108 | u_nbo = GNUNET_new (uint16_t); |
105 | *u_nbo = htons (*u_hbo); | 109 | *u_nbo = htons (*u_hbo); |
110 | |||
111 | fprintf(stderr, "output data : %u\n", (unsigned)u_nbo); | ||
106 | qbind->buffer = (void *) u_nbo; | 112 | qbind->buffer = (void *) u_nbo; |
107 | qbind->buffer_length = sizeof(uint16_t); | 113 | qbind->buffer_length = sizeof(uint16_t); |
108 | qbind->buffer_type = 1; | 114 | qbind->buffer_type = 1; |