-
Notifications
You must be signed in to change notification settings - Fork 7
/
php_cubrid7.c
7000 lines (5538 loc) · 185 KB
/
php_cubrid7.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (do) 2008 Search Solution Corporation. All rights reserved by Search Solution.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* - Neither the name of the <ORGANIZATION> nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
*/
#define _CRT_SECURE_NO_WARNINGS
/************************************************************************
* IMPORTED SYSTEM HEADER FILES
************************************************************************/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#include "php_ini.h"
#include "php_globals.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "zend_exceptions.h"
#ifdef PHP_WIN32
#include <winsock.h>
#endif
/************************************************************************
* OTHER IMPORTED HEADER FILES
************************************************************************/
#include "php_cubrid7.h"
#include "php_cubrid_version.h"
#include <cas_cci.h>
#include <broker_cas_error.h>
#include <fcntl.h>
/************************************************************************
* PRIVATE DEFINITIONS
************************************************************************/
#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif
#if PHP_MINOR_VERSION < 3
//#define zend_parse_parameters_none() zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
#endif
#define CUBRID_LOB_READ_BUF_SIZE 8192
/* EXECUTE */
#define CUBRID_INCLUDE_OID 1
#define CUBRID_ASYNC 2
#define CUBRID_EXEC_QUERY_ALL 4
#define CCI_A_TYPE_UNKNOWN -1
/* ARRAY */
typedef enum
{
CUBRID_NUM = 1,
CUBRID_ASSOC = 2,
CUBRID_BOTH = CUBRID_NUM | CUBRID_ASSOC,
CUBRID_OBJECT = 4,
CUBRID_LOB = 8,
} T_CUBRID_ARRAY_TYPE;
/* CURSOR ORIGIN */
typedef enum
{
CUBRID_CURSOR_FIRST = CCI_CURSOR_FIRST,
CUBRID_CURSOR_CURRENT = CCI_CURSOR_CURRENT,
CUBRID_CURSOR_LAST = CCI_CURSOR_LAST,
} T_CUBRID_CURSOR_ORIGIN;
/* SCHEMA */
#define CUBRID_SCH_CLASS CCI_SCH_CLASS
#define CUBRID_SCH_VCLASS CCI_SCH_VCLASS
#define CUBRID_SCH_QUERY_SPEC CCI_SCH_QUERY_SPEC
#define CUBRID_SCH_ATTRIBUTE CCI_SCH_ATTRIBUTE
#define CUBRID_SCH_CLASS_ATTRIBUTE CCI_SCH_CLASS_ATTRIBUTE
#define CUBRID_SCH_METHOD CCI_SCH_METHOD
#define CUBRID_SCH_CLASS_METHOD CCI_SCH_CLASS_METHOD
#define CUBRID_SCH_METHOD_FILE CCI_SCH_METHOD_FILE
#define CUBRID_SCH_SUPERCLASS CCI_SCH_SUPERCLASS
#define CUBRID_SCH_SUBCLASS CCI_SCH_SUBCLASS
#define CUBRID_SCH_CONSTRAINT CCI_SCH_CONSTRAINT
#define CUBRID_SCH_TRIGGER CCI_SCH_TRIGGER
#define CUBRID_SCH_CLASS_PRIVILEGE CCI_SCH_CLASS_PRIVILEGE
#define CUBRID_SCH_ATTR_PRIVILEGE CCI_SCH_ATTR_PRIVILEGE
#define CUBRID_SCH_DIRECT_SUPER_CLASS CCI_SCH_DIRECT_SUPER_CLASS
#define CUBRID_SCH_PRIMARY_KEY CCI_SCH_PRIMARY_KEY
#define CUBRID_SCH_IMPORTED_KEYS CCI_SCH_IMPORTED_KEYS
#define CUBRID_SCH_EXPORTED_KEYS CCI_SCH_EXPORTED_KEYS
#define CUBRID_SCH_CROSS_REFERENCE CCI_SCH_CROSS_REFERENCE
#define CUBRID_SCH_ATTR_WITH_SYNONYM CCI_SCH_ATTR_WITH_SYNONYM
/* ERROR FACILITY */
typedef enum
{
CUBRID_FACILITY_DBMS = 1,
CUBRID_FACILITY_CAS,
CUBRID_FACILITY_CCI,
CUBRID_FACILITY_CLIENT,
} T_FACILITY_CODE;
/* error codes */
#define CUBRID_ER_INVALID_SQL_TYPE -30002
#define CUBRID_ER_CANNOT_GET_COLUMN_INFO -30003
#define CUBRID_ER_INVALID_PARAM -30006
#define CUBRID_ER_NOT_SUPPORTED_TYPE -30008
#define CUBRID_ER_TRANSFER_FAIL -30011
#define CUBRID_ER_PHP -30012
#define CUBRID_ER_PARAM_UNBIND -30015
#define CUBRID_ER_INVALID_PARAM_TYPE -30022
#define CUBRID_ER_END -31000
/* CAUTION! Also add the error message string to db_error[] */
/* Maximum length for the Cubrid data types.
*
* The max len of LOB is the max file size creatable in an external storage,
* so we ca't give the max len of LOB type, just use 1G. Please ignore it.
*/
#define MAX_CUBRID_CHAR_LEN 1073741823
#define MAX_LEN_INTEGER (10 + 1)
#define MAX_LEN_SMALLINT (5 + 1)
#define MAX_LEN_BIGINT (19 + 1)
#define MAX_LEN_FLOAT (14 + 1)
#define MAX_LEN_DOUBLE (28 + 1)
#define MAX_LEN_MONETARY (28 + 2)
#define MAX_LEN_DATE 10
#define MAX_LEN_TIME 8
#define MAX_LEN_TIMESTAMP 23
#define MAX_LEN_DATETIME MAX_LEN_TIMESTAMP
#define MAX_LEN_OBJECT MAX_CUBRID_CHAR_LEN
#define MAX_LEN_SET MAX_CUBRID_CHAR_LEN
#define MAX_LEN_MULTISET MAX_CUBRID_CHAR_LEN
#define MAX_LEN_SEQUENCE MAX_CUBRID_CHAR_LEN
#define MAX_LEN_LOB MAX_CUBRID_CHAR_LEN
/* Max Cubrid supported charsets */
#define MAX_DB_CHARSETS 6
/* In CCI, CCI_U_TYPE_UNKNOWN == CCI_U_TYPE_NULL == 0,
* so use below macro to denote the UNKNOWN type */
#define U_TYPE_UNKNOWN -1
static struct cubrid_type2name_st{
int type;
char* name;
} cubrid_type2name[] = {
{CCI_U_TYPE_UNKNOWN , "unknown"},
{CCI_U_TYPE_CHAR, "char"},
{CCI_U_TYPE_STRING, "varchar"},
{CCI_U_TYPE_NCHAR, "nchar"},
{CCI_U_TYPE_VARNCHAR, "varnchar"},
{CCI_U_TYPE_BIT, "bit"},
{CCI_U_TYPE_VARBIT, "varbit"},
{CCI_U_TYPE_NUMERIC, "numeric"},
{CCI_U_TYPE_INT, "integer"},
{CCI_U_TYPE_SHORT, "smallint"},
{CCI_U_TYPE_MONETARY, "monetary"},
{CCI_U_TYPE_FLOAT, "float"},
{CCI_U_TYPE_DOUBLE, "double"},
{CCI_U_TYPE_DATE, "date"},
{CCI_U_TYPE_TIME, "time"},
{CCI_U_TYPE_TIMESTAMP, "timestamp"},
{CCI_U_TYPE_SET, "set"},
{CCI_U_TYPE_MULTISET, "multiset"},
{CCI_U_TYPE_SEQUENCE, "sequence"},
{CCI_U_TYPE_OBJECT, "object"},
{CCI_U_TYPE_BIGINT, "bigint"},
{CCI_U_TYPE_DATETIME, "datetime"},
{CCI_U_TYPE_BLOB, "blob"},
{CCI_U_TYPE_CLOB, "clob"},
{CCI_U_TYPE_ENUM, "enum"},
};
typedef struct
{
int err_code;
char *err_msg;
} DB_ERROR_INFO;
/* Define addtion error info */
static const DB_ERROR_INFO db_error[] = {
{CUBRID_ER_INVALID_SQL_TYPE, "Invalid API call"},
{CUBRID_ER_CANNOT_GET_COLUMN_INFO, "Cannot get column info"},
{CUBRID_ER_INVALID_PARAM, "Invalid parameter"},
{CUBRID_ER_NOT_SUPPORTED_TYPE, "Invalid type"},
{CUBRID_ER_TRANSFER_FAIL, "Lob transfering error"},
{CUBRID_ER_PHP, "PHP error"},
{CUBRID_ER_PARAM_UNBIND, "Some parameter not binded"},
{CUBRID_ER_INVALID_PARAM_TYPE, "Invalid db parameter type"},
};
typedef struct
{
const char *charset_name;
const char *charset_desc;
const char *space_char;
int charset_id;
int default_collation;
int space_size;
} DB_CHARSET;
/* Define Cubrid supported charsets,
* now we only use charset_name, so just set space_char to empty */
static const DB_CHARSET db_charsets[] = {
{"ascii", "US English charset - ASCII encoding", "", 0, 0, 1},
{"raw-bits", "Uninterpreted bits - Raw encoding", "", 1, 0, 1},
{"raw-bytes", "Uninterpreted bytes - Raw encoding", "", 2, 0, 1},
{"iso8859-1", "Latin 1 charset - ISO 8859 encoding", "", 3, 0, 1},
{"ksc-euc", "KSC 5601 1990 charset - EUC encoding", "", 4, 0, 2},
{"utf-8", "UNICODE charset - UTF-8 encoding", " ", 5, 0, 1},
{"", "Unknown encoding", "", -1, 0, 0}
};
typedef struct
{
char *type_name;
T_CCI_U_TYPE cubrid_u_type;
int len;
} DB_TYPE_INFO;
/* Define Cubrid supported date types */
static const DB_TYPE_INFO db_type_info[] = {
{"NULL", CCI_U_TYPE_NULL, 0},
{"UNKNOWN", CCI_U_TYPE_UNKNOWN, MAX_LEN_OBJECT},
{"CHAR", CCI_U_TYPE_CHAR, -1},
{"STRING", CCI_U_TYPE_STRING, -1},
{"NCHAR", CCI_U_TYPE_NCHAR, -1},
{"VARNCHAR", CCI_U_TYPE_VARNCHAR, -1},
{"BIT", CCI_U_TYPE_BIT, -1},
{"VARBIT", CCI_U_TYPE_VARBIT, -1},
{"NUMERIC", CCI_U_TYPE_NUMERIC, -1},
{"NUMBER", CCI_U_TYPE_NUMERIC, -1},
{"INT", CCI_U_TYPE_INT, MAX_LEN_INTEGER},
{"SHORT", CCI_U_TYPE_SHORT, MAX_LEN_SMALLINT},
{"BIGINT", CCI_U_TYPE_BIGINT, MAX_LEN_BIGINT},
{"MONETARY", CCI_U_TYPE_MONETARY, MAX_LEN_MONETARY},
{"FLOAT", CCI_U_TYPE_FLOAT, MAX_LEN_FLOAT},
{"DOUBLE", CCI_U_TYPE_DOUBLE, MAX_LEN_DOUBLE},
{"DATE", CCI_U_TYPE_DATE, MAX_LEN_DATE},
{"TIME", CCI_U_TYPE_TIME, MAX_LEN_TIME},
{"DATETIME", CCI_U_TYPE_DATETIME, MAX_LEN_DATETIME},
{"TIMESTAMP", CCI_U_TYPE_TIMESTAMP, MAX_LEN_TIMESTAMP},
{"SET", CCI_U_TYPE_SET, MAX_LEN_SET},
{"MULTISET", CCI_U_TYPE_MULTISET, MAX_LEN_MULTISET},
{"SEQUENCE", CCI_U_TYPE_SEQUENCE, MAX_LEN_SEQUENCE},
{"RESULTSET", CCI_U_TYPE_RESULTSET, -1},
{"OBJECT", CCI_U_TYPE_OBJECT, MAX_LEN_OBJECT},
{"BLOB", CCI_U_TYPE_BLOB, MAX_LEN_LOB},
{"CLOB", CCI_U_TYPE_CLOB, MAX_LEN_LOB},
{"ENUM", CCI_U_TYPE_ENUM, -1},
};
/* DB parameters */
#define CUBRID_PARAM_ISOLATION_LEVEL CCI_PARAM_ISOLATION_LEVEL
#define CUBRID_PARAM_LOCK_TIMEOUT CCI_PARAM_LOCK_TIMEOUT
#define CUBRID_AUTOCOMMIT_FALSE CCI_AUTOCOMMIT_FALSE
#define CUBRID_AUTOCOMMIT_TRUE CCI_AUTOCOMMIT_TRUE
/* Define CUBRID DB parameters */
typedef struct
{
T_CCI_DB_PARAM parameter_id;
const char *parameter_name;
} DB_PARAMETER;
static const DB_PARAMETER db_parameters[] = {
{CCI_PARAM_ISOLATION_LEVEL, "PARAM_ISOLATION_LEVEL"},
{CCI_PARAM_LOCK_TIMEOUT, "PARAM_LOCK_TIMEOUT"},
{CCI_PARAM_MAX_STRING_LENGTH, "PARAM_MAX_STRING_LENGTH"},
{CCI_PARAM_AUTO_COMMIT, "PARAM_AUTO_COMMIT"}
};
/************************************************************************
* PRIVATE TYPE DEFINITIONS
************************************************************************/
#ifdef PHP_WIN32
typedef __int64 php_cubrid_int64_t;
typedef unsigned __int64 php_cubrid_uint64_t;
#define stricmp(s1, s2) _stricmp(s1, s2)
#define strnicmp(s1, s2, n) _strnicmp(s1, s2, n)
#define open(fd, mode, flag) _open(fd, mode, flag)
#define write(fd, buf, size) _write(fd, buf, size)
#define read(fd, buf, size) _read(fd, buf, size)
#define close(fd) _close(fd)
#define unlink(file_name) _unlink(file_name)
#define strtoll(nptr, endptr, base) _strtoi64(nptr, endptr, base)
#else
typedef long long int php_cubrid_int64_t;
typedef unsigned long long int php_cubrid_uint64_t;
#endif
typedef void *T_CCI_LOB;
typedef struct
{
T_CCI_LOB lob;
T_CCI_U_TYPE type;
php_cubrid_int64_t size;
} T_CUBRID_LOB;
typedef struct cubrid_request T_CUBRID_REQUEST;
typedef struct cubrid_lob2 T_CUBRID_LOB2;
typedef struct linked_list_node {
void *data;
struct linked_list_node *next;
} LINKED_LIST_NODE;
typedef struct linked_list {
LINKED_LIST_NODE *head;
LINKED_LIST_NODE *tail;
} LINKED_LIST;
typedef struct
{
T_CUBRID_ERROR recent_error;
int handle;
int persistent;
int affected_rows;
T_CCI_CUBRID_STMT sql_type;
LINKED_LIST *unclosed_requests;
char db_version[20];
} T_CUBRID_CONNECT;
struct cubrid_request
{
T_CUBRID_CONNECT *conn;
int handle;
int col_count;
int row_count;
int l_prepare;
int bind_num;
int *field_lengths;
short *l_bind;
int fetch_field_auto_index;
T_CCI_CUBRID_STMT sql_type;
T_CCI_COL_INFO *col_info;
T_CUBRID_LOB *lob;
T_CUBRID_LOB2 **lob2_list;
};
struct cubrid_lob2
{
T_CUBRID_CONNECT *connect;
T_CUBRID_REQUEST *request;
T_CCI_LOB lob;
T_CCI_U_TYPE type;
php_cubrid_int64_t pos;
};
/************************************************************************
* PRIVATE FUNCTION PROTOTYPES
************************************************************************/
static void php_cubrid_init_globals(zend_cubrid_globals *cubrid_globals);
static void close_cubrid_pconnect(zend_rsrc_list_entry *rsrc TSRMLS_DC);
static void close_cubrid_connect(zend_rsrc_list_entry *rsrc TSRMLS_DC);
static void close_cubrid_request(zend_rsrc_list_entry *rsrc TSRMLS_DC);
static void close_cubrid_lob(zend_rsrc_list_entry *rsrc TSRMLS_DC);
static void close_cubrid_lob2(zend_rsrc_list_entry *rsrc TSRMLS_DC);
static void close_cubrid_request_internal(T_CUBRID_REQUEST *req);
static void close_cubrid_lob_internal(T_CUBRID_LOB *lob);
static int init_error(void);
static int set_error(T_FACILITY_CODE facility, int code, char *msg, ...);
static int init_error_link(T_CUBRID_CONNECT *conn);
static int set_error_link(T_CUBRID_CONNECT *conn, int code, char *msg, ...);
static int get_error_msg(int err_code, char *buf, int buf_size);
static int handle_error(int err_code, T_CCI_ERROR *error, T_CUBRID_CONNECT *conn);
static void php_cubrid_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent);
static void php_cubrid_do_connect_with_url(INTERNAL_FUNCTION_PARAMETERS, int persistent);
static T_CUBRID_CONNECT *new_cubrid_connect(int persistent);
static T_CUBRID_REQUEST *new_cubrid_request(void);
static T_CUBRID_LOB *new_cubrid_lob(void);
static T_CUBRID_LOB2 *new_cubrid_lob2(void);
static void register_cubrid_request(T_CUBRID_CONNECT *conn, T_CUBRID_REQUEST *req);
static void php_cubrid_set_default_link(zend_resource *res);
static void php_cubrid_set_default_req_link(zend_resource *res);
static void php_cubrid_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long type, int is_object);
static int fetch_a_row(zval *arg, T_CUBRID_CONNECT *connect, int req_handle, T_CUBRID_REQUEST *reqeust, int type TSRMLS_DC);
static int type2str(T_CCI_COL_INFO *column_info, char *type_name, int type_name_len);
static int cubrid_make_set(HashTable *ht, T_CCI_SET *set);
static int cubrid_add_index_array(zval *arg, zend_ulong index, T_CCI_SET in_set TSRMLS_DC);
static int cubrid_add_assoc_array(zval *arg, char *key, T_CCI_SET in_set TSRMLS_DC);
static int cubrid_array_destroy(HashTable *ht ZEND_FILE_LINE_DC);
static int numeric_type(T_CCI_U_TYPE type);
static int get_cubrid_u_type_by_name(const char *type_name);
static int get_cubrid_u_type_len(T_CCI_U_TYPE type);
static int cubrid_lob_new(int con_h_id, T_CCI_LOB *lob, T_CCI_U_TYPE type, T_CCI_ERROR *err_buf);
static php_cubrid_int64_t cubrid_lob_size(T_CCI_LOB lob, T_CCI_U_TYPE type);
static int cubrid_lob_write(int con_h_id, T_CCI_LOB lob, T_CCI_U_TYPE type, php_cubrid_int64_t start_pos, int length, const char *buf, T_CCI_ERROR *err_buf);
static int cubrid_lob_read(int con_h_id, T_CCI_LOB lob, T_CCI_U_TYPE type, php_cubrid_int64_t start_pos, int length, char *buf, T_CCI_ERROR *err_buf);
static int cubrid_lob_free(T_CCI_LOB lob, T_CCI_U_TYPE type);
static char *php_cubrid_int64_to_str(php_cubrid_int64_t i64 TSRMLS_DC);
static int cubrid_get_charset_internal(int conn, T_CCI_ERROR *error);
static void linked_list_append(LINKED_LIST *list, void *data);
static void linked_list_delete(LINKED_LIST *list, void *data);
static int str_comp (char *class_name, char *col_name, char *in_col_name);
static char **split_string (const char *str, const char *delim, int *n);
static void free_string_array (char **array);
/************************************************************************
* INTERFACE VARIABLES
************************************************************************/
char *cci_client_name = "PHP";
ZEND_BEGIN_ARG_INFO(arginfo_cubrid_version, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_connect, 0, 0, 3)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, port)
ZEND_ARG_INFO(0, dbname)
ZEND_ARG_INFO(0, userid)
ZEND_ARG_INFO(0, passwd)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_pconnect, 0, 0, 3)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, port)
ZEND_ARG_INFO(0, dbname)
ZEND_ARG_INFO(0, userid)
ZEND_ARG_INFO(0, passwd)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_connect_with_url, 0, 0, 1)
ZEND_ARG_INFO(0, url)
ZEND_ARG_INFO(0, userid)
ZEND_ARG_INFO(0, passwd)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_pconnect_with_url, 0, 0, 1)
ZEND_ARG_INFO(0, url)
ZEND_ARG_INFO(0, userid)
ZEND_ARG_INFO(0, passwd)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_close, 0, 0, 0)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_prepare, 0, 0, 1)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, prepare_stmt)
ZEND_ARG_INFO(0, option)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_bind, 0, 0, 3)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, bind_index)
ZEND_ARG_INFO(0, bind_value)
ZEND_ARG_INFO(0, bind_value_type)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_execute, 0, 0, 1)
ZEND_ARG_INFO(0, id)
ZEND_ARG_INFO(0, sql_stmt)
ZEND_ARG_INFO(0, option)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_batch_execute, 0, 0, 1)
ZEND_ARG_INFO(0, id)
ZEND_ARG_INFO(0, sql_stmt)
ZEND_ARG_INFO(0, option)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_next_result, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_affected_rows, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_close_request, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_fetch, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, type)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_current_oid, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_column_types, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_column_names, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_move_cursor, 0, 0, 2)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, origin)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_num_rows, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_num_cols, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_get, 0, 0, 2)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_ARG_INFO(0, attr)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_put, 0, 0, 3)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_ARG_INFO(0, attr)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_drop, 0, 0, 2)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_is_instance, 0, 0, 2)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lock_read, 0, 0, 2)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lock_write, 0, 0, 2)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_get_class_name, 0, 0, 2)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_schema, 0, 0, 2)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, schema_type)
ZEND_ARG_INFO(0, class_name)
ZEND_ARG_INFO(0, attr_name)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_col_size, 0, 0, 3)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_ARG_INFO(0, attr_name)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_col_get, 0, 0, 3)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_ARG_INFO(0, attr_name)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_set_add, 0, 0, 4)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_ARG_INFO(0, attr_name)
ZEND_ARG_INFO(0, set_element)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_set_drop, 0, 0, 4)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_ARG_INFO(0, attr_name)
ZEND_ARG_INFO(0, set_element)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_seq_insert, 0, 0, 5)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_ARG_INFO(0, attr_name)
ZEND_ARG_INFO(0, index)
ZEND_ARG_INFO(0, set_element)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_seq_put, 0, 0, 5)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_ARG_INFO(0, attr_name)
ZEND_ARG_INFO(0, index)
ZEND_ARG_INFO(0, set_element)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_seq_drop, 0, 0, 4)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, oid)
ZEND_ARG_INFO(0, attr_name)
ZEND_ARG_INFO(0, index)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_get_autocommit, 0, 0, 1)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_set_autocommit, 0, 0, 2)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, mode)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_commit, 0, 0, 1)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_rollback, 0, 0, 1)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_cubrid_error_msg, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_cubrid_error_code, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_cubrid_error_code_facility, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_cubrid_errno, 0)
ZEND_ARG_INFO(0, conn)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_cubrid_error, 0)
ZEND_ARG_INFO(0, conn)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_field_name, 0, 0, 2)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_field_table, 0, 0, 2)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_field_type, 0, 0, 2)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_field_flags, 0, 0, 2)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_data_seek, 0, 0, 2)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_fetch_array, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, type)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_fetch_assoc, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_fetch_row, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_fetch_field, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_num_fields, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_free_result, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_fetch_lengths, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_fetch_object, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, class_name)
ZEND_ARG_INFO(0, params)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_field_seek, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_field_len, 0, 0, 2)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, offset)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_result, 0, 0, 2)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, row)
ZEND_ARG_INFO(0, field)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_unbuffered_query, 0, 0, 1)
ZEND_ARG_INFO(0, query)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_query, 0, 0, 1)
ZEND_ARG_INFO(0, query)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_get_charset, 0, 0, 1)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_client_encoding, 0, 0, 0)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_cubrid_get_client_info, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_get_server_info, 0, 0, 1)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_real_escape_string, 0, 0, 1)
ZEND_ARG_INFO(0, unescaped_string)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_get_db_parameter, 0, 0, 1)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_set_db_parameter, 0, 0, 3)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, param_type)
ZEND_ARG_INFO(0, param_value)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_list_dbs, 0, 0, 1)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_db_name, 0, 0, 2)
ZEND_ARG_INFO(0, result)
ZEND_ARG_INFO(0, row)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lnsert_id, 0, 0, 0)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_ping, 0, 0, 0)
ZEND_ARG_INFO(0, conn_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_new, 0, 0, 1)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, type)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_bind, 0, 0, 3)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, bind_index)
ZEND_ARG_INFO(0, bind_value)
ZEND_ARG_INFO(0, bind_value_type)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_export, 0, 0, 2)
ZEND_ARG_INFO(0, lob2_id)
ZEND_ARG_INFO(0, file_name)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_import, 0, 0, 2)
ZEND_ARG_INFO(0, lob2_id)
ZEND_ARG_INFO(0, file_name)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_read, 0, 0, 2)
ZEND_ARG_INFO(0, lob2_id)
ZEND_ARG_INFO(0, len)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_write, 0, 0, 2)
ZEND_ARG_INFO(0, lob2_id)
ZEND_ARG_INFO(0, buf)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_tell, 0, 0, 1)
ZEND_ARG_INFO(0, lob2_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_tell64, 0, 0, 1)
ZEND_ARG_INFO(0, lob2_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_seek, 0, 0, 2)
ZEND_ARG_INFO(0, lob2_id)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, origin)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_seek64, 0, 0, 2)
ZEND_ARG_INFO(0, lob2_id)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, origin)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_size, 0, 0, 1)
ZEND_ARG_INFO(0, lob2_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_size64, 0, 0, 1)
ZEND_ARG_INFO(0, lob2_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob2_close, 0, 0, 1)
ZEND_ARG_INFO(0, lob2_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob_get, 0, 0, 2)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, sql_stmt)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob_size, 0, 0, 1)
ZEND_ARG_INFO(0, lob_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob_export, 0, 0, 3)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, lob_id)
ZEND_ARG_INFO(0, file_name)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob_send, 0, 0, 2)
ZEND_ARG_INFO(0, conn_id)
ZEND_ARG_INFO(0, lob_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_lob_close, 0, 0, 1)
ZEND_ARG_INFO(0, lob_id_array)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_get_query_timeout, 0, 0, 1)
ZEND_ARG_INFO(0, req_id)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_cubrid_set_query_timeout, 0, 0, 2)
ZEND_ARG_INFO(0, req_id)
ZEND_ARG_INFO(0, timeout)
ZEND_END_ARG_INFO()
zend_function_entry cubrid_functions[] = {
ZEND_FE(cubrid_version, arginfo_cubrid_version)
ZEND_FE(cubrid_connect, arginfo_cubrid_connect)
ZEND_FE(cubrid_pconnect, arginfo_cubrid_pconnect)
ZEND_FE(cubrid_connect_with_url, arginfo_cubrid_connect_with_url)
ZEND_FE(cubrid_pconnect_with_url, arginfo_cubrid_pconnect_with_url)
ZEND_FE(cubrid_close, arginfo_cubrid_close)
ZEND_FE(cubrid_prepare, arginfo_cubrid_prepare)
ZEND_FE(cubrid_bind, arginfo_cubrid_bind)
ZEND_FE(cubrid_execute, arginfo_cubrid_execute)
ZEND_FE(cubrid_batch_execute, arginfo_cubrid_batch_execute)
ZEND_FE(cubrid_next_result, arginfo_cubrid_next_result)
ZEND_FE(cubrid_affected_rows, arginfo_cubrid_affected_rows)
ZEND_FE(cubrid_close_request, arginfo_cubrid_close_request)
ZEND_FE(cubrid_fetch, arginfo_cubrid_fetch)
ZEND_FE(cubrid_current_oid, arginfo_cubrid_current_oid)
ZEND_FE(cubrid_column_types, arginfo_cubrid_column_types)
ZEND_FE(cubrid_column_names, arginfo_cubrid_column_names)
ZEND_FE(cubrid_move_cursor, arginfo_cubrid_move_cursor)
ZEND_FE(cubrid_num_rows, arginfo_cubrid_num_rows)
ZEND_FE(cubrid_num_cols, arginfo_cubrid_num_cols)
ZEND_FE(cubrid_get, arginfo_cubrid_get)
ZEND_FE(cubrid_put, arginfo_cubrid_put)
ZEND_FE(cubrid_drop, arginfo_cubrid_drop)
ZEND_FE(cubrid_is_instance, arginfo_cubrid_is_instance)
ZEND_FE(cubrid_lock_read, arginfo_cubrid_lock_read)
ZEND_FE(cubrid_lock_write, arginfo_cubrid_lock_write)
ZEND_FE(cubrid_get_class_name, arginfo_cubrid_get_class_name)
ZEND_FE(cubrid_schema, arginfo_cubrid_schema)
ZEND_FE(cubrid_col_size, arginfo_cubrid_col_size)
ZEND_FE(cubrid_col_get, arginfo_cubrid_col_get)
ZEND_FE(cubrid_set_add, arginfo_cubrid_set_add)
ZEND_FE(cubrid_set_drop, arginfo_cubrid_set_drop)
ZEND_FE(cubrid_seq_insert, arginfo_cubrid_seq_insert)
ZEND_FE(cubrid_seq_put, arginfo_cubrid_seq_put)
ZEND_FE(cubrid_seq_drop, arginfo_cubrid_seq_drop)
ZEND_FE(cubrid_get_autocommit, arginfo_cubrid_get_autocommit)
ZEND_FE(cubrid_set_autocommit, arginfo_cubrid_set_autocommit)
ZEND_FE(cubrid_commit, arginfo_cubrid_commit)
ZEND_FE(cubrid_rollback, arginfo_cubrid_rollback)
ZEND_FE(cubrid_error_msg, arginfo_cubrid_error_msg)
ZEND_FE(cubrid_error_code, arginfo_cubrid_error_code)
ZEND_FE(cubrid_error_code_facility, arginfo_cubrid_error_code_facility)
ZEND_FE(cubrid_errno, arginfo_cubrid_errno)
ZEND_FE(cubrid_error, arginfo_cubrid_error)
ZEND_FE(cubrid_field_name, arginfo_cubrid_field_name)
ZEND_FE(cubrid_field_table, arginfo_cubrid_field_table)
ZEND_FE(cubrid_field_type, arginfo_cubrid_field_type)
ZEND_FE(cubrid_field_flags, arginfo_cubrid_field_flags)
ZEND_FE(cubrid_data_seek, arginfo_cubrid_data_seek)
ZEND_FE(cubrid_fetch_array, arginfo_cubrid_fetch_array)
ZEND_FE(cubrid_fetch_assoc, arginfo_cubrid_fetch_assoc)
ZEND_FE(cubrid_fetch_row, arginfo_cubrid_fetch_row)
ZEND_FE(cubrid_fetch_field, arginfo_cubrid_fetch_field)
ZEND_FE(cubrid_num_fields, arginfo_cubrid_num_fields)
ZEND_FE(cubrid_free_result, arginfo_cubrid_free_result)
ZEND_FE(cubrid_fetch_lengths, arginfo_cubrid_fetch_lengths)
ZEND_FE(cubrid_fetch_object, arginfo_cubrid_fetch_object)
ZEND_FE(cubrid_field_seek, arginfo_cubrid_field_seek)
ZEND_FE(cubrid_field_len, arginfo_cubrid_field_len)
ZEND_FE(cubrid_result, arginfo_cubrid_result)
ZEND_FE(cubrid_get_charset, arginfo_cubrid_get_charset)
ZEND_FE(cubrid_client_encoding, arginfo_cubrid_client_encoding)
ZEND_FE(cubrid_unbuffered_query, arginfo_cubrid_unbuffered_query)
ZEND_FE(cubrid_query, arginfo_cubrid_query)
ZEND_FE(cubrid_get_client_info, arginfo_cubrid_get_client_info)
ZEND_FE(cubrid_get_server_info, arginfo_cubrid_get_server_info)