fix: bit type Data truncation for oceanbase bug #1256

This commit is contained in:
justdba 2021-12-23 15:24:55 +08:00
parent 6980d89883
commit 91ea278762

View File

@ -530,7 +530,7 @@ public class CommonRdbmsWriter {
// warn: bit(1) -> Types.BIT 可使用setBoolean // warn: bit(1) -> Types.BIT 可使用setBoolean
// warn: bit(>1) -> Types.VARBINARY 可使用setBytes // warn: bit(>1) -> Types.VARBINARY 可使用setBytes
case Types.BIT: case Types.BIT:
if (this.dataBaseType == DataBaseType.MySql) { if (this.dataBaseType == DataBaseType.MySql || this.dataBaseType == DataBaseType.OceanBase) {
preparedStatement.setBoolean(columnIndex + 1, column.asBoolean()); preparedStatement.setBoolean(columnIndex + 1, column.asBoolean());
} else { } else {
preparedStatement.setString(columnIndex + 1, column.asString()); preparedStatement.setString(columnIndex + 1, column.asString());