File: table11.sql

package info (click to toggle)
percona-toolkit 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 68,916 kB
  • sloc: perl: 241,287; sql: 22,868; sh: 19,746; javascript: 6,799; makefile: 353; awk: 38; python: 30; sed: 1
file content (23 lines) | stat: -rw-r--r-- 726 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use test;

-- This table is designed not to work right with ascending slices unless
-- mk-archiver gets the ascending slice right.  The important thing is that
-- the PK columns aren't in the same order as the columns.  If mk-archiver
-- ascends by the first two columns 2 rows at a time, confusing column ordinals
-- with PK ordinals, some rows won't get archived.
drop table if exists table_11;
CREATE TABLE table_11 (
   pk_2 int not null,
   col_1 int not null,
   pk_1 int not null,
   primary key(pk_1, pk_2)
);
-- Notice how the values are being inserted in PK order, but out of
-- first-two-columns-scan order:
insert into table_11(pk_2, col_1, pk_1)
   values
   (1, 1, 1),
   (2, 3, 1),
   (1, 0, 2),
   (1, 0, 3);