From cd95d7d81c3dd16113b4b4839a0819f79906711c Mon Sep 17 00:00:00 2001 From: Yarchik Date: Thu, 2 Jul 2026 12:34:00 +0100 Subject: [PATCH] fix(client): COPY with DB 0 must emit the DB argument --- packages/client/lib/commands/COPY.spec.ts | 9 +++++++++ packages/client/lib/commands/COPY.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/client/lib/commands/COPY.spec.ts b/packages/client/lib/commands/COPY.spec.ts index cd0c6ec9fb..5b58718b0d 100644 --- a/packages/client/lib/commands/COPY.spec.ts +++ b/packages/client/lib/commands/COPY.spec.ts @@ -23,6 +23,15 @@ describe('COPY', () => { ); }); + it('with destination DB flag set to 0', () => { + assert.deepEqual( + parseArgs(COPY, 'source', 'destination', { + DB: 0 + }), + ['COPY', 'source', 'destination', 'DB', '0'] + ); + }); + it('with replace flag', () => { assert.deepEqual( parseArgs(COPY, 'source', 'destination', { diff --git a/packages/client/lib/commands/COPY.ts b/packages/client/lib/commands/COPY.ts index f26a930264..8caa66822e 100644 --- a/packages/client/lib/commands/COPY.ts +++ b/packages/client/lib/commands/COPY.ts @@ -12,7 +12,7 @@ export default { parser.push('COPY'); parser.pushKeys([source, destination]); - if (options?.DB) { + if (options?.DB !== undefined) { parser.push('DB', options.DB.toString()); }