@@ -251,57 +251,57 @@ CREATE TABLE other_db.t1(a int);
251251 {
252252 name : "fully-qualified-table-name" ,
253253 query : "CREATE SCHEDULE FOR BACKUP mydb.public.t1 INTO $1 RECURRING '@hourly'" ,
254- expectedBackupStmt : "BACKUP TABLE mydb.public.t1 INTO '%s' WITH detached" ,
254+ expectedBackupStmt : "BACKUP TABLE mydb.public.t1 INTO '%s' WITH OPTIONS ( detached) " ,
255255 },
256256 {
257257 name : "schema-qualified-table-name" ,
258258 query : "CREATE SCHEDULE FOR BACKUP public.t1 INTO $1 RECURRING '@hourly'" ,
259- expectedBackupStmt : "BACKUP TABLE mydb.public.t1 INTO '%s' WITH detached" ,
259+ expectedBackupStmt : "BACKUP TABLE mydb.public.t1 INTO '%s' WITH OPTIONS ( detached) " ,
260260 },
261261 {
262262 name : "uds-qualified-table-name" ,
263263 query : "CREATE SCHEDULE FOR BACKUP myschema.mytbl INTO $1 RECURRING '@hourly'" ,
264- expectedBackupStmt : "BACKUP TABLE mydb.myschema.mytbl INTO '%s' WITH detached" ,
264+ expectedBackupStmt : "BACKUP TABLE mydb.myschema.mytbl INTO '%s' WITH OPTIONS ( detached) " ,
265265 },
266266 {
267267 name : "db-qualified-table-name" ,
268268 query : "CREATE SCHEDULE FOR BACKUP mydb.t1 INTO $1 RECURRING '@hourly'" ,
269- expectedBackupStmt : "BACKUP TABLE mydb.public.t1 INTO '%s' WITH detached" ,
269+ expectedBackupStmt : "BACKUP TABLE mydb.public.t1 INTO '%s' WITH OPTIONS ( detached) " ,
270270 },
271271 {
272272 name : "unqualified-table-name" ,
273273 query : "CREATE SCHEDULE FOR BACKUP t1 INTO $1 RECURRING '@hourly'" ,
274- expectedBackupStmt : "BACKUP TABLE mydb.public.t1 INTO '%s' WITH detached" ,
274+ expectedBackupStmt : "BACKUP TABLE mydb.public.t1 INTO '%s' WITH OPTIONS ( detached) " ,
275275 },
276276 {
277277 name : "unqualified-table-name-with-symbols" ,
278278 query : `CREATE SCHEDULE FOR BACKUP "my.tbl" INTO $1 RECURRING '@hourly'` ,
279- expectedBackupStmt : `BACKUP TABLE mydb.public."my.tbl" INTO '%s' WITH detached` ,
279+ expectedBackupStmt : `BACKUP TABLE mydb.public."my.tbl" INTO '%s' WITH OPTIONS ( detached) ` ,
280280 },
281281 {
282282 name : "table-names-from-different-db" ,
283283 query : "CREATE SCHEDULE FOR BACKUP t1, other_db.t1 INTO $1 RECURRING '@hourly'" ,
284- expectedBackupStmt : "BACKUP TABLE mydb.public.t1, other_db.public.t1 INTO '%s' WITH detached" ,
284+ expectedBackupStmt : "BACKUP TABLE mydb.public.t1, other_db.public.t1 INTO '%s' WITH OPTIONS ( detached) " ,
285285 },
286286 {
287287 name : "unqualified-all-tables-selectors" ,
288288 query : "CREATE SCHEDULE FOR BACKUP * INTO $1 RECURRING '@hourly'" ,
289- expectedBackupStmt : "BACKUP TABLE mydb.public.* INTO '%s' WITH detached" ,
289+ expectedBackupStmt : "BACKUP TABLE mydb.public.* INTO '%s' WITH OPTIONS ( detached) " ,
290290 },
291291 {
292292 name : "all-tables-selectors-with-user-defined-schema" ,
293293 query : "CREATE SCHEDULE FOR BACKUP myschema.* INTO $1 RECURRING '@hourly'" ,
294- expectedBackupStmt : "BACKUP TABLE mydb.myschema.* INTO '%s' WITH detached" ,
294+ expectedBackupStmt : "BACKUP TABLE mydb.myschema.* INTO '%s' WITH OPTIONS ( detached) " ,
295295 },
296296 {
297297 name : "partially-qualified-all-tables-selectors-with-different-db" ,
298298 query : "CREATE SCHEDULE FOR BACKUP other_db.* INTO $1 RECURRING '@hourly'" ,
299- expectedBackupStmt : "BACKUP TABLE other_db.public.* INTO '%s' WITH detached" ,
299+ expectedBackupStmt : "BACKUP TABLE other_db.public.* INTO '%s' WITH OPTIONS ( detached) " ,
300300 },
301301 {
302302 name : "fully-qualified-all-tables-selectors-with-multiple-dbs" ,
303303 query : "CREATE SCHEDULE FOR BACKUP *, other_db.* INTO $1 RECURRING '@hourly'" ,
304- expectedBackupStmt : "BACKUP TABLE mydb.public.*, other_db.public.* INTO '%s' WITH detached" ,
304+ expectedBackupStmt : "BACKUP TABLE mydb.public.*, other_db.public.* INTO '%s' WITH OPTIONS ( detached) " ,
305305 },
306306 }
307307
@@ -359,8 +359,8 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
359359 expectedSchedules : []expectedSchedule {
360360 {
361361 nameRe : "BACKUP .+" ,
362- backupStmt : "BACKUP INTO 'nodelocal://1/backup?AWS_SECRET_ACCESS_KEY=neverappears' WITH detached" ,
363- shownStmt : "BACKUP INTO 'nodelocal://1/backup?AWS_SECRET_ACCESS_KEY=redacted' WITH detached" ,
362+ backupStmt : "BACKUP INTO 'nodelocal://1/backup?AWS_SECRET_ACCESS_KEY=neverappears' WITH OPTIONS ( detached) " ,
363+ shownStmt : "BACKUP INTO 'nodelocal://1/backup?AWS_SECRET_ACCESS_KEY=redacted' WITH OPTIONS ( detached) " ,
364364 period : time .Hour ,
365365 },
366366 },
@@ -372,7 +372,7 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
372372 expectedSchedules : []expectedSchedule {
373373 {
374374 nameRe : "my-backup" ,
375- backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH detached" ,
375+ backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH OPTIONS ( detached) " ,
376376 period : time .Hour ,
377377 },
378378 },
@@ -384,7 +384,7 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
384384 expectedSchedules : []expectedSchedule {
385385 {
386386 nameRe : "BACKUP .+" ,
387- backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH detached" ,
387+ backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH OPTIONS ( detached) " ,
388388 period : time .Hour ,
389389 },
390390 },
@@ -396,14 +396,14 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
396396 expectedSchedules : []expectedSchedule {
397397 {
398398 nameRe : "BACKUP .*" ,
399- backupStmt : "BACKUP INTO LATEST IN 'nodelocal://1/backup' WITH detached" ,
399+ backupStmt : "BACKUP INTO LATEST IN 'nodelocal://1/backup' WITH OPTIONS ( detached) " ,
400400 period : time .Hour ,
401401 paused : true ,
402402 chainProtectedTimestampRecord : true ,
403403 },
404404 {
405405 nameRe : "BACKUP .+" ,
406- backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH detached" ,
406+ backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH OPTIONS ( detached) " ,
407407 period : 24 * time .Hour ,
408408 runsNow : true ,
409409 chainProtectedTimestampRecord : true ,
@@ -417,14 +417,14 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
417417 expectedSchedules : []expectedSchedule {
418418 {
419419 nameRe : "my-backup" ,
420- backupStmt : "BACKUP INTO LATEST IN 'nodelocal://1/backup' WITH detached" ,
420+ backupStmt : "BACKUP INTO LATEST IN 'nodelocal://1/backup' WITH OPTIONS ( detached) " ,
421421 period : time .Hour ,
422422 paused : true ,
423423 chainProtectedTimestampRecord : true ,
424424 },
425425 {
426426 nameRe : "my-backup" ,
427- backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH detached" ,
427+ backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH OPTIONS ( detached) " ,
428428 period : 24 * time .Hour ,
429429 runsNow : true ,
430430 chainProtectedTimestampRecord : true ,
@@ -438,7 +438,7 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
438438 expectedSchedules : []expectedSchedule {
439439 {
440440 nameRe : "BACKUP .+" ,
441- backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH revision_history = true, detached" ,
441+ backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH OPTIONS ( revision_history = true, detached) " ,
442442 period : time .Hour ,
443443 },
444444 },
@@ -450,14 +450,14 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
450450 expectedSchedules : []expectedSchedule {
451451 {
452452 nameRe : "BACKUP .*" ,
453- backupStmt : "BACKUP INTO LATEST IN 'nodelocal://1/backup' WITH detached, incremental_location = 'nodelocal://1/incremental'" ,
453+ backupStmt : "BACKUP INTO LATEST IN 'nodelocal://1/backup' WITH OPTIONS ( detached, incremental_location = 'nodelocal://1/incremental') " ,
454454 period : time .Hour ,
455455 paused : true ,
456456 chainProtectedTimestampRecord : true ,
457457 },
458458 {
459459 nameRe : "BACKUP .+" ,
460- backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH detached" ,
460+ backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH OPTIONS ( detached) " ,
461461 period : 24 * time .Hour ,
462462 runsNow : true ,
463463 chainProtectedTimestampRecord : true ,
@@ -475,15 +475,15 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
475475 nameRe : "BACKUP .*" ,
476476 backupStmt : "BACKUP TABLE system.public.jobs, " +
477477 "system.public.scheduled_jobs INTO LATEST IN 'nodelocal://1/backup' WITH" +
478- " revision_history = true, detached" ,
478+ " OPTIONS ( revision_history = true, detached) " ,
479479 period : time .Hour ,
480480 paused : true ,
481481 chainProtectedTimestampRecord : true ,
482482 },
483483 {
484484 nameRe : "BACKUP .+" ,
485485 backupStmt : "BACKUP TABLE system.public.jobs, " +
486- "system.public.scheduled_jobs INTO 'nodelocal://1/backup' WITH revision_history = true, detached" ,
486+ "system.public.scheduled_jobs INTO 'nodelocal://1/backup' WITH OPTIONS ( revision_history = true, detached) " ,
487487 period : 24 * time .Hour ,
488488 runsNow : true ,
489489 chainProtectedTimestampRecord : true ,
@@ -499,14 +499,14 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
499499 expectedSchedules : []expectedSchedule {
500500 {
501501 nameRe : "BACKUP .*" ,
502- backupStmt : "BACKUP DATABASE system INTO LATEST IN 'nodelocal://1/backup' WITH revision_history = true, detached" ,
502+ backupStmt : "BACKUP DATABASE system INTO LATEST IN 'nodelocal://1/backup' WITH OPTIONS ( revision_history = true, detached) " ,
503503 period : time .Hour ,
504504 paused : true ,
505505 chainProtectedTimestampRecord : true ,
506506 },
507507 {
508508 nameRe : "BACKUP .+" ,
509- backupStmt : "BACKUP DATABASE system INTO 'nodelocal://1/backup' WITH revision_history = true, detached" ,
509+ backupStmt : "BACKUP DATABASE system INTO 'nodelocal://1/backup' WITH OPTIONS ( revision_history = true, detached) " ,
510510 period : 24 * time .Hour ,
511511 runsNow : true ,
512512 chainProtectedTimestampRecord : true ,
@@ -522,14 +522,14 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
522522 expectedSchedules : []expectedSchedule {
523523 {
524524 nameRe : "BACKUP .*" ,
525- backupStmt : "BACKUP TABLE system.public.* INTO LATEST IN 'nodelocal://1/backup' WITH revision_history = true, detached" ,
525+ backupStmt : "BACKUP TABLE system.public.* INTO LATEST IN 'nodelocal://1/backup' WITH OPTIONS ( revision_history = true, detached) " ,
526526 period : time .Hour ,
527527 paused : true ,
528528 chainProtectedTimestampRecord : true ,
529529 },
530530 {
531531 nameRe : "BACKUP .+" ,
532- backupStmt : "BACKUP TABLE system.public.* INTO 'nodelocal://1/backup' WITH revision_history = true, detached" ,
532+ backupStmt : "BACKUP TABLE system.public.* INTO 'nodelocal://1/backup' WITH OPTIONS ( revision_history = true, detached) " ,
533533 period : 24 * time .Hour ,
534534 runsNow : true ,
535535 chainProtectedTimestampRecord : true ,
@@ -562,14 +562,14 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
562562 expectedSchedules : []expectedSchedule {
563563 {
564564 nameRe : "my_backup_name" ,
565- backupStmt : "BACKUP INTO LATEST IN 'nodelocal://1/backup' WITH revision_history = true, detached" ,
565+ backupStmt : "BACKUP INTO LATEST IN 'nodelocal://1/backup' WITH OPTIONS ( revision_history = true, detached) " ,
566566 period : time .Hour ,
567567 paused : true ,
568568 chainProtectedTimestampRecord : true ,
569569 },
570570 {
571571 nameRe : "my_backup_name" ,
572- backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH revision_history = true, detached" ,
572+ backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH OPTIONS ( revision_history = true, detached) " ,
573573 period : 24 * time .Hour ,
574574 runsNow : true ,
575575 chainProtectedTimestampRecord : true ,
@@ -584,14 +584,14 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
584584 expectedSchedules : []expectedSchedule {
585585 {
586586 nameRe : "my_backup_name" ,
587- backupStmt : "BACKUP INTO LATEST IN 'nodelocal://1/backup' WITH revision_history = true, detached" ,
587+ backupStmt : "BACKUP INTO LATEST IN 'nodelocal://1/backup' WITH OPTIONS ( revision_history = true, detached) " ,
588588 period : time .Hour ,
589589 paused : true ,
590590 chainProtectedTimestampRecord : true ,
591591 },
592592 {
593593 nameRe : "my_backup_name" ,
594- backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH revision_history = true, detached" ,
594+ backupStmt : "BACKUP INTO 'nodelocal://1/backup' WITH OPTIONS ( revision_history = true, detached) " ,
595595 period : 24 * time .Hour ,
596596 runsNow : true ,
597597 chainProtectedTimestampRecord : true ,
@@ -609,10 +609,10 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
609609 nameRe : "BACKUP .*" ,
610610 backupStmt : "BACKUP TABLE system.public.jobs, " +
611611 "system.public.scheduled_jobs INTO 'nodelocal://1/backup' WITH" +
612- " revision_history = true, encryption_passphrase = 'secret', detached" ,
612+ " OPTIONS ( revision_history = true, encryption_passphrase = 'secret', detached) " ,
613613 shownStmt : "BACKUP TABLE system.public.jobs, " +
614614 "system.public.scheduled_jobs INTO 'nodelocal://1/backup' WITH" +
615- " revision_history = true, encryption_passphrase = '*****', detached" ,
615+ " OPTIONS ( revision_history = true, encryption_passphrase = '*****', detached) " ,
616616 period : 7 * 24 * time .Hour ,
617617 },
618618 },
@@ -634,7 +634,7 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
634634 nameRe : "BACKUP .+" ,
635635 backupStmt : "BACKUP DATABASE system INTO " +
636636 "('nodelocal://1/backup?COCKROACH_LOCALITY=x%3Dy', 'nodelocal://1/backup2?COCKROACH_LOCALITY=default') " +
637- "WITH revision_history = true, detached" ,
637+ "WITH OPTIONS ( revision_history = true, detached) " ,
638638 period : 24 * time .Hour ,
639639 },
640640 },
@@ -655,7 +655,7 @@ func TestSerializesScheduledBackupExecutionArgs(t *testing.T) {
655655 {
656656 nameRe : "BACKUP .+" ,
657657 backupStmt : "BACKUP DATABASE system INTO 'nodelocal://1/backup' " +
658- "WITH revision_history = true, detached, execution locality = 'region=of-france'" ,
658+ "WITH OPTIONS ( revision_history = true, detached, execution locality = 'region=of-france') " ,
659659 period : 24 * time .Hour ,
660660 },
661661 },
0 commit comments