From 6d45a2878b11110d0e447287759bca4019666aa5 Mon Sep 17 00:00:00 2001 From: Siting Ren Date: Wed, 2 Aug 2023 15:41:47 +0800 Subject: [PATCH 1/3] Update ci.yaml --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bafb696a..a113adee 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,7 @@ jobs: run: | docker run -d -p 5433:5433 -p 5444:5444 \ --name vertica_docker --network my-network \ - vertica/vertica-ce:23.3.0-0 + vertica/vertica-ce:12.0.4-0 echo "Vertica startup ..." until docker exec vertica_docker test -f /data/vertica/VMart/agent_start.out; do \ echo "..."; \ From 23d0b591beb8d769a34d5098f73edd8c808d7d89 Mon Sep 17 00:00:00 2001 From: Siting Ren Date: Thu, 3 Aug 2023 10:07:29 +0000 Subject: [PATCH 2/3] fix verified files --- vertica_python/vertica/cursor.py | 3 ++- .../vertica/messages/frontend_messages/verified_files.py | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/vertica_python/vertica/cursor.py b/vertica_python/vertica/cursor.py index eccef2f7..06e33057 100644 --- a/vertica_python/vertica/cursor.py +++ b/vertica_python/vertica/cursor.py @@ -777,7 +777,8 @@ def _handle_copy_local_protocol(self): # Check that the input files are readable self.valid_read_file_path = self._check_copy_local_files(input_files) - self.connection.write(messages.VerifiedFiles(self.valid_read_file_path)) + self.connection.write(messages.VerifiedFiles(self.valid_read_file_path, + self.connection.parameters.get('protocol_version', 0))) except Exception as e: tb = sys.exc_info()[2] stk = traceback.extract_tb(tb, 1) diff --git a/vertica_python/vertica/messages/frontend_messages/verified_files.py b/vertica_python/vertica/messages/frontend_messages/verified_files.py index 486ad3fa..163874be 100644 --- a/vertica_python/vertica/messages/frontend_messages/verified_files.py +++ b/vertica_python/vertica/messages/frontend_messages/verified_files.py @@ -24,12 +24,16 @@ class VerifiedFiles(BulkFrontendMessage): message_id = b'F' - def __init__(self, file_list): + def __init__(self, file_list, protocol_version): BulkFrontendMessage.__init__(self) self.filenames = file_list + self.protocol_version = protocol_version def read_bytes(self): - bytes_ = pack('!I', len(self.filenames)) + if self.protocol_version >= (3 << 16 | 15): + bytes_ = pack('!I', len(self.filenames)) # Int32 + else: + bytes_ = pack('!H', len(self.filenames)) # Int16 for filename in self.filenames: utf_filename = filename.encode('utf-8') bytes_ += pack('!{0}sx'.format(len(utf_filename)), utf_filename) From 1478c5240152e050d848342b7cbef83858336215 Mon Sep 17 00:00:00 2001 From: Siting Ren Date: Thu, 3 Aug 2023 10:13:55 +0000 Subject: [PATCH 3/3] update ci --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a113adee..bafb696a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,7 @@ jobs: run: | docker run -d -p 5433:5433 -p 5444:5444 \ --name vertica_docker --network my-network \ - vertica/vertica-ce:12.0.4-0 + vertica/vertica-ce:23.3.0-0 echo "Vertica startup ..." until docker exec vertica_docker test -f /data/vertica/VMart/agent_start.out; do \ echo "..."; \