关于临时表的操作问题
今天使用mysql的temporary创建临时表,后将原表的数据复制到临时表中时,出现 table doesn't exist问题,困扰了很久,百思不得其解。
当不使用Temporary字段的时候,就不会出现这个问题,所以一开始以为是创建了临时表之后,临时表不存在于当前的数据库中,而是在其他的表空间内。后来请教了同事,才明白可能是使用Temporary字段的问题。
先来回顾一下temporary的一些基本概念
临时表只在当前连接可见,当关闭连接时,Mysql会自动删除表并释放所有空间。
目前使用线程池处理多并发,sql执行的时候有的时候正常,有的时候报错table doesn't exist。
根据我的理解,因为使用了连接池管理,可能有时候临时表的创建和后续的从原表中将数据导入到临时表以及删除不是同一个连接,于是导致了table doesn't exist这个问题。
后续需要继续跟进了解一下连接池、线程池和“池化”的内容。
- Temporary Mysqlsqlexception temporary failure mysql temporary mysql temporary resolution temporary failure ubuntu directory temporary create remote temporary localhost location xxxxxxx temporary resolving apt-get failure getnextexception kingbase8 relations temporary temporary resolving failure docker resolution temporary failure文件