[CP] fix ash report bug
This commit is contained in:
		
							
								
								
									
										21
									
								
								deps/oblib/src/lib/mysqlclient/ob_mysql_result.h
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										21
									
								
								deps/oblib/src/lib/mysqlclient/ob_mysql_result.h
									
									
									
									
										vendored
									
									
								
							@ -862,6 +862,27 @@
 | 
			
		||||
    } \
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  #define EXTRACT_STRBUF_FIELD_MYSQL_SKIP_RET_AND_TRUNCATION(result, column_name, field, max_length, real_length) \
 | 
			
		||||
  if (OB_SUCC(ret)) \
 | 
			
		||||
  { \
 | 
			
		||||
    ObString str_value; \
 | 
			
		||||
    if (OB_SUCCESS == (ret = (result).get_varchar(column_name, str_value))) \
 | 
			
		||||
    { \
 | 
			
		||||
        real_length = MIN(str_value.length(), max_length); \
 | 
			
		||||
        MEMCPY(field, str_value.ptr(), real_length); \
 | 
			
		||||
        field[real_length] = '\0'; \
 | 
			
		||||
    } \
 | 
			
		||||
    else if (OB_ERR_NULL_VALUE == ret || OB_ERR_COLUMN_NOT_FOUND == ret) \
 | 
			
		||||
    { \
 | 
			
		||||
      ret = OB_SUCCESS; \
 | 
			
		||||
      real_length = 0; \
 | 
			
		||||
      field[0] = '\0'; \
 | 
			
		||||
    } \
 | 
			
		||||
    else \
 | 
			
		||||
    { \
 | 
			
		||||
      SQL_LOG(WARN, "fail to extract strbuf field mysql. ", K(ret)); \
 | 
			
		||||
    } \
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
#define EXTRACT_STRBUF_FIELD_TO_CLASS_MYSQL_SKIP_RET(result, column_name, class_obj, max_length) \
 | 
			
		||||
  if (OB_SUCC(ret)) \
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user