|
30 | 30 | import javax.sql.DataSource; |
31 | 31 |
|
32 | 32 | import com.oceanbase.odc.common.util.JdbcOperationsUtil; |
| 33 | +import com.oceanbase.odc.common.util.StringUtils; |
33 | 34 | import com.oceanbase.odc.core.shared.constant.ConnectType; |
34 | 35 | import com.oceanbase.odc.core.shared.constant.DialectType; |
35 | 36 | import com.oceanbase.odc.service.connection.model.ConnectionConfig; |
@@ -94,6 +95,8 @@ public static void sync(ConnectionConfig srcConfig, ConnectionConfig tgtConfig, |
94 | 95 | Collections.singletonList(srcTableName)).get(srcTableName); |
95 | 96 | DBTable tgtTable = tgtAccessor.getTables(tgtConfig.getDefaultSchema(), |
96 | 97 | Collections.singletonList(tgtTableName)).get(tgtTableName); |
| 98 | + StringUtils.quoteColumnDefaultValuesForMySQLCopied(srcTable); |
| 99 | + StringUtils.quoteColumnDefaultValuesForMySQLCopied(tgtTable); |
97 | 100 | DBTableStructureComparator comparator = new DBTableStructureComparator(tgtTableEditor, |
98 | 101 | tgtConfig.getType().getDialectType(), srcConfig.getDefaultSchema(), tgtConfig.getDefaultSchema()); |
99 | 102 | List<String> changeSqlScript = new LinkedList<>(); |
@@ -155,8 +158,10 @@ public static void createTempTable(DataSourceInfo sourceInfo, String srcTableNam |
155 | 158 | if (!tables.containsKey(tempTableName)) { |
156 | 159 | DBTable srcTable = tables.get(srcTableName); |
157 | 160 | srcTable.setName(tempTableName); |
| 161 | + StringUtils.quoteColumnDefaultValuesForMySQLCopied(srcTable); |
158 | 162 | DBTableEditor tableEditor = getDBTableEditor(srcConfig.getType(), srcDbVersion); |
159 | 163 | String createTableDdl = tableEditor.generateCreateObjectDDL(srcTable); |
| 164 | + log.info("Start to create temporary table,ddl={}", createTableDdl); |
160 | 165 | try (Connection conn = sourceDs.getConnection(); |
161 | 166 | PreparedStatement ps = conn.prepareStatement(createTableDdl)) { |
162 | 167 | ps.execute(); |
|
0 commit comments