Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1d903592
提交
1d903592
authored
6 年前
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix MySQL compatibility ALTER TABLE DROP INDEX with schema
上级
e5a28ec6
master
version-1.4.198
无相关合并请求
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
45 行增加
和
2 行删除
+45
-2
Parser.java
h2/src/main/org/h2/command/Parser.java
+1
-1
TestScript.java
h2/src/test/org/h2/test/scripts/TestScript.java
+1
-1
dropIndex.sql
h2/src/test/org/h2/test/scripts/ddl/dropIndex.sql
+43
-0
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
1d903592
...
@@ -6093,7 +6093,7 @@ public class Parser {
...
@@ -6093,7 +6093,7 @@ public class Parser {
return
commandIfTableExists
(
schema
,
tableName
,
ifTableExists
,
command
);
return
commandIfTableExists
(
schema
,
tableName
,
ifTableExists
,
command
);
}
else
if
(
readIf
(
"INDEX"
))
{
}
else
if
(
readIf
(
"INDEX"
))
{
// MySQL compatibility
// MySQL compatibility
String
indexOrConstraintName
=
readIdentifierWithSchema
();
String
indexOrConstraintName
=
readIdentifierWithSchema
(
schema
.
getName
()
);
final
SchemaCommand
command
;
final
SchemaCommand
command
;
if
(
schema
.
findIndex
(
session
,
indexOrConstraintName
)
!=
null
)
{
if
(
schema
.
findIndex
(
session
,
indexOrConstraintName
)
!=
null
)
{
DropIndex
dropIndexCommand
=
new
DropIndex
(
session
,
getSchema
());
DropIndex
dropIndexCommand
=
new
DropIndex
(
session
,
getSchema
());
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/TestScript.java
浏览文件 @
1d903592
...
@@ -124,7 +124,7 @@ public class TestScript extends TestDb {
...
@@ -124,7 +124,7 @@ public class TestScript extends TestDb {
}
}
for
(
String
s
:
new
String
[]
{
"alterTableAdd"
,
"alterTableDropColumn"
,
for
(
String
s
:
new
String
[]
{
"alterTableAdd"
,
"alterTableDropColumn"
,
"createAlias"
,
"createSynonym"
,
"createView"
,
"createTable"
,
"createTrigger"
,
"createAlias"
,
"createSynonym"
,
"createView"
,
"createTable"
,
"createTrigger"
,
"dropSchema"
,
"truncateTable"
})
{
"drop
Index"
,
"drop
Schema"
,
"truncateTable"
})
{
testScript
(
"ddl/"
+
s
+
".sql"
);
testScript
(
"ddl/"
+
s
+
".sql"
);
}
}
for
(
String
s
:
new
String
[]
{
"error_reporting"
,
"insertIgnore"
,
for
(
String
s
:
new
String
[]
{
"error_reporting"
,
"insertIgnore"
,
...
...
This diff is collapsed.
Click to expand it.
h2/src/test/org/h2/test/scripts/ddl/dropIndex.sql
0 → 100644
浏览文件 @
1d903592
-- Copyright 2004-2018 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
CREATE
SCHEMA
TEST
;
>
ok
CREATE
TABLE
TEST
.
TBL
(
NAME
VARCHAR
);
>
ok
CREATE
UNIQUE
INDEX
NAME_INDEX
ON
TEST
.
TBL
(
NAME
);
>
ok
-- MySQL compatibility syntax
ALTER
TABLE
TEST
.
TBL
DROP
INDEX
NAME_INDEX
;
>
ok
CREATE
UNIQUE
INDEX
NAME_INDEX
ON
TEST
.
TBL
(
NAME
);
>
ok
-- MySQL compatibility syntax
ALTER
TABLE
TEST
.
TBL
DROP
INDEX
TEST
.
NAME_INDEX
;
>
ok
ALTER
TABLE
TEST
.
TBL
ADD
CONSTRAINT
NAME_INDEX
UNIQUE
(
NAME
);
>
ok
-- MySQL compatibility syntax
ALTER
TABLE
TEST
.
TBL
DROP
INDEX
NAME_INDEX
;
>
ok
ALTER
TABLE
TEST
.
TBL
ADD
CONSTRAINT
NAME_INDEX
UNIQUE
(
NAME
);
>
ok
-- MySQL compatibility syntax
ALTER
TABLE
TEST
.
TBL
DROP
INDEX
TEST
.
NAME_INDEX
;
>
ok
DROP
SCHEMA
TEST
CASCADE
;
>
ok
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论