Skip to content
This repository was archived by the owner on Jul 14, 2019. It is now read-only.

Commit 5abd5c7

Browse files
Mark HubenschmidtLior Amram
authored andcommitted
mysql_helper: support for more data types
1 parent 0d011b7 commit 5abd5c7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/mysql_helper.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,13 @@ int mysql_helper_vstmt(struct mysql_helper *mysql_helper,
373373
pbind_ptr->is_unsigned = isupper(c) ? 1 : 0;
374374
++input;
375375
break;
376+
case 'l':
377+
ptypes[i] = MYSQL_TYPE_LONGLONG;
378+
pbind_ptr->buffer = (long long *)(*input);
379+
pnulls[i] = (pbind_ptr->buffer == NULL);
380+
pbind_ptr->is_unsigned = isupper(c) ? 1 : 0;
381+
++input;
382+
break;
376383
case 'f':
377384
ptypes[i] = MYSQL_TYPE_DOUBLE;
378385
pbind_ptr->buffer = (double *)(*input);
@@ -432,6 +439,9 @@ int mysql_helper_vstmt(struct mysql_helper *mysql_helper,
432439
case 'd':
433440
ftypes[i] = MYSQL_TYPE_LONG;
434441
break;
442+
case 'l':
443+
ftypes[i] = MYSQL_TYPE_LONGLONG;
444+
break;
435445
case 'f':
436446
ftypes[i] = MYSQL_TYPE_DOUBLE;
437447
break;
@@ -478,6 +488,11 @@ int mysql_helper_vstmt(struct mysql_helper *mysql_helper,
478488
bind_ptr->buffer_length = sizeof(int);
479489
++input;
480490
break;
491+
case 'l':
492+
bind_ptr->buffer = (long long *)(*input);
493+
bind_ptr->buffer_length = sizeof(long long);
494+
++input;
495+
break;
481496
case 'f':
482497
bind_ptr->buffer = (double *)(*input);
483498
bind_ptr->buffer_length = sizeof(double);

0 commit comments

Comments
 (0)