Fix prepare stmt error 4016
This commit is contained in:
		
							
								
								
									
										4
									
								
								deps/oblib/src/lib/number/ob_number_v2.cpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								deps/oblib/src/lib/number/ob_number_v2.cpp
									
									
									
									
										vendored
									
									
								
							@ -3539,10 +3539,14 @@ int ObNumber::to_sci_str_(ObString &num_str, char *buf,
 | 
				
			|||||||
          }
 | 
					          }
 | 
				
			||||||
          buf[digit_start_pos] = '1';
 | 
					          buf[digit_start_pos] = '1';
 | 
				
			||||||
          buf[digit_start_pos + 1] = '.';
 | 
					          buf[digit_start_pos + 1] = '.';
 | 
				
			||||||
 | 
					          if ('-' == pow_str[1]) {
 | 
				
			||||||
 | 
					            --pow_size;
 | 
				
			||||||
 | 
					          } else {
 | 
				
			||||||
            ++pow_size;
 | 
					            ++pow_size;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    // fill exponent part
 | 
					    // fill exponent part
 | 
				
			||||||
    if (OB_SUCC(ret)) {
 | 
					    if (OB_SUCC(ret)) {
 | 
				
			||||||
      if (OB_FAIL(databuff_printf(pow_str, sizeof(pow_str), pow_pos, "%ld", pow_size))) {
 | 
					      if (OB_FAIL(databuff_printf(pow_str, sizeof(pow_str), pow_pos, "%ld", pow_size))) {
 | 
				
			||||||
 | 
				
			|||||||
@ -1696,10 +1696,14 @@ int ObNFMBase::num_str_to_sci(const common::ObString &num_str, const int32_t sca
 | 
				
			|||||||
          if (decimal_appear) {
 | 
					          if (decimal_appear) {
 | 
				
			||||||
            buf[digit_start_pos + 1] = '.';
 | 
					            buf[digit_start_pos + 1] = '.';
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
					          if ('-' == pow_str[1]) {
 | 
				
			||||||
 | 
					            --pow_size;
 | 
				
			||||||
 | 
					          } else {
 | 
				
			||||||
            ++pow_size;
 | 
					            ++pow_size;
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    if (OB_SUCC(ret) && is_tm) {
 | 
					    if (OB_SUCC(ret) && is_tm) {
 | 
				
			||||||
      int32_t offset = 0;
 | 
					      int32_t offset = 0;
 | 
				
			||||||
      // 1.0000000000000000000000000000000000E+65 --> 1E+65
 | 
					      // 1.0000000000000000000000000000000000E+65 --> 1E+65
 | 
				
			||||||
 | 
				
			|||||||
@ -54,7 +54,7 @@ int ObPrepareResolver::resolve(const ParseNode &parse_tree)
 | 
				
			|||||||
        prepare_stmt->set_prepare_sql(stmt_expr);
 | 
					        prepare_stmt->set_prepare_sql(stmt_expr);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      ret = OB_ERR_UNEXPECTED;
 | 
					      ret = OB_ERR_PARSER_SYNTAX;
 | 
				
			||||||
      LOG_WARN("invalid name node", K(name_node->type_), K(ret));
 | 
					      LOG_WARN("invalid name node", K(name_node->type_), K(ret));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user