Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
1943f0eb
Unverified
Commit
1943f0eb
authored
Jan 30, 2024
by
Licho
Committed by
GitHub
Jan 30, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: split problem (#3097)
parent
55d20eaa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
SystemConfiguration.java
...c/main/java/org/dinky/data/model/SystemConfiguration.java
+1
-1
SqlUtil.java
dinky-common/src/main/java/org/dinky/utils/SqlUtil.java
+2
-1
No files found.
dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java
View file @
1943f0eb
...
@@ -68,7 +68,7 @@ public class SystemConfiguration {
...
@@ -68,7 +68,7 @@ public class SystemConfiguration {
.
note
(
Status
.
SYS_FLINK_SETTINGS_USERESTAPI_NOTE
);
.
note
(
Status
.
SYS_FLINK_SETTINGS_USERESTAPI_NOTE
);
private
final
Configuration
<
String
>
sqlSeparator
=
key
(
Status
.
SYS_FLINK_SETTINGS_SQLSEPARATOR
)
private
final
Configuration
<
String
>
sqlSeparator
=
key
(
Status
.
SYS_FLINK_SETTINGS_SQLSEPARATOR
)
.
stringType
()
.
stringType
()
.
defaultValue
(
";\\
s*(?:\\n|--.*)
"
)
.
defaultValue
(
";\\
n
"
)
.
note
(
Status
.
SYS_FLINK_SETTINGS_SQLSEPARATOR_NOTE
);
.
note
(
Status
.
SYS_FLINK_SETTINGS_SQLSEPARATOR_NOTE
);
private
final
Configuration
<
Integer
>
jobIdWait
=
key
(
Status
.
SYS_FLINK_SETTINGS_JOBIDWAIT
)
private
final
Configuration
<
Integer
>
jobIdWait
=
key
(
Status
.
SYS_FLINK_SETTINGS_JOBIDWAIT
)
.
intType
()
.
intType
()
...
...
dinky-common/src/main/java/org/dinky/utils/SqlUtil.java
View file @
1943f0eb
...
@@ -45,7 +45,8 @@ public class SqlUtil {
...
@@ -45,7 +45,8 @@ public class SqlUtil {
return
new
String
[
0
];
return
new
String
[
0
];
}
}
String
[]
splits
=
sql
.
replace
(
"\r\n"
,
"\n"
).
split
(
sqlSeparator
);
final
String
localSqlSeparator
=
";\\s*(?:\\n|--.*)"
;
String
[]
splits
=
sql
.
replace
(
"\r\n"
,
"\n"
).
split
(
localSqlSeparator
);
String
lastStatement
=
splits
[
splits
.
length
-
1
].
trim
();
String
lastStatement
=
splits
[
splits
.
length
-
1
].
trim
();
if
(
lastStatement
.
endsWith
(
SEMICOLON
))
{
if
(
lastStatement
.
endsWith
(
SEMICOLON
))
{
splits
[
splits
.
length
-
1
]
=
lastStatement
.
substring
(
0
,
lastStatement
.
length
()
-
1
);
splits
[
splits
.
length
-
1
]
=
lastStatement
.
substring
(
0
,
lastStatement
.
length
()
-
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment