* This file is part of the oGRAC project.
* Copyright (c) 2024 Huawei Technologies Co.,Ltd.
*
* oGRAC is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
* -------------------------------------------------------------------------
*
* var_column.h
*
*
* IDENTIFICATION
* src/common/variant/var_column.h
*
* -------------------------------------------------------------------------
*/
#ifndef __VAR_COLUMN_H__
#define __VAR_COLUMN_H__
#include "cm_defs.h"
#include "cm_text.h"
typedef struct st_column_info {
uint32 col_pro_id;
text_t col_name;
text_t tab_alias_name;
text_t tab_name;
text_t user_name;
uint16 org_tab;
uint16 org_col;
bool8 col_name_has_quote;
bool8 tab_name_has_quote;
bool8 reserved[2];
} column_info_t;
typedef struct st_var_column {
og_type_t datatype;
uint16 tab;
uint16 col;
in the original table definition(starts from 0)
of the "v_col" value appeared in rs_column_t */
column_info_t *col_info_ptr;
uint32 adjusted : 1;
uint32 has_adjusted : 1;
uint32 is_ddm_col : 1;
uint32 is_rowid : 1;
uint32 is_rownodeid : 1;
uint32 is_array : 1;
uint32 is_jsonb : 1;
uint32 reserved : 25;
uint32 ancestor;
int32 ss_start;
int32 ss_end;
} var_column_t;
#define VAR_COL_IS_ARRAY_ELEMENT(col) ((col)->ss_start > 0 && (col)->ss_end == (int32)OG_INVALID_ID32)
#define VAR_COL_IS_ARRAY_ALL(col) ((col)->ss_start == (int32)OG_INVALID_ID32 && (col)->ss_end == (int32)OG_INVALID_ID32)
#define QUERY_FIELD_IS_ELEMENT(query_field) ((query_field)->start > 0 && (query_field)->end == (int32)OG_INVALID_ID32)
typedef struct st_var_vm_col {
uint16 id;
uint16 group_id;
uint32 ancestor;
bool32 is_ddm_col;
void *origin_ref;
} var_vm_col_t;
#endif