Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
1b05c436
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1b05c436
编写于
3月 26, 2018
作者:
L
liu ze jian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ddl sql test
上级
716f1727
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
151 addition
and
154 deletion
+151
-154
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/StartTest.java
...-core/src/test/java/io/shardingjdbc/dbtest/StartTest.java
+3
-12
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/asserts/AssertEngine.java
...est/java/io/shardingjdbc/dbtest/asserts/AssertEngine.java
+8
-28
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/common/DatabaseUtil.java
...test/java/io/shardingjdbc/dbtest/common/DatabaseUtil.java
+6
-6
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/AssertDDLDefinition.java
.../shardingjdbc/dbtest/config/bean/AssertDDLDefinition.java
+1
-1
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/ParametersDefinition.java
...shardingjdbc/dbtest/config/bean/ParametersDefinition.java
+2
-1
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/init/InItCreateSchema.java
...st/java/io/shardingjdbc/dbtest/init/InItCreateSchema.java
+19
-1
sharding-jdbc-core/src/test/resources/asserts/assert-test-data/assert-test.xml
...c/test/resources/asserts/assert-test-data/assert-test.xml
+4
-0
sharding-jdbc-core/src/test/resources/asserts/assert-test-data/asserts/ddl/update.xml
...resources/asserts/assert-test-data/asserts/ddl/update.xml
+3
-1
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/db.sql
...ore/src/test/resources/integrate/schema/table/drop/db.sql
+2
-2
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/dbtbl.sql
.../src/test/resources/integrate/schema/table/drop/dbtbl.sql
+22
-22
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/jdbc.sql
...e/src/test/resources/integrate/schema/table/drop/jdbc.sql
+6
-6
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/master.sql
...src/test/resources/integrate/schema/table/drop/master.sql
+22
-22
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/master_only.sql
...est/resources/integrate/schema/table/drop/master_only.sql
+4
-4
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/nullable.sql
...c/test/resources/integrate/schema/table/drop/nullable.sql
+1
-1
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/slave.sql
.../src/test/resources/integrate/schema/table/drop/slave.sql
+22
-22
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/slave_only.sql
...test/resources/integrate/schema/table/drop/slave_only.sql
+4
-4
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/tbl.sql
...re/src/test/resources/integrate/schema/table/drop/tbl.sql
+21
-21
sharding-sql-test/src/main/resources/sql/ddl/alter.xml
sharding-sql-test/src/main/resources/sql/ddl/alter.xml
+1
-0
未找到文件。
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/StartTest.java
浏览文件 @
1b05c436
...
...
@@ -131,18 +131,9 @@ public class StartTest {
@BeforeClass
public
static
void
beforeClass
()
{
try
{
if
(
isInitialized
())
{
String
assertPath
=
getAssertPath
();
assertPath
=
PathUtil
.
getPath
(
assertPath
);
List
<
String
>
paths
=
FileUtil
.
getAllFilePaths
(
new
File
(
assertPath
),
"t"
,
"yaml"
);
Set
<
DatabaseType
>
databaseSchemas
=
InItCreateSchema
.
getDatabaseSchema
(
paths
);
InItCreateSchema
.
setDatabaseSchemas
(
databaseSchemas
);
InItCreateSchema
.
createDatabase
();
InItCreateSchema
.
createTable
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
if
(
isInitialized
())
{
InItCreateSchema
.
createDatabase
();
InItCreateSchema
.
createTable
();
}
}
...
...
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/asserts/AssertEngine.java
浏览文件 @
1b05c436
...
...
@@ -164,26 +164,14 @@ public class AssertEngine {
AssertDDLDefinition
anAssert
=
each
;
String
rootsql
=
anAssert
.
getSql
();
rootsql
=
SQLCasesLoader
.
getSql
(
rootsql
);
String
initDataFile
=
PathUtil
.
getPath
(
anAssert
.
getInitDataFile
(),
rootPath
);
Map
<
String
,
DatasetDefinition
>
mapDatasetDefinition
=
new
HashMap
<>();
Map
<
String
,
String
>
sqls
=
new
HashMap
<>();
getInitDatas
(
dbs
,
initDataFile
,
mapDatasetDefinition
,
sqls
);
if
(
mapDatasetDefinition
.
isEmpty
())
{
throw
new
DbTestException
(
path
+
" Use cases cannot be parsed"
);
}
if
(
sqls
.
isEmpty
())
{
throw
new
DbTestException
(
path
+
" The use case cannot initialize the data"
);
}
doUpdateUseStatementToExecuteUpdateDDL
(
rootPath
,
dataSource
,
dataSourceMaps
,
anAssert
,
rootsql
,
mapDatasetDefinition
,
sqls
);
doUpdateUseStatementToExecuteUpdateDDL
(
rootPath
,
dataSource
,
anAssert
,
rootsql
);
doUpdateUseStatementToExecuteDDL
(
rootPath
,
dataSource
,
dataSourceMaps
,
anAssert
,
rootsql
,
mapDatasetDefinition
,
sqls
);
doUpdateUseStatementToExecuteDDL
(
rootPath
,
dataSource
,
anAssert
,
rootsql
);
doUpdateUsePreparedStatementToExecuteUpdateDDL
(
rootPath
,
dataSource
,
dataSourceMaps
,
anAssert
,
rootsql
,
mapDatasetDefinition
,
sqls
);
doUpdateUsePreparedStatementToExecuteUpdateDDL
(
rootPath
,
dataSource
,
anAssert
,
rootsql
);
doUpdateUsePreparedStatementToExecuteDDL
(
rootPath
,
dataSource
,
dataSourceMaps
,
anAssert
,
rootsql
,
mapDatasetDefinition
,
sqls
);
doUpdateUsePreparedStatementToExecuteDDL
(
rootPath
,
dataSource
,
anAssert
,
rootsql
);
}
}
...
...
@@ -216,9 +204,8 @@ public class AssertEngine {
}
}
private
static
void
doUpdateUsePreparedStatementToExecuteDDL
(
final
String
rootPath
,
final
DataSource
dataSource
,
final
Map
<
String
,
DataSource
>
dataSourceMaps
,
final
AssertDDLDefinition
anAssert
,
final
String
rootsql
,
final
Map
<
String
,
DatasetDefinition
>
mapDatasetDefinition
,
final
Map
<
String
,
String
>
sqls
)
throws
SQLException
,
ParseException
,
IOException
,
SAXException
,
ParserConfigurationException
,
XPathExpressionException
{
private
static
void
doUpdateUsePreparedStatementToExecuteDDL
(
final
String
rootPath
,
final
DataSource
dataSource
,
final
AssertDDLDefinition
anAssert
,
final
String
rootsql
)
throws
SQLException
,
ParseException
,
IOException
,
SAXException
,
ParserConfigurationException
,
XPathExpressionException
{
try
{
initTableData
(
dataSourceMaps
,
sqls
,
mapDatasetDefinition
);
try
(
Connection
con
=
dataSource
.
getConnection
())
{
InItCreateSchema
.
dropTable
();
InItCreateSchema
.
createTable
();
...
...
@@ -234,7 +221,6 @@ public class AssertEngine {
}
finally
{
InItCreateSchema
.
dropTable
();
InItCreateSchema
.
createTable
();
clearTableData
(
dataSourceMaps
,
mapDatasetDefinition
);
}
}
...
...
@@ -260,9 +246,8 @@ public class AssertEngine {
}
}
private
static
void
doUpdateUsePreparedStatementToExecuteUpdateDDL
(
final
String
rootPath
,
final
DataSource
dataSource
,
final
Map
<
String
,
DataSource
>
dataSourceMaps
,
final
AssertDDLDefinition
anAssert
,
final
String
rootsql
,
final
Map
<
String
,
DatasetDefinition
>
mapDatasetDefinition
,
final
Map
<
String
,
String
>
sqls
)
throws
SQLException
,
ParseException
,
IOException
,
SAXException
,
ParserConfigurationException
,
XPathExpressionException
{
private
static
void
doUpdateUsePreparedStatementToExecuteUpdateDDL
(
final
String
rootPath
,
final
DataSource
dataSource
,
final
AssertDDLDefinition
anAssert
,
final
String
rootsql
)
throws
SQLException
,
ParseException
,
IOException
,
SAXException
,
ParserConfigurationException
,
XPathExpressionException
{
try
{
initTableData
(
dataSourceMaps
,
sqls
,
mapDatasetDefinition
);
try
(
Connection
con
=
dataSource
.
getConnection
())
{
InItCreateSchema
.
dropTable
();
InItCreateSchema
.
createTable
();
...
...
@@ -279,7 +264,6 @@ public class AssertEngine {
}
finally
{
InItCreateSchema
.
dropTable
();
InItCreateSchema
.
createTable
();
clearTableData
(
dataSourceMaps
,
mapDatasetDefinition
);
}
}
...
...
@@ -305,9 +289,8 @@ public class AssertEngine {
}
}
private
static
void
doUpdateUseStatementToExecuteDDL
(
final
String
rootPath
,
final
DataSource
dataSource
,
final
Map
<
String
,
DataSource
>
dataSourceMaps
,
final
AssertDDLDefinition
anAssert
,
final
String
rootsql
,
final
Map
<
String
,
DatasetDefinition
>
mapDatasetDefinition
,
final
Map
<
String
,
String
>
sqls
)
throws
SQLException
,
ParseException
,
IOException
,
SAXException
,
ParserConfigurationException
,
XPathExpressionException
{
private
static
void
doUpdateUseStatementToExecuteDDL
(
final
String
rootPath
,
final
DataSource
dataSource
,
final
AssertDDLDefinition
anAssert
,
final
String
rootsql
)
throws
SQLException
,
ParseException
,
IOException
,
SAXException
,
ParserConfigurationException
,
XPathExpressionException
{
try
{
initTableData
(
dataSourceMaps
,
sqls
,
mapDatasetDefinition
);
try
(
Connection
con
=
dataSource
.
getConnection
())
{
InItCreateSchema
.
dropTable
();
InItCreateSchema
.
createTable
();
...
...
@@ -323,7 +306,6 @@ public class AssertEngine {
}
finally
{
InItCreateSchema
.
dropTable
();
InItCreateSchema
.
createTable
();
clearTableData
(
dataSourceMaps
,
mapDatasetDefinition
);
}
}
...
...
@@ -349,9 +331,8 @@ public class AssertEngine {
}
}
private
static
void
doUpdateUseStatementToExecuteUpdateDDL
(
final
String
rootPath
,
final
DataSource
dataSource
,
final
Map
<
String
,
DataSource
>
dataSourceMaps
,
final
AssertDDLDefinition
anAssert
,
final
String
rootsql
,
final
Map
<
String
,
DatasetDefinition
>
mapDatasetDefinition
,
final
Map
<
String
,
String
>
sqls
)
throws
SQLException
,
ParseException
,
IOException
,
SAXException
,
ParserConfigurationException
,
XPathExpressionException
{
private
static
void
doUpdateUseStatementToExecuteUpdateDDL
(
final
String
rootPath
,
final
DataSource
dataSource
,
final
AssertDDLDefinition
anAssert
,
final
String
rootsql
)
throws
SQLException
,
ParseException
,
IOException
,
SAXException
,
ParserConfigurationException
,
XPathExpressionException
{
try
{
initTableData
(
dataSourceMaps
,
sqls
,
mapDatasetDefinition
);
try
(
Connection
con
=
dataSource
.
getConnection
())
{
InItCreateSchema
.
dropTable
();
InItCreateSchema
.
createTable
();
...
...
@@ -366,7 +347,6 @@ public class AssertEngine {
}
finally
{
InItCreateSchema
.
dropTable
();
InItCreateSchema
.
createTable
();
clearTableData
(
dataSourceMaps
,
mapDatasetDefinition
);
}
}
...
...
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/common/DatabaseUtil.java
浏览文件 @
1b05c436
...
...
@@ -606,7 +606,7 @@ public class DatabaseUtil {
Map
<
String
,
List
<
ColumnDefinition
>>
configs
=
expected
.
getMetadatas
();
List
<
ColumnDefinition
>
columnDefinitions
=
configs
.
get
(
table
);
for
(
ColumnDefinition
each
:
columnDefinitions
)
{
boolean
flag
=
false
;
for
(
ColumnDefinition
definition
:
actual
)
{
if
(
each
.
getName
().
equals
(
definition
.
getName
()))
{
boolean
flag2
=
true
;
...
...
@@ -640,12 +640,12 @@ public class DatabaseUtil {
flag2
=
false
;
}
}
if
(
flag2
)
{
flag
=
true
;
if
(
!
flag2
)
{
assertTrue
(
false
)
;
}
}
assertTrue
(
flag
);
}
}
}
...
...
@@ -702,13 +702,13 @@ public class DatabaseUtil {
*/
public
static
List
<
ColumnDefinition
>
getColumnDefinitions
(
final
Connection
conn
,
final
String
table
)
throws
SQLException
,
ParseException
{
DatabaseMetaData
stmt
=
conn
.
getMetaData
();
try
(
ResultSet
rs
=
stmt
.
getColumns
(
conn
.
getCatalog
(),
null
,
table
,
null
);
)
{
try
(
ResultSet
rs
=
stmt
.
getColumns
(
null
,
null
,
table
,
null
)
)
{
List
<
ColumnDefinition
>
cols
=
new
ArrayList
<
ColumnDefinition
>();
while
(
rs
.
next
())
{
ColumnDefinition
col
=
new
ColumnDefinition
();
String
column
=
rs
.
getString
(
"COLUMN_NAME"
);
int
size
=
rs
.
getInt
(
"COLUMN_SIZE"
);
String
columnType
=
rs
.
getString
(
"TYPE_NAME"
);
String
columnType
=
rs
.
getString
(
"TYPE_NAME"
)
.
toLowerCase
()
;
int
decimalDigits
=
rs
.
getInt
(
"DECIMAL_DIGITS"
);
int
numPrecRadix
=
rs
.
getInt
(
"NUM_PREC_RADIX"
);
int
nullAble
=
rs
.
getInt
(
"NULLABLE"
);
...
...
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/AssertDDLDefinition.java
浏览文件 @
1b05c436
...
...
@@ -44,6 +44,6 @@ public class AssertDDLDefinition implements AssertDefinition {
private
String
table
;
@XmlElement
(
name
=
"parameters"
)
private
ParametersDefinition
parameters
;
private
ParametersDefinition
parameters
=
new
ParametersDefinition
()
;
}
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/config/bean/ParametersDefinition.java
浏览文件 @
1b05c436
...
...
@@ -18,6 +18,7 @@
package
io.shardingjdbc.dbtest.config.bean
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlAccessType
;
...
...
@@ -31,7 +32,7 @@ import lombok.Getter;
public
class
ParametersDefinition
{
@XmlElement
(
name
=
"parameter"
)
private
List
<
ParameterDefinition
>
parameter
;
private
List
<
ParameterDefinition
>
parameter
=
new
ArrayList
<>()
;
...
...
sharding-jdbc-core/src/test/java/io/shardingjdbc/dbtest/init/InItCreateSchema.java
浏览文件 @
1b05c436
...
...
@@ -26,7 +26,10 @@ import java.sql.SQLException;
import
java.util.*
;
import
io.shardingjdbc.core.yaml.sharding.YamlShardingConfiguration
;
import
io.shardingjdbc.dbtest.StartTest
;
import
io.shardingjdbc.dbtest.common.DatabaseEnvironment
;
import
io.shardingjdbc.dbtest.common.FileUtil
;
import
io.shardingjdbc.dbtest.common.PathUtil
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.apache.commons.dbcp2.BasicDataSource
;
...
...
@@ -42,6 +45,20 @@ public class InItCreateSchema {
private
static
Set
<
DatabaseType
>
DATABASE_SCHEMAS
;
static
{
String
assertPath
=
StartTest
.
getAssertPath
();
assertPath
=
PathUtil
.
getPath
(
assertPath
);
List
<
String
>
paths
=
FileUtil
.
getAllFilePaths
(
new
File
(
assertPath
),
"t"
,
"yaml"
);
try
{
Set
<
DatabaseType
>
databaseSchemas
=
InItCreateSchema
.
getDatabaseSchema
(
paths
);
InItCreateSchema
.
setDatabaseSchemas
(
databaseSchemas
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
public
static
Set
<
DatabaseType
>
getDatabaseSchemas
()
{
return
DATABASE_SCHEMAS
;
}
...
...
@@ -203,7 +220,7 @@ public class InItCreateSchema {
}
conn
=
initialConnection
(
"tbl"
,
dbType
);
RunScript
.
execute
(
conn
,
new
InputStreamReader
(
InItCreateSchema
.
class
.
getClassLoader
().
getResourceAsStream
(
"integrate/schema/table/
create
/tbl.sql"
)));
InItCreateSchema
.
class
.
getClassLoader
().
getResourceAsStream
(
"integrate/schema/table/
drop
/tbl.sql"
)));
conn
.
close
();
}
catch
(
final
SQLException
ex
)
{
ex
.
printStackTrace
();
...
...
@@ -229,6 +246,7 @@ public class InItCreateSchema {
Connection
conn
;
for
(
int
i
=
0
;
i
<
2
;
i
++)
{
conn
=
initialConnection
(
"jdbc_"
+
i
,
dbType
);
RunScript
.
execute
(
conn
,
new
InputStreamReader
(
InItCreateSchema
.
class
.
getClassLoader
()
.
getResourceAsStream
(
"integrate/schema/table/drop/jdbc.sql"
)));
conn
.
close
();
...
...
sharding-jdbc-core/src/test/resources/asserts/assert-test-data/assert-test.xml
浏览文件 @
1b05c436
...
...
@@ -20,4 +20,8 @@
<parameter
value=
"1000"
type=
"int"
/>
</expected-parameters>
</assertDML>
<assertDDL
id=
"test3"
init-data-file=
"./init"
expected-update=
"1"
sql=
"assertAlterTableTOrder"
table=
"t_order"
expected-data-file=
"./asserts/ddl/update.xml"
>
</assertDDL>
</asserts>
\ No newline at end of file
sharding-jdbc-core/src/test/resources/asserts/assert-test-data/asserts/ddl/update.xml
浏览文件 @
1b05c436
<init>
<metadata>
<table
name=
"
data
"
>
<table
name=
"
t_order
"
>
<cloumn
name=
"order_id"
type=
"int"
/>
<cloumn
name=
"user_id"
type=
"int"
/>
<cloumn
name=
"status"
type=
"varchar"
/>
<cloumn
name=
"name"
type=
"varchar"
/>
</table>
</metadata>
</init>
\ No newline at end of file
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/db.sql
浏览文件 @
1b05c436
DROP
t_order
;
DROP
t_order_item
;
DROP
TABLE
t_order
;
DROP
TABLE
t_order_item
;
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/dbtbl.sql
浏览文件 @
1b05c436
DROP
t_order_0
;
DROP
t_order_1
;
DROP
t_order_2
;
DROP
t_order_3
;
DROP
t_order_4
;
DROP
t_order_5
;
DROP
t_order_6
;
DROP
t_order_7
;
DROP
t_order_8
;
DROP
t_order_9
;
DROP
t_order_item_0
;
DROP
t_order_item_1
;
DROP
t_order_item_2
;
DROP
t_order_item_3
;
DROP
t_order_item_4
;
DROP
t_order_item_5
;
DROP
t_order_item_6
;
DROP
t_order_item_7
;
DROP
t_order_item_8
;
DROP
t_order_item_9
;
DROP
t_config
;
DROP
t_global
;
DROP
TABLE
t_order_0
;
DROP
TABLE
t_order_1
;
DROP
TABLE
t_order_2
;
DROP
TABLE
t_order_3
;
DROP
TABLE
t_order_4
;
DROP
TABLE
t_order_5
;
DROP
TABLE
t_order_6
;
DROP
TABLE
t_order_7
;
DROP
TABLE
t_order_8
;
DROP
TABLE
t_order_9
;
DROP
TABLE
t_order_item_0
;
DROP
TABLE
t_order_item_1
;
DROP
TABLE
t_order_item_2
;
DROP
TABLE
t_order_item_3
;
DROP
TABLE
t_order_item_4
;
DROP
TABLE
t_order_item_5
;
DROP
TABLE
t_order_item_6
;
DROP
TABLE
t_order_item_7
;
DROP
TABLE
t_order_item_8
;
DROP
TABLE
t_order_item_9
;
DROP
TABLE
t_config
;
DROP
TABLE
t_global
;
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/jdbc.sql
浏览文件 @
1b05c436
DROP
t_order_0
;
DROP
t_order_1
;
DROP
t_order_item_0
;
DROP
t_order_item_1
;
DROP
t_config
;
DROP
t_global
;
DROP
TABLE
t_order_0
;
DROP
TABLE
t_order_1
;
DROP
TABLE
t_order_item_0
;
DROP
TABLE
t_order_item_1
;
DROP
TABLE
t_config
;
DROP
TABLE
t_global
;
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/master.sql
浏览文件 @
1b05c436
DROP
t_order_0
;
DROP
t_order_1
;
DROP
t_order_2
;
DROP
t_order_3
;
DROP
t_order_4
;
DROP
t_order_5
;
DROP
t_order_6
;
DROP
t_order_7
;
DROP
t_order_8
;
DROP
t_order_9
;
DROP
t_order_item_0
;
DROP
t_order_item_1
;
DROP
t_order_item_2
;
DROP
t_order_item_3
;
DROP
t_order_item_4
;
DROP
t_order_item_5
;
DROP
t_order_item_6
;
DROP
t_order_item_7
;
DROP
t_order_item_8
;
DROP
t_order_item_9
;
DROP
t_config
;
DROP
t_global
;
DROP
TABLE
t_order_0
;
DROP
TABLE
t_order_1
;
DROP
TABLE
t_order_2
;
DROP
TABLE
t_order_3
;
DROP
TABLE
t_order_4
;
DROP
TABLE
t_order_5
;
DROP
TABLE
t_order_6
;
DROP
TABLE
t_order_7
;
DROP
TABLE
t_order_8
;
DROP
TABLE
t_order_9
;
DROP
TABLE
t_order_item_0
;
DROP
TABLE
t_order_item_1
;
DROP
TABLE
t_order_item_2
;
DROP
TABLE
t_order_item_3
;
DROP
TABLE
t_order_item_4
;
DROP
TABLE
t_order_item_5
;
DROP
TABLE
t_order_item_6
;
DROP
TABLE
t_order_item_7
;
DROP
TABLE
t_order_item_8
;
DROP
TABLE
t_order_item_9
;
DROP
TABLE
t_config
;
DROP
TABLE
t_global
;
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/master_only.sql
浏览文件 @
1b05c436
DROP
t_order
;
DROP
t_order_item
;
DROP
t_config
;
DROP
t_global
;
DROP
TABLE
t_order
;
DROP
TABLE
t_order_item
;
DROP
TABLE
t_config
;
DROP
TABLE
t_global
;
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/nullable.sql
浏览文件 @
1b05c436
DROP
t_order
;
DROP
TABLE
t_order
;
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/slave.sql
浏览文件 @
1b05c436
DROP
t_order_0
;
DROP
t_order_1
;
DROP
t_order_2
;
DROP
t_order_3
;
DROP
t_order_4
;
DROP
t_order_5
;
DROP
t_order_6
;
DROP
t_order_7
;
DROP
t_order_8
;
DROP
t_order_9
;
DROP
t_order_item_0
;
DROP
t_order_item_1
;
DROP
t_order_item_2
;
DROP
t_order_item_3
;
DROP
t_order_item_4
;
DROP
t_order_item_5
;
DROP
t_order_item_6
;
DROP
t_order_item_7
;
DROP
t_order_item_8
;
DROP
t_order_item_9
;
DROP
t_config
;
DROP
t_global
;
DROP
TABLE
t_order_0
;
DROP
TABLE
t_order_1
;
DROP
TABLE
t_order_2
;
DROP
TABLE
t_order_3
;
DROP
TABLE
t_order_4
;
DROP
TABLE
t_order_5
;
DROP
TABLE
t_order_6
;
DROP
TABLE
t_order_7
;
DROP
TABLE
t_order_8
;
DROP
TABLE
t_order_9
;
DROP
TABLE
t_order_item_0
;
DROP
TABLE
t_order_item_1
;
DROP
TABLE
t_order_item_2
;
DROP
TABLE
t_order_item_3
;
DROP
TABLE
t_order_item_4
;
DROP
TABLE
t_order_item_5
;
DROP
TABLE
t_order_item_6
;
DROP
TABLE
t_order_item_7
;
DROP
TABLE
t_order_item_8
;
DROP
TABLE
t_order_item_9
;
DROP
TABLE
t_config
;
DROP
TABLE
t_global
;
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/slave_only.sql
浏览文件 @
1b05c436
DROP
t_order
;
DROP
t_order_item
;
DROP
t_config
;
DROP
t_global
;
DROP
TABLE
t_order
;
DROP
TABLE
t_order_item
;
DROP
TABLE
t_config
;
DROP
TABLE
t_global
;
sharding-jdbc-core/src/test/resources/integrate/schema/table/drop/tbl.sql
浏览文件 @
1b05c436
DROP
t_order_0
;
DROP
t_order_1
;
DROP
t_order_2
;
DROP
t_order_3
;
DROP
t_order_4
;
DROP
t_order_5
;
DROP
t_order_6
;
DROP
t_order_7
;
DROP
t_order_8
;
DROP
t_order_9
;
DROP
t_order_item_0
;
DROP
t_order_item_1
;
DROP
t_order_item_2
;
DROP
t_order_item_3
;
DROP
t_order_item_4
;
DROP
t_order_item_5
;
DROP
t_order_item_6
;
DROP
t_order_item_7
;
DROP
t_order_item_8
;
DROP
t_order_item_9
;
DROP
t_config
;
DROP
TABLE
t_order_0
;
DROP
TABLE
t_order_1
;
DROP
TABLE
t_order_2
;
DROP
TABLE
t_order_3
;
DROP
TABLE
t_order_4
;
DROP
TABLE
t_order_5
;
DROP
TABLE
t_order_6
;
DROP
TABLE
t_order_7
;
DROP
TABLE
t_order_8
;
DROP
TABLE
t_order_9
;
DROP
TABLE
t_order_item_0
;
DROP
TABLE
t_order_item_1
;
DROP
TABLE
t_order_item_2
;
DROP
TABLE
t_order_item_3
;
DROP
TABLE
t_order_item_4
;
DROP
TABLE
t_order_item_5
;
DROP
TABLE
t_order_item_6
;
DROP
TABLE
t_order_item_7
;
DROP
TABLE
t_order_item_8
;
DROP
TABLE
t_order_item_9
;
DROP
TABLE
t_config
;
sharding-sql-test/src/main/resources/sql/ddl/alter.xml
浏览文件 @
1b05c436
...
...
@@ -2,4 +2,5 @@
<sql-cases>
<sql-case
id=
"assertAlterTable"
value=
"ALTER TABLE t_log ADD name varchar(10)"
/>
<sql-case
id=
"assertAlterTableIfExistAndOnly"
value=
"ALTER TABLE IF EXISTS ONLY t_log ADD name varchar"
db-types=
"PostgreSQL"
/>
<sql-case
id=
"assertAlterTableTOrder"
value=
"ALTER TABLE t_order ADD name varchar(10)"
/>
</sql-cases>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录