通过拆分单独的'GO'和'to'来引发 Sybase GOTO 标签的 Sybase GOTO 标签的验证错误



我试图在下面的sql上运行SYbase ASE中的flyway(6.3.3(迁移,但遇到了验证错误。

declare @count smallint
select @count = 1
restart:
print 'yes'
select @count = @count + 1
while @count <= 4
goto restart

Flyway的反应是

Migration R__wes.sql failed
---------------------------
SQL State  : 37000
Error Code : 102
Message    : Incorrect syntax near '4'.
Line       : 1
Statement  : declare @count smallint
select @count = 1
restart:
print 'yes'
select @count = @count + 1
while @count <= 4

问题是FLyway正在将goto关键字破坏为

GO
to

这导致了错误。

declare @count smallint
select @count = 1
restart:
print 'yes'
select @count = @count + 1
while @count <= 4
GO
to restart

我在SQL Server上发现了一个类似的问题,该问题已于去年得到解决https://github.com/flyway/flyway/issues/2307

提前感谢!

我创建了一个可能的修复请求-https://github.com/flyway/flyway/pull/2775

最新更新