-
Notifications
You must be signed in to change notification settings - Fork 0
/
zp.go
2264 lines (1650 loc) · 71.9 KB
/
zp.go
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 (c) 2000-2018, 达梦数据库有限公司.
* All rights reserved.
*/
package dm
import (
"github.com/xiyichan/dm8/util"
"os"
"strconv"
"strings"
)
const (
Dm_build_0 = "7.6.0.0"
Dm_build_1 = "7.0.0.9"
Dm_build_2 = "8.0.0.73"
Dm_build_3 = "7.1.2.128"
Dm_build_4 = "7.1.5.144"
Dm_build_5 = "7.1.6.123"
Dm_build_6 = 32768 - 128
Dm_build_7 int16 = 1
Dm_build_8 int16 = 2
Dm_build_9 int16 = 3
Dm_build_10 int16 = 4
Dm_build_11 int16 = 5
Dm_build_12 int16 = 6
Dm_build_13 int16 = 7
Dm_build_14 int16 = 8
Dm_build_15 int16 = 9
Dm_build_16 int16 = 13
Dm_build_17 int16 = 14
Dm_build_18 int16 = 15
Dm_build_19 int16 = 17
Dm_build_20 int16 = 21
Dm_build_21 int16 = 24
Dm_build_22 int16 = 27
Dm_build_23 int16 = 29
Dm_build_24 int16 = 30
Dm_build_25 int16 = 31
Dm_build_26 int16 = 32
Dm_build_27 int16 = 44
Dm_build_28 int16 = 52
Dm_build_29 int16 = 60
Dm_build_30 int16 = 71
Dm_build_31 int16 = 90
Dm_build_32 int16 = 91
Dm_build_33 int16 = 200
Dm_build_34 = 64
Dm_build_35 = 20
Dm_build_36 = 0
Dm_build_37 = 4
Dm_build_38 = 6
Dm_build_39 = 10
Dm_build_40 = 14
Dm_build_41 = 18
Dm_build_42 = 19
Dm_build_43 = 128
Dm_build_44 = 256
Dm_build_45 = 0xffff
Dm_build_46 int32 = 2
Dm_build_47 = -1
Dm_build_48 uint16 = 0xFFFE
Dm_build_49 uint16 = uint16(Dm_build_48 - 3)
Dm_build_50 uint16 = Dm_build_48
Dm_build_51 int32 = 0xFFFF
Dm_build_52 int32 = 0x80
Dm_build_53 byte = 0x60
Dm_build_54 uint16 = uint16(Dm_build_50)
Dm_build_55 uint16 = uint16(Dm_build_51)
Dm_build_56 int16 = 0x00
Dm_build_57 int16 = 0x03
Dm_build_58 int32 = 0x80
Dm_build_59 byte = 0
Dm_build_60 byte = 1
Dm_build_61 byte = 2
Dm_build_62 byte = 3
Dm_build_63 byte = 4
Dm_build_64 byte = Dm_build_59
Dm_build_65 int = 10
Dm_build_66 int32 = 32
Dm_build_67 int32 = 65536
Dm_build_68 byte = 0
Dm_build_69 byte = 1
Dm_build_70 int32 = 0x00000000
Dm_build_71 int32 = 0x00000020
Dm_build_72 int32 = 0x00000040
Dm_build_73 int32 = 0x00000FFF
Dm_build_74 int32 = 0
Dm_build_75 int32 = 1
Dm_build_76 int32 = 2
Dm_build_77 int32 = 3
Dm_build_78 = 8192
Dm_build_79 = 1
Dm_build_80 = 2
Dm_build_81 = 0
Dm_build_82 = 0
Dm_build_83 = 1
Dm_build_84 = -1
Dm_build_85 int16 = 0
Dm_build_86 int16 = 1
Dm_build_87 int16 = 2
Dm_build_88 int16 = 3
Dm_build_89 int16 = 4
Dm_build_90 int16 = 127
Dm_build_91 int16 = Dm_build_90 + 20
Dm_build_92 int16 = Dm_build_90 + 21
Dm_build_93 int16 = Dm_build_90 + 22
Dm_build_94 int16 = Dm_build_90 + 24
Dm_build_95 int16 = Dm_build_90 + 25
Dm_build_96 int16 = Dm_build_90 + 26
Dm_build_97 int16 = Dm_build_90 + 30
Dm_build_98 int16 = Dm_build_90 + 31
Dm_build_99 int16 = Dm_build_90 + 32
Dm_build_100 int16 = Dm_build_90 + 33
Dm_build_101 int16 = Dm_build_90 + 35
Dm_build_102 int16 = Dm_build_90 + 38
Dm_build_103 int16 = Dm_build_90 + 39
Dm_build_104 int16 = Dm_build_90 + 51
Dm_build_105 int16 = Dm_build_90 + 71
Dm_build_106 int16 = Dm_build_90 + 124
Dm_build_107 int16 = Dm_build_90 + 125
Dm_build_108 int16 = Dm_build_90 + 126
Dm_build_109 int16 = Dm_build_90 + 127
Dm_build_110 int16 = Dm_build_90 + 128
Dm_build_111 int16 = Dm_build_90 + 129
Dm_build_112 byte = 0
Dm_build_113 byte = 2
Dm_build_114 = 2048
Dm_build_115 = -1
Dm_build_116 = 0
Dm_build_117 = 16000
Dm_build_118 = 32000
Dm_build_119 = 0x00000000
Dm_build_120 = 0x00000020
Dm_build_121 = 0x00000040
Dm_build_122 = 0x00000FFF
)
type dm_build_123 interface {
dm_build_124()
dm_build_125() error
dm_build_126()
dm_build_127(imsg dm_build_123) error
dm_build_128() error
dm_build_129() (interface{}, error)
dm_build_130()
dm_build_131(imsg dm_build_123) (interface{}, error)
dm_build_132()
dm_build_133() error
dm_build_134() byte
dm_build_135() int32
dm_build_136(length int32)
dm_build_137() int16
}
type dm_build_138 struct {
dm_build_139 *dm_build_1285
dm_build_140 int16
dm_build_141 int32
dm_build_142 *DmStatement
}
func (dm_build_144 *dm_build_138) dm_build_143(dm_build_145 *dm_build_1285, dm_build_146 int16) *dm_build_138 {
dm_build_144.dm_build_139 = dm_build_145
dm_build_144.dm_build_140 = dm_build_146
return dm_build_144
}
func (dm_build_148 *dm_build_138) dm_build_147(dm_build_149 *dm_build_1285, dm_build_150 int16, dm_build_151 *DmStatement) *dm_build_138 {
dm_build_148.dm_build_143(dm_build_149, dm_build_150).dm_build_142 = dm_build_151
return dm_build_148
}
func dm_build_152(dm_build_153 *dm_build_1285, dm_build_154 int16) *dm_build_138 {
return new(dm_build_138).dm_build_143(dm_build_153, dm_build_154)
}
func dm_build_155(dm_build_156 *dm_build_1285, dm_build_157 int16, dm_build_158 *DmStatement) *dm_build_138 {
return new(dm_build_138).dm_build_147(dm_build_156, dm_build_157, dm_build_158)
}
func (dm_build_160 *dm_build_138) dm_build_124() {
dm_build_160.dm_build_139.dm_build_1288.Dm_build_967(0)
dm_build_160.dm_build_139.dm_build_1288.Dm_build_978(Dm_build_34, true, true)
}
func (dm_build_162 *dm_build_138) dm_build_125() error {
return nil
}
func (dm_build_164 *dm_build_138) dm_build_126() {
if dm_build_164.dm_build_142 == nil {
dm_build_164.dm_build_139.dm_build_1288.Dm_build_1144(Dm_build_36, 0)
} else {
dm_build_164.dm_build_139.dm_build_1288.Dm_build_1144(Dm_build_36, dm_build_164.dm_build_142.id)
}
dm_build_164.dm_build_139.dm_build_1288.Dm_build_1140(Dm_build_37, dm_build_164.dm_build_140)
dm_build_164.dm_build_139.dm_build_1288.Dm_build_1144(Dm_build_38, int32(dm_build_164.dm_build_139.dm_build_1288.Dm_build_965()-Dm_build_34))
}
func (dm_build_166 *dm_build_138) dm_build_128() error {
dm_build_166.dm_build_139.dm_build_1288.Dm_build_970(0)
dm_build_166.dm_build_139.dm_build_1288.Dm_build_978(Dm_build_34, false, true)
return dm_build_166.dm_build_171()
}
func (dm_build_168 *dm_build_138) dm_build_129() (interface{}, error) {
return nil, nil
}
func (dm_build_170 *dm_build_138) dm_build_130() {
}
func (dm_build_172 *dm_build_138) dm_build_171() error {
dm_build_172.dm_build_141 = dm_build_172.dm_build_139.dm_build_1288.Dm_build_1222(Dm_build_39)
if dm_build_172.dm_build_141 < 0 && dm_build_172.dm_build_141 != EC_RN_EXCEED_ROWSET_SIZE.ErrCode {
return (&DmError{dm_build_172.dm_build_141, dm_build_172.dm_build_173(), nil, ""}).throw()
} else if dm_build_172.dm_build_141 > 0 {
} else if dm_build_172.dm_build_140 == Dm_build_33 || dm_build_172.dm_build_140 == Dm_build_7 {
dm_build_172.dm_build_173()
}
return nil
}
func (dm_build_174 *dm_build_138) dm_build_173() string {
dm_build_175 := dm_build_174.dm_build_139.dm_build_1289.getServerEncoding()
if dm_build_175 != "" && dm_build_175 == ENCODING_EUCKR && Locale != LANGUAGE_EN {
dm_build_175 = ENCODING_GB18030
}
dm_build_174.dm_build_139.dm_build_1288.Dm_build_978(int(dm_build_174.dm_build_139.dm_build_1288.Dm_build_1078()), false, true)
dm_build_174.dm_build_139.dm_build_1288.Dm_build_978(int(dm_build_174.dm_build_139.dm_build_1288.Dm_build_1078()), false, true)
dm_build_174.dm_build_139.dm_build_1288.Dm_build_978(int(dm_build_174.dm_build_139.dm_build_1288.Dm_build_1078()), false, true)
return dm_build_174.dm_build_139.dm_build_1288.Dm_build_1120(dm_build_175, dm_build_174.dm_build_139.dm_build_1289)
}
func (dm_build_177 *dm_build_138) dm_build_127(dm_build_178 dm_build_123) (dm_build_179 error) {
dm_build_178.dm_build_124()
if dm_build_179 = dm_build_178.dm_build_125(); dm_build_179 != nil {
return dm_build_179
}
dm_build_178.dm_build_126()
return nil
}
func (dm_build_181 *dm_build_138) dm_build_131(dm_build_182 dm_build_123) (dm_build_183 interface{}, dm_build_184 error) {
dm_build_184 = dm_build_182.dm_build_128()
if dm_build_184 != nil {
return nil, dm_build_184
}
dm_build_183, dm_build_184 = dm_build_182.dm_build_129()
if dm_build_184 != nil {
return nil, dm_build_184
}
dm_build_182.dm_build_130()
return dm_build_183, nil
}
func (dm_build_186 *dm_build_138) dm_build_132() {
dm_build_186.dm_build_139.dm_build_1288.Dm_build_1136(Dm_build_42, dm_build_186.dm_build_134())
}
func (dm_build_188 *dm_build_138) dm_build_133() error {
dm_build_189 := dm_build_188.dm_build_139.dm_build_1288.Dm_build_1216(Dm_build_42)
dm_build_190 := dm_build_188.dm_build_134()
if dm_build_189 != dm_build_190 {
return ECGO_MSG_CHECK_ERROR.throw()
}
return nil
}
func (dm_build_192 *dm_build_138) dm_build_134() byte {
dm_build_193 := dm_build_192.dm_build_139.dm_build_1288.Dm_build_1216(0)
for i := 1; i < Dm_build_42; i++ {
dm_build_193 ^= dm_build_192.dm_build_139.dm_build_1288.Dm_build_1216(i)
}
return dm_build_193
}
func (dm_build_195 *dm_build_138) dm_build_135() int32 {
return dm_build_195.dm_build_139.dm_build_1288.Dm_build_1222(Dm_build_38)
}
func (dm_build_197 *dm_build_138) dm_build_136(dm_build_198 int32) {
dm_build_197.dm_build_139.dm_build_1288.Dm_build_1144(Dm_build_38, dm_build_198)
}
func (dm_build_200 *dm_build_138) dm_build_137() int16 {
return dm_build_200.dm_build_140
}
type dm_build_201 struct {
dm_build_138
}
func dm_build_202(dm_build_203 *dm_build_1285) *dm_build_201 {
dm_build_204 := new(dm_build_201)
dm_build_204.dm_build_143(dm_build_203, Dm_build_14)
return dm_build_204
}
type dm_build_205 struct {
dm_build_138
dm_build_206 string
}
func dm_build_207(dm_build_208 *dm_build_1285, dm_build_209 *DmStatement, dm_build_210 string) *dm_build_205 {
dm_build_211 := new(dm_build_205)
dm_build_211.dm_build_147(dm_build_208, Dm_build_22, dm_build_209)
dm_build_211.dm_build_206 = dm_build_210
dm_build_211.dm_build_142.cursorName = dm_build_210
return dm_build_211
}
func (dm_build_213 *dm_build_205) dm_build_125() error {
dm_build_213.dm_build_139.dm_build_1288.Dm_build_1066(dm_build_213.dm_build_206, dm_build_213.dm_build_139.dm_build_1289.getServerEncoding(), dm_build_213.dm_build_139.dm_build_1289)
dm_build_213.dm_build_139.dm_build_1288.Dm_build_1004(1)
return nil
}
type Dm_build_214 struct {
dm_build_230
dm_build_215 []OptParameter
}
func dm_build_216(dm_build_217 *dm_build_1285, dm_build_218 *DmStatement, dm_build_219 []OptParameter) *Dm_build_214 {
dm_build_220 := new(Dm_build_214)
dm_build_220.dm_build_147(dm_build_217, Dm_build_32, dm_build_218)
dm_build_220.dm_build_215 = dm_build_219
return dm_build_220
}
func (dm_build_222 *Dm_build_214) dm_build_125() error {
dm_build_223 := len(dm_build_222.dm_build_215)
dm_build_222.dm_build_244(int16(dm_build_223), 1)
dm_build_222.dm_build_139.dm_build_1288.Dm_build_1066(dm_build_222.dm_build_142.nativeSql, dm_build_222.dm_build_142.dmConn.getServerEncoding(), dm_build_222.dm_build_142.dmConn)
for _, param := range dm_build_222.dm_build_215 {
dm_build_222.dm_build_139.dm_build_1288.Dm_build_996(param.ioType)
dm_build_222.dm_build_139.dm_build_1288.Dm_build_1004(int32(param.tp))
dm_build_222.dm_build_139.dm_build_1288.Dm_build_1004(int32(param.prec))
dm_build_222.dm_build_139.dm_build_1288.Dm_build_1004(int32(param.scale))
}
for _, param := range dm_build_222.dm_build_215 {
if param.bytes == nil {
dm_build_222.dm_build_139.dm_build_1288.Dm_build_1012(Dm_build_50)
} else {
dm_build_222.dm_build_139.dm_build_1288.Dm_build_1042(param.bytes[:len(param.bytes)])
}
}
return nil
}
func (dm_build_225 *Dm_build_214) dm_build_129() (interface{}, error) {
return dm_build_225.dm_build_230.dm_build_129()
}
const (
Dm_build_226 int = 0x01
Dm_build_227 int = 0x02
Dm_build_228 int = 0x04
Dm_build_229 int = 0x08
)
type dm_build_230 struct {
dm_build_138
dm_build_231 [][]interface{}
dm_build_232 []parameter
dm_build_233 bool
}
func dm_build_234(dm_build_235 *dm_build_1285, dm_build_236 int16, dm_build_237 *DmStatement) *dm_build_230 {
dm_build_238 := new(dm_build_230)
dm_build_238.dm_build_147(dm_build_235, dm_build_236, dm_build_237)
dm_build_238.dm_build_233 = true
return dm_build_238
}
func dm_build_239(dm_build_240 *dm_build_1285, dm_build_241 *DmStatement, dm_build_242 [][]interface{}) *dm_build_230 {
dm_build_243 := new(dm_build_230)
if dm_build_240.dm_build_1289.Execute2 {
dm_build_243.dm_build_147(dm_build_240, Dm_build_16, dm_build_241)
} else {
dm_build_243.dm_build_147(dm_build_240, Dm_build_12, dm_build_241)
}
dm_build_243.dm_build_232 = dm_build_241.params
dm_build_243.dm_build_231 = dm_build_242
dm_build_243.dm_build_233 = true
return dm_build_243
}
func (dm_build_245 *dm_build_230) dm_build_244(dm_build_246 int16, dm_build_247 int64) {
dm_build_248 := Dm_build_35
if dm_build_245.dm_build_139.dm_build_1289.autoCommit {
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1136(dm_build_248, 1)
} else {
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1136(dm_build_248, 0)
}
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1140(dm_build_248, dm_build_246)
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1136(dm_build_248, 1)
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1148(dm_build_248, dm_build_247)
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1148(dm_build_248, dm_build_245.dm_build_142.cursorUpdateRow)
if dm_build_245.dm_build_142.maxRows <= 0 || dm_build_245.dm_build_142.dmConn.dmConnector.enRsCache {
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1148(dm_build_248, INT64_MAX)
} else {
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1148(dm_build_248, dm_build_245.dm_build_142.maxRows)
}
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1136(dm_build_248, 1)
if dm_build_245.dm_build_139.dm_build_1289.dmConnector.continueBatchOnError {
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1136(dm_build_248, 1)
} else {
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1136(dm_build_248, 0)
}
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1136(dm_build_248, 0)
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1136(dm_build_248, 0)
if dm_build_245.dm_build_142.queryTimeout == 0 {
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1144(dm_build_248, -1)
} else {
dm_build_248 += dm_build_245.dm_build_139.dm_build_1288.Dm_build_1144(dm_build_248, dm_build_245.dm_build_142.queryTimeout)
}
}
func (dm_build_250 *dm_build_230) dm_build_125() error {
var dm_build_251 int16
var dm_build_252 int64
if dm_build_250.dm_build_232 != nil {
dm_build_251 = int16(len(dm_build_250.dm_build_232))
} else {
dm_build_251 = 0
}
if dm_build_250.dm_build_231 != nil {
dm_build_252 = int64(len(dm_build_250.dm_build_231))
} else {
dm_build_252 = 0
}
dm_build_250.dm_build_244(dm_build_251, dm_build_252)
if dm_build_251 > 0 {
err := dm_build_250.dm_build_253(dm_build_250.dm_build_232)
if err != nil {
return err
}
if dm_build_250.dm_build_231 != nil && len(dm_build_250.dm_build_231) > 0 {
for _, paramObject := range dm_build_250.dm_build_231 {
if err := dm_build_250.dm_build_256(paramObject); err != nil {
return err
}
}
}
}
return nil
}
func (dm_build_254 *dm_build_230) dm_build_253(dm_build_255 []parameter) error {
for _, param := range dm_build_255 {
if param.colType == CURSOR && param.ioType == IO_TYPE_OUT {
dm_build_254.dm_build_139.dm_build_1288.Dm_build_996(IO_TYPE_INOUT)
} else {
dm_build_254.dm_build_139.dm_build_1288.Dm_build_996(param.ioType)
}
dm_build_254.dm_build_139.dm_build_1288.Dm_build_1004(param.colType)
lprec := param.prec
lscale := param.scale
typeDesc := param.typeDescriptor
switch param.colType {
case ARRAY, SARRAY:
tmp, err := getPackArraySize(typeDesc)
if err != nil {
return err
}
lprec = int32(tmp)
case PLTYPE_RECORD:
tmp, err := getPackRecordSize(typeDesc)
if err != nil {
return err
}
lprec = int32(tmp)
case CLASS:
tmp, err := getPackClassSize(typeDesc)
if err != nil {
return err
}
lprec = int32(tmp)
case BLOB:
if isComplexType(int(param.colType), int(param.scale)) {
lprec = int32(typeDesc.getObjId())
if lprec == 4 {
lprec = int32(typeDesc.getOuterId())
}
}
}
dm_build_254.dm_build_139.dm_build_1288.Dm_build_1004(lprec)
dm_build_254.dm_build_139.dm_build_1288.Dm_build_1004(lscale)
switch param.colType {
case ARRAY, SARRAY:
err := packArray(typeDesc, dm_build_254.dm_build_139.dm_build_1288)
if err != nil {
return err
}
case PLTYPE_RECORD:
err := packRecord(typeDesc, dm_build_254.dm_build_139.dm_build_1288)
if err != nil {
return err
}
case CLASS:
err := packClass(typeDesc, dm_build_254.dm_build_139.dm_build_1288)
if err != nil {
return err
}
}
}
return nil
}
func (dm_build_257 *dm_build_230) dm_build_256(dm_build_258 []interface{}) error {
for i := 0; i < len(dm_build_257.dm_build_232); i++ {
if dm_build_257.dm_build_232[i].colType == CURSOR {
dm_build_257.dm_build_139.dm_build_1288.Dm_build_1000(ULINT_SIZE)
dm_build_257.dm_build_139.dm_build_1288.Dm_build_1004(dm_build_257.dm_build_232[i].cursorStmt.id)
continue
}
if dm_build_257.dm_build_232[i].ioType == IO_TYPE_OUT {
continue
}
switch dm_build_258[i].(type) {
case []byte:
if dataBytes, ok := dm_build_258[i].([]byte); ok {
if len(dataBytes) > Dm_build_45 {
return ECGO_DATA_TOO_LONG.throw()
}
dm_build_257.dm_build_139.dm_build_1288.Dm_build_1042(dataBytes)
}
case int:
if dm_build_258[i] == ParamDataEnum_Null {
dm_build_257.dm_build_139.dm_build_1288.Dm_build_1012(Dm_build_50)
} else if dm_build_258[i] == ParamDataEnum_OFF_ROW {
dm_build_257.dm_build_139.dm_build_1288.Dm_build_1000(0)
}
case lobCtl:
dm_build_257.dm_build_139.dm_build_1288.Dm_build_1012(uint16(Dm_build_49))
dm_build_257.dm_build_139.dm_build_1288.Dm_build_1032(dm_build_258[i].(lobCtl).value)
default:
panic("Bind param data failed by invalid param data type: ")
}
}
return nil
}
func (dm_build_260 *dm_build_230) dm_build_129() (interface{}, error) {
dm_build_261 := execInfo{}
dm_build_262 := dm_build_260.dm_build_142.dmConn
dm_build_263 := Dm_build_35
dm_build_261.retSqlType = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1219(dm_build_263)
dm_build_263 += USINT_SIZE
dm_build_264 := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1219(dm_build_263)
dm_build_263 += USINT_SIZE
dm_build_261.updateCount = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1225(dm_build_263)
dm_build_263 += DDWORD_SIZE
dm_build_265 := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1219(dm_build_263)
dm_build_263 += USINT_SIZE
dm_build_261.rsUpdatable = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1216(dm_build_263) != 0
dm_build_263 += BYTE_SIZE
dm_build_266 := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1219(dm_build_263)
dm_build_263 += ULINT_SIZE
dm_build_261.printLen = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1222(dm_build_263)
dm_build_263 += ULINT_SIZE
var dm_build_267 int16 = -1
if dm_build_261.retSqlType == Dm_build_100 || dm_build_261.retSqlType == Dm_build_101 {
dm_build_261.rowid = 0
dm_build_261.rsBdta = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1216(dm_build_263) == Dm_build_113
dm_build_263 += BYTE_SIZE
dm_build_267 = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1219(dm_build_263)
dm_build_263 += USINT_SIZE
dm_build_263 += 5
} else {
dm_build_261.rowid = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1225(dm_build_263)
dm_build_263 += DDWORD_SIZE
}
dm_build_261.execId = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1222(dm_build_263)
dm_build_263 += ULINT_SIZE
dm_build_261.rsCacheOffset = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1222(dm_build_263)
dm_build_263 += ULINT_SIZE
dm_build_268 := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1216(dm_build_263)
dm_build_263 += BYTE_SIZE
dm_build_269 := (dm_build_268 & 0x01) == 0x01
dm_build_270 := (dm_build_268 & 0x02) == 0x02
dm_build_262.TrxStatus = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1222(dm_build_263)
dm_build_262.setTrxFinish(dm_build_262.TrxStatus)
dm_build_263 += ULINT_SIZE
if dm_build_261.printLen > 0 {
bytes := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1099(int(dm_build_261.printLen))
dm_build_261.printMsg = Dm_build_599.Dm_build_753(bytes, 0, len(bytes), dm_build_262.getServerEncoding(), dm_build_262)
}
if dm_build_265 > 0 {
dm_build_261.outParamDatas = dm_build_260.dm_build_271(int(dm_build_265))
}
switch dm_build_261.retSqlType {
case Dm_build_102:
dm_build_262.dmConnector.localTimezone = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1075()
case Dm_build_100:
dm_build_261.hasResultSet = true
if dm_build_264 > 0 {
dm_build_260.dm_build_142.columns = dm_build_260.dm_build_280(int(dm_build_264), dm_build_261.rsBdta)
}
dm_build_260.dm_build_290(&dm_build_261, len(dm_build_260.dm_build_142.columns), int(dm_build_266), int(dm_build_267))
case Dm_build_101:
if dm_build_264 > 0 || dm_build_266 > 0 {
dm_build_261.hasResultSet = true
}
if dm_build_264 > 0 {
dm_build_260.dm_build_142.columns = dm_build_260.dm_build_280(int(dm_build_264), dm_build_261.rsBdta)
}
dm_build_260.dm_build_290(&dm_build_261, len(dm_build_260.dm_build_142.columns), int(dm_build_266), int(dm_build_267))
case Dm_build_103:
dm_build_262.IsoLevel = int32(dm_build_260.dm_build_139.dm_build_1288.Dm_build_1075())
dm_build_262.ReadOnly = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1072() == 1
case Dm_build_96:
dm_build_262.Schema = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1120(dm_build_262.getServerEncoding(), dm_build_262)
case Dm_build_93:
dm_build_261.explain = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1120(dm_build_262.getServerEncoding(), dm_build_262)
case Dm_build_97, Dm_build_99, Dm_build_98:
if dm_build_269 {
counts := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1078()
rowCounts := make([]int64, counts)
for i := 0; i < int(counts); i++ {
rowCounts[i] = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1081()
}
dm_build_261.updateCounts = rowCounts
}
if dm_build_270 {
rows := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1078()
var lastInsertId int64
for i := 0; i < int(rows); i++ {
lastInsertId = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1081()
}
dm_build_261.lastInsertId = lastInsertId
} else if dm_build_261.updateCount == 1 {
dm_build_261.lastInsertId = dm_build_261.rowid
}
if dm_build_260.dm_build_141 == EC_BP_WITH_ERROR.ErrCode {
dm_build_260.dm_build_296(dm_build_261.updateCounts)
}
case Dm_build_106:
len := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1090()
dm_build_262.OracleDateFormat = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1115(int(len), dm_build_262.getServerEncoding(), dm_build_262)
case Dm_build_108:
len := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1090()
dm_build_262.OracleTimestampFormat = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1115(int(len), dm_build_262.getServerEncoding(), dm_build_262)
case Dm_build_109:
len := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1090()
dm_build_262.OracleTimestampTZFormat = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1115(int(len), dm_build_262.getServerEncoding(), dm_build_262)
case Dm_build_107:
len := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1090()
dm_build_262.OracleTimeFormat = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1115(int(len), dm_build_262.getServerEncoding(), dm_build_262)
case Dm_build_110:
len := dm_build_260.dm_build_139.dm_build_1288.Dm_build_1090()
dm_build_262.OracleTimeTZFormat = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1115(int(len), dm_build_262.getServerEncoding(), dm_build_262)
case Dm_build_111:
dm_build_262.OracleDateLanguage = dm_build_260.dm_build_139.dm_build_1288.Dm_build_1090()
}
return &dm_build_261, nil
}
func (dm_build_272 *dm_build_230) dm_build_271(dm_build_273 int) [][]byte {
dm_build_274 := make([]int, dm_build_273)
dm_build_275 := 0
for i := 0; i < len(dm_build_272.dm_build_232); i++ {
if dm_build_272.dm_build_232[i].ioType == IO_TYPE_INOUT || dm_build_272.dm_build_232[i].ioType == IO_TYPE_OUT {
dm_build_274[dm_build_275] = i
dm_build_275++
}
}
dm_build_276 := make([][]byte, len(dm_build_272.dm_build_232))
var dm_build_277 int32
var dm_build_278 bool
var dm_build_279 []byte = nil
for i := 0; i < dm_build_273; i++ {
dm_build_278 = false
dm_build_277 = int32(dm_build_272.dm_build_139.dm_build_1288.Dm_build_1093())
if dm_build_277 == int32(Dm_build_50) {
dm_build_277 = 0
dm_build_278 = true
} else if dm_build_277 == int32(Dm_build_51) {
dm_build_277 = dm_build_272.dm_build_139.dm_build_1288.Dm_build_1078()
}
if dm_build_278 {
dm_build_276[dm_build_274[i]] = nil
} else {
dm_build_279 = dm_build_272.dm_build_139.dm_build_1288.Dm_build_1099(int(dm_build_277))
dm_build_276[dm_build_274[i]] = dm_build_279
}
}
return dm_build_276
}
func (dm_build_281 *dm_build_230) dm_build_280(dm_build_282 int, dm_build_283 bool) []column {
dm_build_284 := dm_build_281.dm_build_139.dm_build_1289.getServerEncoding()
var dm_build_285, dm_build_286, dm_build_287, dm_build_288 int16
dm_build_289 := make([]column, dm_build_282)
for i := 0; i < dm_build_282; i++ {
dm_build_289[i].InitColumn()
dm_build_289[i].colType = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1078()
dm_build_289[i].prec = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1078()
dm_build_289[i].scale = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1078()
dm_build_289[i].nullable = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1078() != 0
itemFlag := dm_build_281.dm_build_139.dm_build_1288.Dm_build_1075()
dm_build_289[i].lob = int(itemFlag)&Dm_build_227 != 0
dm_build_289[i].identity = int(itemFlag)&Dm_build_226 != 0
dm_build_289[i].readonly = int(itemFlag)&Dm_build_228 != 0
dm_build_281.dm_build_139.dm_build_1288.Dm_build_978(4, false, true)
dm_build_281.dm_build_139.dm_build_1288.Dm_build_978(2, false, true)
dm_build_285 = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1075()
dm_build_286 = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1075()
dm_build_287 = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1075()
dm_build_288 = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1075()
dm_build_289[i].name = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1115(int(dm_build_285), dm_build_284, dm_build_281.dm_build_139.dm_build_1289)
dm_build_289[i].typeName = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1115(int(dm_build_286), dm_build_284, dm_build_281.dm_build_139.dm_build_1289)
dm_build_289[i].tableName = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1115(int(dm_build_287), dm_build_284, dm_build_281.dm_build_139.dm_build_1289)
dm_build_289[i].schemaName = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1115(int(dm_build_288), dm_build_284, dm_build_281.dm_build_139.dm_build_1289)
if dm_build_281.dm_build_142.readBaseColName {
dm_build_289[i].baseName = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1128(dm_build_284, dm_build_281.dm_build_139.dm_build_1289)
}
if dm_build_289[i].lob {
dm_build_289[i].lobTabId = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1078()
dm_build_289[i].lobColId = dm_build_281.dm_build_139.dm_build_1288.Dm_build_1075()
}
}
for i := 0; i < dm_build_282; i++ {
if isComplexType(int(dm_build_289[i].colType), int(dm_build_289[i].scale)) {
strDesc := newTypeDescriptor(dm_build_281.dm_build_139.dm_build_1289)
strDesc.unpack(dm_build_281.dm_build_139.dm_build_1288)
dm_build_289[i].typeDescriptor = strDesc
}
}
return dm_build_289
}
func (dm_build_291 *dm_build_230) dm_build_290(dm_build_292 *execInfo, dm_build_293 int, dm_build_294 int, dm_build_295 int) {
if dm_build_294 > 0 {
startOffset := dm_build_291.dm_build_139.dm_build_1288.Dm_build_973()
if dm_build_292.rsBdta {
dm_build_292.rsDatas = dm_build_291.dm_build_309(dm_build_291.dm_build_142.columns, dm_build_295)
} else {
datas := make([][][]byte, dm_build_294)
for i := 0; i < dm_build_294; i++ {
datas[i] = make([][]byte, dm_build_293+1)
dm_build_291.dm_build_139.dm_build_1288.Dm_build_978(2, false, true)
datas[i][0] = dm_build_291.dm_build_139.dm_build_1288.Dm_build_1099(LINT64_SIZE)
dm_build_291.dm_build_139.dm_build_1288.Dm_build_978(2*dm_build_293, false, true)
for j := 1; j < dm_build_293+1; j++ {
colLen := dm_build_291.dm_build_139.dm_build_1288.Dm_build_1093()
if colLen == Dm_build_54 {
datas[i][j] = nil
} else if colLen != Dm_build_55 {
datas[i][j] = dm_build_291.dm_build_139.dm_build_1288.Dm_build_1099(int(colLen))
} else {
datas[i][j] = dm_build_291.dm_build_139.dm_build_1288.Dm_build_1103()
}
}
}
dm_build_292.rsDatas = datas
}
dm_build_292.rsSizeof = dm_build_291.dm_build_139.dm_build_1288.Dm_build_973() - startOffset
}
if dm_build_292.rsCacheOffset > 0 {
tbCount := dm_build_291.dm_build_139.dm_build_1288.Dm_build_1075()
ids := make([]int32, tbCount)