diff --git a/async_gaussdb/_version.py b/async_gaussdb/_version.py index 245eee7e..dcbe9364 100644 --- a/async_gaussdb/_version.py +++ b/async_gaussdb/_version.py @@ -14,4 +14,4 @@ import typing -__version__: typing.Final = '0.30.0' +__version__: typing.Final = '0.30.1' diff --git a/async_gaussdb/protocol/protocol.pyx b/async_gaussdb/protocol/protocol.pyx index a3397b48..ccb5b0e1 100644 --- a/async_gaussdb/protocol/protocol.pyx +++ b/async_gaussdb/protocol/protocol.pyx @@ -895,8 +895,14 @@ cdef class BaseProtocol(CoreProtocol): if self.result_type == RESULT_FAILED: if isinstance(self.result, dict): - exc = apg_exc_base.GaussDBError.new( - self.result, query=self.last_query) + sql_state = self.result.get('C') + if sql_state and sql_state=='29P06': + exc = apg_exc.InvalidCachedStatementError( + 'cached statement plan is invalid' + ) + else: + exc = apg_exc_base.GaussDBError.new( + self.result, query=self.last_query) else: exc = self.result waiter.set_exception(exc) diff --git a/pyproject.toml b/pyproject.toml index bfd2e718..e5097099 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ ] [project.urls] -github = "https://github.com/MagicStack/async_gaussdb" +github = "https://github.com/HuaweiCloudDeveloper/gaussdb-python-async" [project.optional-dependencies] gssauth = [ diff --git a/tests/test_cache_invalidation.py b/tests/test_cache_invalidation.py index e6ab6f30..707599e2 100644 --- a/tests/test_cache_invalidation.py +++ b/tests/test_cache_invalidation.py @@ -27,7 +27,6 @@ def _check_statements_are_closed(self, statements): self.assertGreater(len(statements), 0) self.assertTrue(all(s.closed for s in statements)) - @unittest.skip('cached plan must not change result type') async def test_prepare_cache_invalidation_silent(self): await self.con.execute('CREATE TABLE tab1(a int, b int)') @@ -49,7 +48,6 @@ async def test_prepare_cache_invalidation_silent(self): finally: await self.con.execute('DROP TABLE tab1') - @unittest.skip('cached plan must not change result type') async def test_prepare_cache_invalidation_in_transaction(self): await self.con.execute('CREATE TABLE tab1(a int, b int)') @@ -311,7 +309,7 @@ async def test_type_cache_invalidation_on_change_attr(self): @unittest.skip('UNLISTEN statement is not yet supported.') async def test_type_cache_invalidation_in_pool(self): - await self.con.execute('CREATE DATABASE IF NOT EXISTS testdb') + await self.con.execute('CREATE DATABASE testdb') pool = await self.create_pool(database='postgres', min_size=2, max_size=2)