Skip to content

Commit

Permalink
fix: for code review
Browse files Browse the repository at this point in the history
  • Loading branch information
wy1433 committed Apr 19, 2024
1 parent 0874a84 commit 27fa6c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/common/type_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ inline std::string to_mysql_type_full_string(pb::PrimitiveType type,
case pb::STRING:
return "varchar(1024)";
case pb::DATETIME:
if (float_precision_len > 0 && float_precision_len <= 6) {
if (float_precision_len == -1) {
return "datetime(6)";
} else if (float_precision_len > 0 && float_precision_len <= 6) {
return "datetime(" + std::to_string(float_precision_len) + ")";
}
return "datetime";
Expand Down

0 comments on commit 27fa6c5

Please sign in to comment.