开发者社区 > PolarDB开源 > PolarDB 分布式版 > 正文

PolarDB-X中程序使用polar2.0偶尔会报错?这个该如何解决?没有,SELECT

PolarDB-X中程序使用polar2.0偶尔会报错### Cause: java.sql.SQLException: [164761fe77811000][10.244.173.16:3306][xio_mes]ERR-CODE: [PXC-4601][ERR_EXECUTOR] ERR-CODE: [PXC-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'XIO_MES_P00000_GROUP' ATOM 'dskey_xio_mes_p00000_group#polardb-x-nxfw-dn-0#10.108.116.15-3306#xio_mes_p00000': The definition of the table required by the flashback query has changed 这个该如何解决?没有,SELECT a.id, a.startTime, a.shiftId, b.NAME AS shiftName, date_format( a.workDate, '%Y-%m-%d' ) AS workday, CASE

	WHEN EXISTS (
	SELECT
		* 
	FROM
		staff_schedule t 
	WHERE
		t.hasSummary = 0 
		AND t.userId = '01244830432421654692' 
		AND timestampdiff( DAY, date_sub( a.startTime, INTERVAL - 1 DAY ), t.workDate ) = 0 
		AND timestampdiff( MINUTE, date_sub( a.startTime, INTERVAL - 1 DAY ), t.startTime ) <= 0 
		) THEN
		(
		SELECT
			t.startTime 
		FROM
			staff_schedule t 
		WHERE
			t.hasSummary = 0 
			AND t.userId = '01244830432421654692'
			AND timestampdiff( DAY, date_sub( a.startTime, INTERVAL - 1 DAY ), t.workDate ) = 0 
			AND timestampdiff( MINUTE, date_sub( a.startTime, INTERVAL - 1 DAY ), t.startTime ) <= 0 
		) ELSE a.endTime 
	END AS endTime 
FROM
	staff_schedule a
	JOIN staff_shift b ON a.shiftId = b.shiftId 
WHERE
	a.hasSummary = 0 
	AND a.userId = '01244830432421654692'
AND isRest = 'N' 
AND timestampdiff( MINUTE, a.startTime, NOW( ) ) >= 1440一到整点就会报错The definition of the table required by the flashback query has changed 该怎么解决,资源应该都是够的,能把这个语句包在事务里跑吗,显式 begin -> sql -> rollback 这样跑试试看

展开
收起
真的很搞笑 2023-06-18 19:16:53 121 0
1 条回答
写回答
取消 提交回答
  • https://zhuanlan.zhihu.com/p/636796226用了 as of 的语法吗?这种查询没开事务,直接跑的是吗,此回答整理自钉群“阿里云 PolarDB-X 开源交流群”

    2023-06-18 19:19:54
    赞同 展开评论 打赏

PolarDB 分布式版 (PolarDB for Xscale,简称“PolarDB-X”) 采用 Shared-nothing 与存储计算分离架构,支持水平扩展、分布式事务、混合负载等能力,100%兼容MySQL。 2021年开源,开源历程及更多信息访问:OpenPolarDB.com/about

相关产品

  • 云原生分布式数据库 PolarDB-X
  • 相关电子书

    更多
    PolarDB-X分布式数据库解决方案 立即下载
    PolarDB-X 2.0 全局 Binlog 与备份恢复能 立即下载
    分布式数据库DRDS全新升级 立即下载