forked from oceanbase/seekdb
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathob_sql_utils.cpp
More file actions
5365 lines (5107 loc) · 210 KB
/
Copy pathob_sql_utils.cpp
File metadata and controls
5365 lines (5107 loc) · 210 KB
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) 2025 OceanBase.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define USING_LOG_PREFIX SQL_OPT
#include "ob_sql_utils.h"
#include "sql/ob_sql.h"
#include "sql/engine/expr/ob_expr_func_part_hash.h"
#include "sql/printer/ob_select_stmt_printer.h"
#include "sql/printer/ob_insert_stmt_printer.h"
#include "sql/printer/ob_update_stmt_printer.h"
#include "sql/printer/ob_delete_stmt_printer.h"
#include "sql/rewrite/ob_transform_utils.h"
#include "observer/omt/ob_tenant_timezone_mgr.h"
#include "share/schema/ob_schema_printer.h"
#include "storage/ob_locality_manager.h"
#include "sql/engine/expr/ob_expr_lob_utils.h"
#include "share/resource_manager/ob_resource_manager.h"
#include "observer/omt/ob_tenant_srs.h"
#include "sql/resolver/ddl/ob_create_view_resolver.h"
extern "C" {
#include "sql/parser/ob_non_reserved_keywords.h"
}
using namespace oceanbase;
using namespace oceanbase::sql;
using namespace oceanbase::obmysql;
using namespace oceanbase::common;
using namespace oceanbase::share;
using namespace oceanbase::share::schema;
using namespace oceanbase::common::sqlclient;
ObSqlArrayExpandGuard::ObSqlArrayExpandGuard(ParamStore ¶ms, ObIAllocator &allocator)
: array_obj_list_(allocator),
ret_(OB_SUCCESS)
{
int &ret = ret_;
for (int64_t i = 0; OB_SUCC(ret) && i < params.count(); ++i) {
if (params.at(i).is_ext_sql_array()) {
int64_t param_addr = 0;
param_addr = params.at(i).get_ext();
const ObSqlArrayObj *array_param = reinterpret_cast<const ObSqlArrayObj*>(param_addr);
if (array_param->count_ > 0) {
ArrayObjPair array_pair(¶ms.at(i), params.at(i));
if (OB_FAIL(array_obj_list_.push_back(array_pair))) {
LOG_WARN("store array obj list failed", K(ret));
} else {
params.at(i) = array_param->data_[0];
}
}
}
}
}
ObSqlArrayExpandGuard::~ObSqlArrayExpandGuard()
{
common::ObList<ArrayObjPair, common::ObIAllocator>::iterator iter = array_obj_list_.begin();
for (; iter != array_obj_list_.end(); ++iter) {
*(iter->first) = iter->second;
}
}
int ObSQLUtils::check_enable_decimalint(const ObSQLSessionInfo *session, bool &enable_decimalint)
{
int ret = OB_SUCCESS;
enable_decimalint = false;
if (OB_ISNULL(session)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("session is null", K(ret));
} else {
enable_decimalint = (const_cast<ObSQLSessionInfo *>(session)->is_enable_decimal_int_type());
}
return ret;
}
bool ObSQLUtils::is_trans_commit_need_disconnect_err(int err)
{
bool bool_ret = true;
if (OB_SUCCESS == err
|| OB_TRANS_KILLED == err
|| OB_TRANS_CTX_NOT_EXIST == err
|| OB_TRANS_TIMEOUT == err
|| OB_TRANS_STMT_TIMEOUT == err
|| OB_TRANS_NEED_ROLLBACK == err
|| OB_TRANS_ROLLBACKED == err
|| OB_NOT_MASTER == err
|| OB_TRANS_IS_EXITING == err) {
bool_ret = false;
}
return bool_ret;
}
void ObSQLUtils::check_if_need_disconnect_after_end_trans(const int end_trans_err,
const bool is_rollback,
const bool is_explicit,
bool &is_need_disconnect)
{
// 1.For commit operation (whether implicit or explicit), when a failure occurs and the transaction module does not explicitly specify an error code, a disconnect operation is taken.
// 2.For explicit rollback operations, if it fails, since the client will not know how to handle it even if they receive an error code, therefore, we uniformly disconnect the connection.
// 3.For implicit rollback operation, if it fails, this situation is autocommit=1, due to frequent rollback failures in distributed queries with autocommit=1,
// So this situation keeps connecting, if there are special cases that need to disconnect under this situation, you need to add the disconnection logic yourself after calling implicit_end_trans in the outer layer.
is_need_disconnect = false;
if (is_rollback) {
// rollback
if (OB_UNLIKELY(OB_SUCCESS != end_trans_err && is_explicit)) {
// Explicit rollback failed, need to disconnect
is_need_disconnect = true;
LOG_WARN_RET(end_trans_err, "fail to rollback explicitly, disconnect", K(end_trans_err));
} else {
// Implicit rollback (regardless of success or failure), or explicit rollback success, no need to disconnect
is_need_disconnect = false;
}
} else {
// commit
if (OB_UNLIKELY(ObSQLUtils::is_trans_commit_need_disconnect_err(end_trans_err))) {
is_need_disconnect = true;
LOG_WARN_RET(end_trans_err, "fail to commit, and error number is unexpected, disconnect", K(end_trans_err), K(lbt()));
} else {
is_need_disconnect = false;
}
}
}
int ObSQLUtils::md5(const ObString &stmt, char *sql_id, int32_t len)
{
const int32_t MD5_LENGTH = 16;
int ret = OB_SUCCESS;
if (sql_id == NULL || len < 32) {
ret = OB_INVALID_ARGUMENT;
SQL_PC_LOG(WARN, "invalid args", KP(sql_id), K(len));
}
char md5_sum_buf[MD5_LENGTH];
ObString::obstr_size_t md5_sum_len = MD5_LENGTH;
if (OB_SUCC(ret)) {
unsigned char *res = MD5(reinterpret_cast<const unsigned char *>(stmt.ptr()),
stmt.length(),
reinterpret_cast<unsigned char *>(md5_sum_buf));
if (OB_ISNULL(res)) {
// MD5() in openssl always return an pointer not NULL, so we need not check return value.
// see:
// http://www.openssl.org/docs/crypto/md5.html#DESCRIPTION
// http://www.openssl.org/docs/crypto/md5.html#RETURN_VALUES
// Even so, we HAVE TO check it here. You know it.
ret = OB_ERR_UNEXPECTED;
LOG_WARN("md5 res null pointer", K(ret), K(res));
} else if (OB_FAIL(to_hex_cstr(md5_sum_buf, md5_sum_len, sql_id, len))) {
LOG_WARN("transform to hex str error", K(ret));
} else { }//do nothing
}
return ret;
}
int ObSQLUtils::has_outer_join_symbol(const ParseNode *node, bool &has)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(node)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpect null pointer", K(node), K(ret));
} else if (node->type_ == T_OP_ORACLE_OUTER_JOIN_SYMBOL) {
has = true;
}
for (int64_t i = 0 ; OB_SUCC(ret) && !has && i < node->num_child_; i++) {
if (NULL == node->children_[i]) {
//do nothing
} else if (OB_FAIL(SMART_CALL(has_outer_join_symbol(node->children_[i], has)))) {
LOG_WARN("check has_outer_join_symbol fail", K(ret));
}
}
return ret;
}
int ObSQLUtils::replace_questionmarks(ParseNode *tree,
const ParamStore ¶ms)
{
int ret = OB_SUCCESS;
bool is_stack_overflow = false;
if (OB_FAIL(check_stack_overflow(is_stack_overflow))) {
LOG_WARN("failed to check stack overflow", K(ret), K(is_stack_overflow));
} else if (is_stack_overflow) {
ret = OB_SIZE_OVERFLOW;
LOG_WARN("too deep recursive", K(ret), K(is_stack_overflow));
} else if (NULL != tree) {
// replace ? with given params
if (T_QUESTIONMARK == tree->type_) {
const ObObj ¶m = params.at(tree->value_);
switch (param.get_type()) {
case ObIntType:
tree->value_ = param.get_int();
tree->type_ = T_INT;
break;
case ObDateTimeType:
tree->value_ = param.get_datetime();
tree->type_ = T_DATETIME;
break;
case ObTimestampType:
tree->value_ = param.get_timestamp();
tree->type_ = T_TIMESTAMP;
break;
case ObDateType:
tree->value_ = param.get_date();
tree->type_ = T_DATE;
break;
case ObTimeType:
tree->value_ = param.get_time();
tree->type_ = T_TIME;
break;
case ObYearType:
tree->value_ = param.get_year();
tree->type_ = T_YEAR;
break;
case ObVarcharType:
tree->str_value_ = param.get_varchar().ptr();
tree->str_len_ = param.get_varchar().length();
tree->type_ = T_VARCHAR;
break;
case ObTinyIntType:
tree->value_ = param.get_bool();
tree->type_ = T_BOOL;
break;
case ObNumberType:
tree->str_value_ = param.get_number().format();
tree->type_ = T_NUMBER;
break;
default:
LOG_WARN("never reach here", "type", param.get_type());
break;
}
}
for (int32_t i = 0; OB_SUCC(ret) && i < tree->num_child_; ++i) {
if (OB_ISNULL(tree->children_)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("invalid argument");
} else {
ret = SMART_CALL(replace_questionmarks(tree->children_[i], params));
}
}
}
return ret;
}
/**
* @brief calculate the result of the const or calculable expr
* @param[in] exec_ctx: exec context
* @param[in] raw_expr: input expr, must be const or calculable expr
* @param[out] result: result obj
* @param[out] is_valid: whether the result is valid when ignore_failure == true
* @param[out] allocator: used to deep copy result
* @param[in] ignore_failure: whether ignore failure when calc failed
* @param[out] constraints: add calc failure constraint when calc failed, used in query range
*/
int ObSQLUtils::calc_const_or_calculable_expr(
ObExecContext *exec_ctx,
const ObRawExpr *raw_expr,
ObObj &result,
bool &is_valid,
ObIAllocator &allocator,
bool ignore_failure /* = true*/,
ObIArray<ObExprConstraint> *constraints /* = NULL */)
{
int ret = OB_SUCCESS;
const ParamStore *params = NULL;
is_valid = false;
if (OB_ISNULL(raw_expr) || OB_ISNULL(exec_ctx) || OB_ISNULL(exec_ctx->get_physical_plan_ctx())) {
ret = OB_INVALID_ARGUMENT;
SQL_LOG(WARN, "Input arguments error", K(raw_expr), K(exec_ctx), K(ret));
} else if (FALSE_IT(params = &exec_ctx->get_physical_plan_ctx()->get_param_store())) {
} else if (raw_expr->is_const_raw_expr()) {
bool need_check = false;
if (OB_FAIL(calc_const_expr(raw_expr, params, result, need_check))) {
SQL_LOG(WARN, "failed to calc const expr", K(ret));
} else {
is_valid = true;
}
} else if (raw_expr->is_static_scalar_const_expr()) {
bool hit_cache = false;
if (OB_FAIL(get_result_from_ctx(*exec_ctx, raw_expr, result, is_valid, hit_cache))) {
LOG_WARN("failed to get result from ctx", K(ret));
} else if (hit_cache && (is_valid || ignore_failure)) {
// do nothing
} else if (OB_FAIL(calc_const_expr(*exec_ctx, raw_expr,
result, allocator, *params))) {
if (T_FUN_SYS_INNER_ROW_CMP_VALUE == raw_expr->get_expr_type()) {
if (ret == OB_ERR_MIN_VALUE) {
result.set_min_value();
is_valid = true;
ret = OB_SUCCESS;
} else if (ret == OB_ERR_MAX_VALUE) {
result.set_max_value();
is_valid = true;
ret = OB_SUCCESS;
}
}
if (ignore_failure && !IS_SPATIAL_EXPR(raw_expr->get_expr_type())) {
LOG_TRACE("failed to calc const expr, ignore the failure", K(ret));
ret = OB_SUCCESS;
}
} else {
is_valid = true;
}
if (OB_SUCC(ret) && !hit_cache) {
if (OB_FAIL(store_result_to_ctx(*exec_ctx, raw_expr, result, is_valid))) {
LOG_WARN("failed to store result to ctx", K(ret));
}
}
bool add_calc_failure_cons = false;
if (OB_SUCC(ret) && T_FUN_SYS_INNER_ROW_CMP_VALUE == raw_expr->get_expr_type()) {
if (result.is_min_value() || result.is_max_value()) {
add_calc_failure_cons = true;
}
}
if (OB_SUCC(ret) && (!is_valid || add_calc_failure_cons)) {
if (NULL == constraints) {
// do nothing
} else if (OB_FAIL(add_calc_failure_constraint(raw_expr, *constraints))) {
LOG_WARN("failed to add calc failure constraint", K(ret));
}
}
} else {
ret = OB_INVALID_ARGUMENT;
SQL_LOG(WARN, "Expr should be const_expr or calculable_expr", K(*raw_expr), K(ret));
}
return ret;
}
int ObSQLUtils::calc_simple_expr_without_row(
ObSQLSessionInfo *session,
const ObRawExpr *raw_expr,
ObObj &result,
const ParamStore *params,
ObIAllocator &allocator,
bool force_copy_extend_type)
{
int ret = OB_SUCCESS;
ObRawExprFactory expr_factory(allocator);
if (OB_ISNULL(raw_expr) || OB_ISNULL(params)) {
ret = OB_INVALID_ARGUMENT;
SQL_LOG(WARN, "Input arguments error", K(raw_expr), K(params), K(ret));
} else if (raw_expr->has_flag(CNT_SEQ_EXPR)) {
// skip accuracy check when default value includes sequence expr.
result.set_null();
} else if (raw_expr->is_const_raw_expr()) {
bool need_check = false;
if (OB_FAIL(calc_const_expr(raw_expr, params, result, need_check))) {
SQL_LOG(WARN, "failed to calc const expr", KPC(raw_expr), K(ret));
} else { /*do nothing*/ }
} else if (OB_FAIL(calc_const_expr(session, *raw_expr, result, allocator, *params, NULL, force_copy_extend_type))) {
SQL_LOG(WARN, "Get const_expr value error", KPC(raw_expr), K(ret));
}
return ret;
}
// Clear expression's evaluation flag (children's evaluation flags are cascaded cleared too)
// to make expression be evaluated again.
//
// NOTE: this evaluation flag clear method can only be used in PL expression which
// evaluate value without row. This is why we implement this function here instead of making
// it a member function of ObExpr, otherwise it will be abused in SQL Engine.
void ObSQLUtils::clear_expr_eval_flags(const ObExpr &expr, ObEvalCtx &ctx)
{
if (expr.eval_func_ != NULL || T_OP_ROW == expr.type_) {
// The eval_func_ of the T_OP_ROW expression is null, causing the issue where the evaluation
// flag of the child expressions is not cleared. For more detail, see issue
//
expr.get_eval_info(ctx).clear_evaluated_flag();
for (int64_t i = 0; i < expr.arg_cnt_; i++) {
clear_expr_eval_flags(*expr.args_[i], ctx);
}
}
}
int ObSQLUtils::clear_expr_eval_flags_norecursive(const ObExpr &expr, ObEvalCtx &ctx)
{
int ret = OB_SUCCESS;
ObSEArray<const ObExpr*, 8> exprs;
if (OB_FAIL(exprs.push_back(&expr))) {
LOG_WARN("failed to push back", K(ret));
}
if (OB_SUCC(ret)) {
do {
const ObExpr *current = NULL;
if (OB_FAIL(exprs.pop_back(current))) {
LOG_WARN("failed to push back", K(ret));
} else {
if (current->eval_func_ != NULL || T_OP_ROW == current->type_) {
current->get_eval_info(ctx).clear_evaluated_flag();
}
for (int64_t i = 0; OB_SUCC(ret) && i < current->arg_cnt_; i++) {
if (OB_FAIL(exprs.push_back(current->args_[i]))) {
LOG_WARN("failed to push back", K(ret));
}
}
}
} while (exprs.count() > 0 && OB_SUCCESS == ret);
}
return ret;
}
int ObSQLUtils::calc_sql_expression_without_row(
ObExecContext &exec_ctx,
const ObISqlExpression &expr,
ObObj &result,
ObIAllocator *allocator)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(exec_ctx.get_physical_plan_ctx())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("physical plan context is NULL", K(ret));
} else if (OB_ISNULL(exec_ctx.get_my_session())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("session is NULL", K(ret));
} else {
const sql::ObExpr *new_expr = expr.get_expr();
exec_ctx.get_physical_plan_ctx()->set_cur_time(ObTimeUtility::current_time(), *exec_ctx.get_my_session());
if (NULL == new_expr) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("static engine should have implement this function. unexpected null", K(ret));
} else {
ObDatum *datum = NULL;
ObEvalCtx eval_ctx(exec_ctx, allocator);
OZ (clear_expr_eval_flags_norecursive(*new_expr, eval_ctx));
OZ (new_expr->eval(eval_ctx, datum)); // sql exprs called here
OZ (datum->to_obj(result, new_expr->obj_meta_, new_expr->obj_datum_map_));
}
}
return ret;
}
int ObSQLUtils::calc_const_expr(const ObRawExpr *expr,
const ParamStore *params,
common::ObObj &result,
bool &need_check)
{
int ret = OB_SUCCESS;
const ObConstRawExpr *const_expr = NULL;
need_check = false;
if (OB_ISNULL(expr)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null", K(expr), K(ret));
} else if (OB_UNLIKELY(!expr->is_const_raw_expr())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("not const expr", K(expr->get_expr_type()), K(ret));
} else if (FALSE_IT(const_expr = static_cast<const ObConstRawExpr *>(expr))) {
// do nothing
} else if (T_QUESTIONMARK == const_expr->get_expr_type()) {
if (OB_ISNULL(params)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get unexpected null", K(params), K(ret));
} else if (OB_FAIL(get_param_value(const_expr->get_value(), *params, result, need_check))) {
LOG_WARN("get param value error", K(ret));
} else { /*do nothing*/ }
} else {
need_check = true;
result = const_expr->get_value();
}
return ret;
}
int ObSQLUtils::calc_calculable_expr(ObSQLSessionInfo *session,
const ObRawExpr *expr,
ObObj &result,
ObIAllocator *allocator,
const ParamStore ¶ms_array)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(expr) || OB_ISNULL(allocator)) {
ret = OB_INVALID_ARGUMENT;
SQL_LOG(WARN, "Invalid arguments", K(expr), K(allocator));
} else if (!expr->is_static_scalar_const_expr()) {
ret = OB_INVALID_ARGUMENT;
SQL_LOG(WARN, "expr should be calculable expr", K(*expr), K(ret));
} else if (OB_FAIL(calc_const_expr(session,
*expr,
result,
*allocator,
params_array))) {
SQL_LOG(WARN, "failed to calc const expr", K(*expr), K(ret));
} else { /*do nothing*/ }
return ret;
}
int ObSQLUtils::calc_const_expr(ObExecContext &exec_ctx,
const ObRawExpr *expr,
ObObj &result,
ObIAllocator &allocator,
const ParamStore ¶ms_array)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(expr)) {
ret = OB_INVALID_ARGUMENT;
SQL_LOG(WARN, "Invalid arguments", K(expr));
} else if (OB_FAIL(calc_const_expr(exec_ctx.get_my_session(),
*expr,
result,
allocator,
params_array,
&exec_ctx))) {
SQL_LOG(WARN, "failed to calc const expr", K(*expr), K(ret));
} else { /*do nothing*/ }
return ret;
}
int ObSQLUtils::calc_const_expr(ObSQLSessionInfo *session,
const ObRawExpr &expr,
ObObj &result,
ObIAllocator &allocator,
const ParamStore ¶ms_array,
ObExecContext* exec_ctx,
bool force_copy_extend_type)
{
int ret = OB_SUCCESS;
if (OB_ISNULL(session)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid null session", K(ret));
} else {
if (OB_FAIL(se_calc_const_expr(session, &expr, params_array, allocator, exec_ctx, result, force_copy_extend_type))) {
LOG_WARN("failed to calc const expr", K(ret));
}
}
return ret;
}
int ObSQLUtils::se_calc_const_expr(ObSQLSessionInfo *session,
const ObRawExpr *expr,
const ParamStore ¶ms,
ObIAllocator &allocator,
ObExecContext *out_ctx,
common::ObObj &result,
bool force_copy_extend_type)
{
int ret = OB_SUCCESS;
OB_ASSERT(NULL != session);
lib::ContextParam param;
param.set_mem_attr(session->get_effective_tenant_id(), "CalcConstExpr",
ObCtxIds::DEFAULT_CTX_ID)
.set_properties(lib::USE_TL_PAGE_OPTIONAL)
.set_page_size(OB_MALLOC_BIG_BLOCK_SIZE);
bool use_tmp_phy_plan_ctx = !(out_ctx != NULL
&& out_ctx->get_physical_plan_ctx() != NULL
&& (¶ms == &out_ctx->get_physical_plan_ctx()->get_param_store()));
if (!use_tmp_phy_plan_ctx && !out_ctx->get_physical_plan_ctx()->is_param_datum_frame_inited()) {
out_ctx->get_physical_plan_ctx()->set_rich_format(session->use_rich_format());
if (OB_FAIL(out_ctx->get_physical_plan_ctx()->init_datum_param_store())) {
LOG_WARN("init datum param store failed", K(ret));
}
}
CREATE_WITH_TEMP_CONTEXT(param) {
ObIAllocator &tmp_allocator = CURRENT_CONTEXT->get_arena_allocator();
ObPhysicalPlanCtx tmp_phy_plan_ctx(tmp_allocator);
ObPhysicalPlanCtx *phy_plan_ctx = nullptr;
if (out_ctx != NULL
&& out_ctx->get_physical_plan_ctx() != NULL
&& (¶ms == &out_ctx->get_physical_plan_ctx()->get_param_store())) {
phy_plan_ctx = out_ctx->get_physical_plan_ctx();
} else {
phy_plan_ctx = &tmp_phy_plan_ctx;
phy_plan_ctx->set_rich_format(session->use_rich_format());
for (int i = 0; OB_SUCC(ret) && i < params.count(); i++) {
if (OB_FAIL(phy_plan_ctx->get_param_store_for_update().push_back(params.at(i)))) {
LOG_WARN("failed to push back element", K(ret));
}
} // end for
if (OB_FAIL(ret)) {
} else if (OB_FAIL(phy_plan_ctx->init_datum_param_store())) {
LOG_WARN("init datum param store failed", K(ret));
}
}
// pass the outside timeout timestamp if available
if (OB_FAIL(ret)) {
} else if (NULL != out_ctx && NULL != out_ctx->get_physical_plan_ctx()) {
phy_plan_ctx->set_timeout_timestamp(
out_ctx->get_physical_plan_ctx()->get_timeout_timestamp());
}
if (OB_FAIL(ret)) {
} else if (expr != NULL && OB_FAIL(expr->fast_check_status())) {
LOG_WARN("check status failed", K(ret));
}
if (OB_FAIL(ret)) {
} else {
ObSchemaGetterGuard *schema_guard = NULL;
if (NULL != out_ctx) {
if (OB_ISNULL(out_ctx->get_sql_ctx())) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("get nul sql ctx", K(ret));
} else {
schema_guard = out_ctx->get_sql_ctx()->schema_guard_;
}
} else {
schema_guard = &session->get_cached_schema_guard_info().get_schema_guard();
}
uint64_t effective_tenant_id = session->get_effective_tenant_id();
if (session->get_ddl_info().is_ddl_check_default_value()) {
effective_tenant_id = OB_SERVER_TENANT_ID;
}
SMART_VARS_2((ObExecContext, exec_ctx, tmp_allocator),
(ObStaticEngineExprCG, expr_cg, tmp_allocator,
session, schema_guard,
phy_plan_ctx->get_original_param_cnt(),
phy_plan_ctx->get_datum_param_store().count(),
(NULL != out_ctx ? out_ctx->get_min_cluster_version() : GET_MIN_CLUSTER_VERSION()))) {
LinkExecCtxGuard link_guard(*session, exec_ctx);
exec_ctx.set_my_session(session);
exec_ctx.set_mem_attr(ObMemAttr(effective_tenant_id,
ObModIds::OB_SQL_EXEC_CONTEXT,
ObCtxIds::EXECUTE_CTX_ID));
exec_ctx.set_physical_plan_ctx(phy_plan_ctx);
if (NULL != out_ctx) {
exec_ctx.set_sql_ctx(out_ctx->get_sql_ctx());
if (NULL != out_ctx->get_original_package_guard()) {
exec_ctx.set_package_guard(out_ctx->get_original_package_guard());
}
if (NULL != out_ctx->get_physical_plan_ctx() && use_tmp_phy_plan_ctx) {
ObSubSchemaCtx & subschema_ctx = out_ctx->get_physical_plan_ctx()->get_subschema_ctx();
int tmp_ret = OB_SUCCESS;
if (OB_TMP_FAIL(exec_ctx.get_physical_plan_ctx()->get_subschema_ctx().assgin(subschema_ctx))) {
LOG_WARN("failed to assgin subschema_ctx", K(tmp_ret));
}
}
}
void *frame_buf = NULL;
ObPreCalcExprFrameInfo *pre_calc_frame = NULL;
ObRawExpr *copied_expr = NULL;
ObRawExprFactory expr_factory(tmp_allocator);
ObExpr *calc_expr = nullptr;
if (OB_FAIL(ObRawExprCopier::copy_expr(expr_factory, expr, copied_expr))) {
LOG_WARN("failed to copy raw expr", K(ret));
} else if (OB_ISNULL(copied_expr)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected null expr", K(ret), K(expr), K(copied_expr));
} else if (OB_ISNULL(frame_buf = tmp_allocator.alloc(sizeof(ObPreCalcExprFrameInfo)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("failed to allocate memory", K(ret));
} else {
pre_calc_frame = new(frame_buf)ObPreCalcExprFrameInfo(tmp_allocator);
if (OB_FAIL(expr_cg.generate_calculable_expr(copied_expr, *pre_calc_frame, calc_expr))) {
LOG_WARN("failed to generate calculable expr", K(ret));
// set current time before do pre calculation
} else if (OB_ISNULL(calc_expr)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("invalid null expr", K(ret));
} else if (FALSE_IT(phy_plan_ctx->set_cur_time(ObTimeUtility::current_time(), *session))) {
// do nothing
} else if (FALSE_IT(phy_plan_ctx->set_last_trace_id(session->get_last_trace_id()))) {
// do nothing
} else if (OB_FAIL(ObPlanCacheObject::pre_calculation(false,
*pre_calc_frame,
exec_ctx))) {
LOG_WARN("failed to pre calculate", K(ret));
} else {
ObDatum res_datum;
ObObj tmp_result;
ObEvalCtx eval_ctx(exec_ctx);
if (FALSE_IT(res_datum = calc_expr->locate_expr_datum(eval_ctx))) {
LOG_WARN("locate expr datum failed", K(ret));
} else if (OB_FAIL(res_datum.to_obj(tmp_result, calc_expr->obj_meta_))) {
LOG_WARN("to object failed", K(ret));
} else if (!tmp_result.is_ext()) {
if (OB_FAIL(deep_copy_obj(allocator, tmp_result, result))) {
LOG_WARN("failed to deep copy obj", K(ret));
}
} else {
// ext type
if (force_copy_extend_type) {
// should call ObUserDefinedType::destruct_obj later
// fix bug:
// create table udt_t1 (
// id int,
// x1 sdo_geometry DEFAULT
// sdo_geometry(2002, null, null,
// sdo_elem_info_array (1,2,1),
// sdo_ordinate_array (10,25, 20,30, 25,25, 30,30)));
if (OB_FAIL(pl::ObUserDefinedType::deep_copy_obj(allocator, tmp_result, result))) {
LOG_WARN("failed to deep copy pl extend obj", K(ret), K(tmp_result));
}
} else if (OB_NOT_NULL(out_ctx)) {
// fix bug:
// create table xml_test(id varchar2(200) primary key not null,mm xmltype constraint xmltype not null ,ls clob ,tag varchar2(2200),tt clob);
// insert into xml_test(id,mm) select 1,xmltype('<c>123</c>') from dual;
if (OB_FAIL(pl::ObUserDefinedType::deep_copy_obj(out_ctx->get_allocator(), tmp_result, result))) {
LOG_WARN("failed to deep copy pl extend obj", K(ret), K(tmp_result));
} else if (OB_ISNULL(out_ctx->get_pl_ctx())) {
if (OB_FAIL(out_ctx->init_pl_ctx())) {
LOG_WARN("failed to init pl ctx", K(ret));
}
}
if (OB_FAIL(ret)) {
} else if (OB_ISNULL(out_ctx->get_pl_ctx())) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("pl ctx is null", K(ret));
} else if (OB_FAIL(out_ctx->get_pl_ctx()->add(result))) {
LOG_WARN("failed to add pl obj to pl ctx", K(ret));
}
} else { // shallow copy extend type
if (OB_FAIL(deep_copy_obj(allocator, tmp_result, result))) {
LOG_WARN("failed to deep copy obj", K(ret));
}
}
}
}
}
if (NULL != out_ctx && NULL != out_ctx->get_original_package_guard()) {
// avoid out_ctx.package_guard_ be freed
exec_ctx.set_package_guard(NULL);
}
// must set to null, otherwise, out_ctx->phy_plan_ctx_ maybe destroy
exec_ctx.set_physical_plan_ctx(nullptr);
}
}
}
return ret;
}
int ObSQLUtils::check_and_convert_db_name(const ObCollationType cs_type, const bool preserve_lettercase,
ObString &name)
{
/*If the byte count of database name is greater than 384, report OB_WRONG_DB_NAME;
*If the byte count of database name is greater than 128 and less than or equal to 384, report OB_ERR_TOO_LONG_IDENT;
*If the last character of database name is a space, report OB_WRONG_DB_NAME;
*If the prefix of database name is #mysql50#, and it ends with any of the following four characters, '.', '~', '/', '\', report OB_WRONG_DB_NAME;
*/
int ret = OB_SUCCESS;
UNUSED(cs_type);
ObString origin_name = name;
int64_t name_len = name.length();
const char *name_str = name.ptr();
int32_t max_database_name_length = OB_MAX_DATABASE_NAME_LENGTH;
if (0 == name_len || name_len > (max_database_name_length * OB_MAX_CHAR_LEN)) {
ret = OB_WRONG_DB_NAME;
LOG_USER_ERROR(OB_WRONG_DB_NAME, static_cast<int32_t>(name_len), name_str);
LOG_WARN("incorrect database name", K(name), K(ret));
} else {
bool check_for_path_chars = check_mysql50_prefix(name);
if (check_for_path_chars) {
name_str += OB_MYSQL50_TABLE_NAME_PREFIX_LENGTH;
name_len -= OB_MYSQL50_TABLE_NAME_PREFIX_LENGTH;
}
ObString last_name(name_len, name_str);
if (!preserve_lettercase
|| (lib::is_mysql_mode() && 0 == name.case_compare(OB_INFORMATION_SCHEMA_NAME))) {
ObCharset::casedn(CS_TYPE_UTF8MB4_BIN, last_name);
}
if (OB_ERR_WRONG_IDENT_NAME == (ret = check_ident_name(cs_type, last_name, check_for_path_chars,
max_database_name_length))) {
ret = OB_WRONG_DB_NAME;
LOG_USER_ERROR(OB_WRONG_DB_NAME, static_cast<int32_t>(origin_name.length()), origin_name.ptr());
LOG_WARN("Incorrect database name", K(origin_name), K(ret));
} else if (OB_ERR_TOO_LONG_IDENT == ret) {
LOG_USER_ERROR(OB_ERR_TOO_LONG_IDENT, static_cast<int32_t>(origin_name.length()), origin_name.ptr());
LOG_WARN("database name is too long", K(origin_name), K(ret));
} else if (OB_FAIL(ret)) {
LOG_WARN("fail to check ident name", K(origin_name), K(ret));
} else {
name = last_name;
}
}
return ret;
}
/* Replace user input dbname with the case of the database internally stored */
int ObSQLUtils::cvt_db_name_to_org(share::schema::ObSchemaGetterGuard &schema_guard,
const ObSQLSessionInfo *session,
common::ObString &name,
ObIAllocator *allocator)
{
int ret = OB_SUCCESS;
if (lib::is_mysql_mode() && session != NULL && !session->is_inner()) {
ObNameCaseMode case_mode = OB_NAME_CASE_INVALID;
if (OB_FAIL(session->get_name_case_mode(case_mode))) {
LOG_WARN("fail to get name case mode", K(ret));
} else if (case_mode == OB_ORIGIN_AND_INSENSITIVE || case_mode == OB_LOWERCASE_AND_INSENSITIVE) {
const ObDatabaseSchema *db_schema = NULL;
if (OB_FAIL(schema_guard.get_database_schema(session->get_effective_tenant_id(),
name,
db_schema))) {
LOG_WARN("fail to get database schema", K(name), K(ret));
} else if (db_schema != NULL) {
name = db_schema->get_database_name();
if (allocator != NULL) {
OZ(ob_write_string(*allocator, name, name));
}
}
}
}
return ret;
}
/* Replace user input dbname with the case of the database internally stored */
int ObSQLUtils::cvt_db_name_to_org(sql::ObSqlSchemaGuard &sql_schema_guard,
const ObSQLSessionInfo *session,
const uint64_t catalog_id,
common::ObString &db_name,
ObIAllocator *allocator)
{
int ret = OB_SUCCESS;
if (is_internal_catalog_id(catalog_id)) {
// compatible with origin internal catalog's cvt_db_name_to_org() logic
if (OB_ISNULL(sql_schema_guard.get_schema_guard())) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument", K(ret));
} else {
ret = cvt_db_name_to_org(*sql_schema_guard.get_schema_guard(), session, db_name, allocator);
}
} else if (is_external_catalog_id(catalog_id)) {
const ObDatabaseSchema *database_schema = NULL;
uint64_t tenant_id = OB_INVALID_TENANT_ID;
// for external catalog, we must require allocator to hold db_name
if (OB_ISNULL(session)) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("invalid argument", K(ret));
} else if (OB_FALSE_IT(tenant_id = session->get_effective_tenant_id())) {
} else if (OB_FAIL(sql_schema_guard.get_catalog_database_schema(tenant_id, catalog_id, db_name, database_schema))) {
LOG_WARN("fail to get catalog database schema", K(ret), K(tenant_id), K(catalog_id), K(db_name));
} else if (OB_ISNULL(database_schema)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected null", K(ret));
} else {
db_name = database_schema->get_database_name();
if (allocator != NULL) {
OZ(ob_write_string(*allocator, db_name, db_name));
}
}
} else {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected", K(ret));
}
return ret;
}
int ObSQLUtils::check_and_convert_table_name(const ObCollationType cs_type,
const bool preserve_lettercase,
ObString &name,
const stmt::StmtType stmt_type,
const bool is_index_table)
{
return check_and_convert_table_name(cs_type, preserve_lettercase, name, false, stmt_type, is_index_table);
}
int ObSQLUtils::check_and_convert_table_name(const ObCollationType cs_type,
const bool preserve_lettercase,
ObString &name,
const bool is_oracle_mode,
const stmt::StmtType stmt_type,
const bool is_index_table)
{
/**
* MYSQL mode
* If the byte number of table name is greater than 192, report OB_WRONG_TABLE_NAME;
* If the byte number of table name is greater than 64 and less than or equal to 192, report OB_ERR_TOO_LONG_IDENT;
* If the last character of table name is a space, report OB_WRONG_TABLE_NAME;
* If it is a direct query on the index table, special handling for table name length
* ORACLE mode
* If the byte number of table name is greater than 384, report OB_WRONG_TABLE_NAME;
* If the byte number of table name is greater than 128 and less than or equal to 384, report OB_ERR_TOO_LONG_IDENT;
* If the last character of table name is a space, report OB_WRONG_TABLE_NAME;
* If it is a direct query on the index table, special handling for table name length
*/
UNUSED(cs_type);
int ret = OB_SUCCESS;
int64_t name_len = name.length();
const char *name_str = name.ptr();
const int64_t max_user_table_name_length = is_oracle_mode
? OB_MAX_USER_TABLE_NAME_LENGTH_ORACLE : OB_MAX_USER_TABLE_NAME_LENGTH_MYSQL;
const int64_t max_index_name_prefix_len = 30;
if (0 == name_len
|| (!is_index_table && (name_len > (max_user_table_name_length * OB_MAX_CHAR_LEN)))
|| (is_index_table && (name_len > (max_user_table_name_length * OB_MAX_CHAR_LEN + max_index_name_prefix_len)))
|| OB_ISNULL(name_str)) {
ret = OB_WRONG_TABLE_NAME;
LOG_USER_ERROR(OB_WRONG_TABLE_NAME, static_cast<int32_t>(name_len), name_str);
LOG_WARN("incorrect table name", K(name), K(ret));
} else {
char origin_name[OB_MAX_USER_TABLE_NAME_LENGTH_ORACLE * OB_MAX_CHAR_LEN + 1] = {'\0'};
MEMCPY(origin_name, name_str, name_len);
if (!preserve_lettercase) {
size_t sz = ObCharset::casedn(CS_TYPE_UTF8MB4_GENERAL_CI, name);
if (sz == 0) {
ret = OB_WRONG_TABLE_NAME;
LOG_WARN("fail to convert table name to lower case", K(name), K(ret));
}
}
if (OB_SUCC(ret)) {
bool check_for_path_chars = false;
int64_t max_ident_len = max_user_table_name_length;
if ((stmt::T_SELECT == stmt_type || stmt::T_INSERT == stmt_type) && is_index_table) {
// Index table will have an extra prefix, therefore use OB_MAX_TABLE_NAME_LENGTH for length limit when querying
max_ident_len = OB_MAX_TABLE_NAME_LENGTH;
}
if (OB_ERR_WRONG_IDENT_NAME == (ret = check_ident_name(CS_TYPE_UTF8MB4_GENERAL_CI,
name,
check_for_path_chars,
max_ident_len))) {
ret = OB_WRONG_TABLE_NAME;
LOG_USER_ERROR(OB_WRONG_TABLE_NAME, (int)strlen(origin_name), origin_name);
LOG_WARN("Incorrect table name", K(origin_name), K(ret));
} else if (OB_ERR_TOO_LONG_IDENT == ret) {
LOG_USER_ERROR(OB_ERR_TOO_LONG_IDENT, (int)strlen(origin_name), origin_name);
LOG_WARN("table name is too long", K(origin_name), K(max_ident_len), K(ret), K(stmt_type), K(is_index_table));
} else if (OB_FAIL(ret)) {
LOG_WARN("fail to check ident name", K(origin_name), K(ret));
}
}
}
return ret;
}
int ObSQLUtils::check_and_convert_context_namespace(const common::ObCollationType cs_type,
common::ObString &name)
{
bool preserve_lettercase = true;
stmt::StmtType type = stmt::T_CREATE_CONTEXT;
return check_and_convert_table_name(cs_type, preserve_lettercase, name, type);
}
int ObSQLUtils::check_index_name(const ObCollationType cs_type, ObString &name)
{
/* MYSQL mode
* If the byte number of table name is greater than 64, report error OB_ERR_TOO_LONG_IDENT;
* If the last character of table name is a space, report error OB_WRONG_NAME_FOR_INDEX
* ORACLE mode
* If the byte number of table name is greater than 128, report error OB_ERR_TOO_LONG_IDENT;
* If the last character of table name is a space, report error OB_WRONG_TABLE_NAME;
* */
UNUSED(cs_type);
int ret = OB_SUCCESS;
int64_t name_len = name.length();
const char *name_str = name.ptr();
const int64_t max_user_table_name_length = OB_MAX_USER_TABLE_NAME_LENGTH_MYSQL;
if (name_len > (max_user_table_name_length * OB_MAX_CHAR_LEN)) {
ret = OB_ERR_TOO_LONG_IDENT;
LOG_USER_ERROR(OB_ERR_TOO_LONG_IDENT, static_cast<int32_t>(name_len), name_str);
LOG_WARN("index name is too long", K(name), K(ret));
} else if (0 == name_len) {
ret = OB_WRONG_NAME_FOR_INDEX;
LOG_WARN("index name is empty", K(ret));
LOG_USER_ERROR(OB_WRONG_NAME_FOR_INDEX, static_cast<int32_t>(name_len), name_str);
} else {
bool check_for_path_chars = false;
if (OB_ERR_WRONG_IDENT_NAME == (ret = check_ident_name(CS_TYPE_UTF8MB4_GENERAL_CI, name, check_for_path_chars,
max_user_table_name_length))) {
if (lib::is_mysql_mode()) {
ret = OB_WRONG_NAME_FOR_INDEX;
LOG_USER_ERROR(OB_WRONG_NAME_FOR_INDEX, name.length(), name.ptr());
LOG_WARN("Incorrect index name", K(name), K(ret));
} else { // It allows the last char of index name is space in oracle mode.
ret = OB_SUCCESS;
}
} else if (OB_ERR_TOO_LONG_IDENT == ret) {
LOG_USER_ERROR(OB_ERR_TOO_LONG_IDENT, name.length(), name.ptr());
LOG_WARN("index name is too long", K(name), K(ret));
} else if (OB_FAIL(ret)) {
LOG_WARN("fail to check ident name", K(name), K(ret));
}
}
return ret;
}
int ObSQLUtils::check_column_name(const ObCollationType cs_type, ObString &name, bool is_from_view)
{
/*If the byte count of table name is greater than 128, report error OB_ERR_TOO_LONG_IDENT;
*If the last character of table name is a space, report error OB_WRONG_COLUMN_NAME */
UNUSED(cs_type);
int ret = OB_SUCCESS;
bool last_char_is_space = false;
const char *end = name.ptr() + name.length();
const char *name_str = name.ptr();
size_t name_len = 0; // char semantics for MySQL mode, and byte semantics for Oracle mode
size_t byte_length = 0;
int is_mb_char = 0;
while (OB_SUCCESS == ret && name_str != end) {
last_char_is_space = ObCharset::is_space(CS_TYPE_UTF8MB4_GENERAL_CI, *name_str);
if (ObCharset::usemb(CS_TYPE_UTF8MB4_GENERAL_CI)) {
is_mb_char = ObCharset::is_mbchar(CS_TYPE_UTF8MB4_GENERAL_CI, name_str, end);
if (is_mb_char) {
byte_length = ObCharset::charpos(CS_TYPE_UTF8MB4_GENERAL_CI, name_str, end - name_str, 1);
name_str += byte_length;
if (lib::is_mysql_mode()) {
name_len++;
} else {
name_len += byte_length;
}
continue;
}