Test, ensure pt-table-checksum can handle col names with dots.

This commit is contained in:
Daniel Nichter
2012-03-01 08:20:12 -08:00
parent 3ff75bbec6
commit 7247a3a9ac
3 changed files with 75 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
--
-- test.t
--
REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `no.`, `foo.bar`, CONCAT(ISNULL(`foo.bar`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `test`.`t` FORCE INDEX(`PRIMARY`) WHERE ((`no.` >= ?)) AND ((`no.` <= ?)) /*checksum chunk*/
REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*), '0' FROM `test`.`t` FORCE INDEX(`PRIMARY`) WHERE ((`no.` < ?)) ORDER BY `no.` /*past lower chunk*/
REPLACE INTO `percona`.`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*), '0' FROM `test`.`t` FORCE INDEX(`PRIMARY`) WHERE ((`no.` > ?)) ORDER BY `no.` /*past upper chunk*/
SELECT /*!40001 SQL_NO_CACHE */ `no.` FROM `test`.`t` FORCE INDEX(`PRIMARY`) WHERE ((`no.` >= ?)) ORDER BY `no.` LIMIT ?, 2 /*next chunk boundary*/
1 eight four
2 nine seven
3 six three
4 two two
5 eight
6 two

View File

@@ -0,0 +1,21 @@
drop database if exists test;
create database test;
use test;
CREATE TABLE t (
`No.` varchar(16) NOT NULL DEFAULT '',
`foo.bar` varchar(16),
PRIMARY KEY (`No.`)
) ENGINE=MyISAM;
insert into t values
('one', 'a'),
('two', 'a'),
('three', 'a'),
('four', 'a'),
('five', 'a'),
('six', 'a'),
('seven', 'a'),
('eight', 'a'),
('nine', 'a'),
('ten', 'a');