| 129 | } |
| 130 | |
| 131 | bool 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 | |
| 164 | bool SQLInsertRow::AppendBool(bool val) { |
| 165 | if (IsDimension()) { |
nothing calls this directly
no test coverage detected