MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / MakeDefault

Method MakeDefault

src/sdk/sql_insert_row.cc:131–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131bool SQLInsertRow::MakeDefault() {
132 auto it = default_map_->find(rb_.GetAppendPos());
133 if (it != default_map_->end()) {
134 if (it->second->IsNull()) {
135 return AppendNULL();
136 }
137 switch (table_info_->column_desc(rb_.GetAppendPos()).data_type()) {
138 case fedb::type::kBool:
139 return AppendBool(it->second->GetInt());
140 case fedb::type::kSmallInt:
141 return AppendInt16(it->second->GetSmallInt());
142 case fedb::type::kInt:
143 return AppendInt32(it->second->GetInt());
144 case fedb::type::kBigInt:
145 return AppendInt64(it->second->GetLong());
146 case fedb::type::kFloat:
147 return AppendFloat(it->second->GetFloat());
148 case fedb::type::kDouble:
149 return AppendDouble(it->second->GetDouble());
150 case fedb::type::kDate:
151 return AppendDate(it->second->GetInt());
152 case fedb::type::kTimestamp:
153 return AppendTimestamp(it->second->GetLong());
154 case fedb::type::kVarchar:
155 case fedb::type::kString:
156 return AppendString(it->second->GetStr());
157 default:
158 return false;
159 }
160 }
161 return true;
162}
163
164bool SQLInsertRow::AppendBool(bool val) {
165 if (IsDimension()) {

Callers

nothing calls this directly

Calls 8

AppendInt16Function · 0.85
AppendInt32Function · 0.85
AppendInt64Function · 0.85
AppendFloatFunction · 0.85
AppendDoubleFunction · 0.85
GetAppendPosMethod · 0.80
GetFloatMethod · 0.45
GetDoubleMethod · 0.45

Tested by

no test coverage detected