Commit Graph

112 Commits

Author SHA1 Message Date
Sveta Smirnova
88367c1dea PT-2407 - pt-online-schema-change exit status(return code) is 0 even if it does NOT succeed
- Changed die call for the case when ALTER TABLE fails for the new table
- Removed stalled comment from Frank
- Added test case
2025-03-26 17:51:35 +03:00
Sveta Smirnova
b332537481 PT-2340 - Support MySQL 8.4
- Fixed staff I broke for 8.0
2024-08-23 16:03:53 +03:00
Sveta Smirnova
76c1202cb5 PT-2340 - Support MySQL 8.4
- Updated modules and tests for pt-online-schema-change
- Removed typo from lib/MasterSlave.pm
2024-07-30 18:20:50 +03:00
Sveta Smirnova
a9a4bc5b6c Merge pull request #792 from percona/PT-2119_pt-osc_aborts_in_8.0.15_even__if_no_FK_exists
PT-2119 - pt-osc aborts in 8.0.15 even if no FK exists
2024-04-08 18:40:11 +03:00
Sveta Smirnova
c87a5da5ba PT-2119 - pt-osc aborts in 8.0.15 even if no FK exists
- Moved check after we identified child tables
- Added test case
2024-04-01 23:36:54 +03:00
Sveta Smirnova
2d4f5c290a PT-1717 - resume pt-online-schema-change if it's interrupted
- Now --resume dies if new table or triggers do not exist
- New table and triggers are not removed if --resume fails during these
  checkups
- Added sample file and more tests for --resume
2024-03-14 21:20:50 +03:00
Sveta Smirnova
8ce3b94a1c PT-1717 - resume pt-online-schema-change if it's interrupted
- Added test case for failures and recovery
- Implemented option --resume
2024-03-05 18:46:14 +03:00
Sveta Smirnova
3e1e9b8425 PT-1860 make pt-osc respect case insesitive lookup on Windows and osx #516
- Run update-modules
- Adjusted fix, so it does not create extra variable to hold $EVAL_ERROR
- Adjusted test case, so it runs on Linux
2023-11-09 17:16:43 +03:00
Ilaria Migliozzi
8e4824813f added new hook before_die (#509)
* added new hook before_die

before die, the script calls this hook in oder to execute extra user's 
operations

* PR-509 -  added new hook before_die

- Added test cases

---------

Co-authored-by: Sveta Smirnova <sveta.smirnova@percona.com>
2023-11-06 18:22:14 +03:00
Sveta Smirnova
46fd033994 PT-2258 - Pass tbl as argument for on_copy_rows_after_nibble (#682)
- Implemented the feature
- Created test case
2023-09-22 13:35:29 +03:00
Sveta Smirnova
9755074cd8 PT-2156 Fix tests for lib, part2 (#650)
* PT-2156 - Fix tests for lib

Fixed tests, broken by putting fix for PT-1554 into the library code, mostly by updating checksums.
Added AutoCommit option for test lib/QueryReview.t
Reset SQL mode to empty to allow TableChunker to work with invalid and zero dates

* PT-2156 - Fix tests for lib

Adjusted t/lib/SchemaIterator.t to work with version 8.0

* PT-2156 - Fix tests for lib

Adjusted b/t/lib/Processlist.t, so it reflects fix for PT-981

* PT-2156 - Fix tests for lib

Adjusted t/lib/HTTP/Micro.t, so it works with different order of parameters, returned at v.percona.com/
Adjusted test for empty files in t/lib/bash/collect.t
Disabled mysqladmin debug test in t/lib/bash/collect.t, because of PT-2242

* PT-2156 - Fix tests for lib

Added LC_NUMERRIC=POSIX into t/lib/bash/report_system_info.sh, so reports in tests are not environment-dependent
Updated expected results in t/lib/bash/report_system_info.sh, so they reflect new information, collected by pt-summary

* PT-2156 - Fix tests for lib

- Improved fix for PT-76, so it handles inline comments
- Added test case for PT-76
- Improved fix for PT-1720, so it ignores unrecognizable option only if it comes from the toolkit-wide files and still errors out if wrong option was passed via command line or the tool-specific option file.

* PT-2156 - Fix tests for lib

- Improved fix for PT-2102, so it finds running instance configuration file using PID and also does not break t/lib/bash/report_mysql_info.t test
- Removed unnecessary copy-paste from t/pt-mysql-summary/pt-2102.t test
- Adjusted number of collected files in t/lib/bash/collect_mysql_info.sh

* PT-2156 - Fix tests for lib

- Fix for PT-1543 and MyRocks collection were originally put only into lib/bash/report_mysql_info.shthat broke the logic of collecting data first, then formatting report from this data. This, in its turn, broke test t/lib/bash/report_mysql_info.sh/t/lib/bash/report_mysql_info.t, because CMD_MYSQL is not defined in this library. I rewrote these fixes, so they follow original logic of the tool (pt-mysql-summary)
- Added tests for keyring plugin, encrypted tables, and MyRocks for t/lib/bash/report_mysql_info.sh and t/pt-mysql-summary/pt-mysql-summary_encryption.t

* PT-2156 - Fix tests for lib

- Added FLUSH TABLES to t/lib/bash/collect.sh, so it does not fail opentables tests if run when more than 1000 tables open in the sandbox environment
- Changed number of expected sample files to reflect keyring colletion file

* PT-2156 - Fix tests for lib

- Added skip to some tests in lib that file when run with PXC, because not supported to work with PXC
- Adjusted configuration files for PXC, so they allow LOAD DATA/SELECT INTO OUTFILE commands
- Adjusted data samples, so they do not depend on auto increment values
- Fixed lib tests, failing with PXC

* PT-2156 - Fix tests for lib

Updated tests for pt-online-schema-change, so they work with PXC and skipped if designed for semi-synchronous replication setup

* PT-2156 - Fix tests for lib

- Added cluster-specific samples for t/lib/SchemaIterator.t
- Removed extra debugging print from t/pt-table-checksum/pt-1728.t

* PT-2156 - Fix tests for lib

Evgeniy's review on July 20

* Update t/lib/TableSyncer.t

Removed comment left after debugging

* Update t/pt-mysql-summary/pt-mysql-summary_encryption.t

Removed extra debug output

* PT-2156 - Fix tests for lib

Tabs to spaces
2023-08-02 14:50:21 +03:00
PinoCao
91f9e27255 PT-2241 - fix(pt-online-schema-change): using --skip-check-slave-lag multiple times does not work as expected (#622)
* fix(pt-online-schema-change): Fix the issue where using --skip-check-slave-lag multiple times does not work as expected.

* PT-2241: add test cases for pt-online-schema-change

* Update t/pt-online-schema-change/pt-2241.t

fix():reset the delay on replicas

Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>

---------

Co-authored-by: Sveta Smirnova <svetasmirnova@users.noreply.github.com>
2023-07-31 16:59:09 +03:00
Marcelo HP Ferreira
8ece30ff2f Add after nibble hook to pt-online-schema-change (#645)
* Include hook after nibble on copy rows

* Update tests with new hook for pt-online-schema-change
2023-07-31 16:30:24 +03:00
Sveta Smirnova
249b5b61e9 PT-2048 - pt-osc spans excessive connections to the replica when executing in the source (#613)
* PT-2048 - pt-osc spans excessive connections to the replica when executing in the source

The bug itself is fixed by PT-2160: 'fix tests for pt online schema change'

* PT-2048 - pt-osc spans excessive connections to the replica when executing in the source

Suggestions by Saikumar

* PT-2048 - pt-osc spans excessive connections to the replica when executing in the source

Typos in the test file
2023-05-09 14:22:29 +03:00
Sveta Smirnova
bfc00b93a8 PT-2160 fix tests for pt online schema change (#602)
* PT-2160 - Fix tests for pt-online-schema-change

Re-enabled tests after MySQL bug #89441 fix in 8.0.14 and later
Updated t/pt-online-schema-change/samples/basic_no_fks_innodb.sql, so its unique index is NOT NULL
Added synchonizations when tests are waiting for too long due to slave catch up
Added innodb_directories option for t/pt-online-schema-change/pt-244.t

* PT-2160 - Fix tests for pt-online-schema-change
PT-2048 - pt-osc spans excessive connections to the replica when executing in the source

t/pt-online-schema-change/slave_lag.t was failing due to PT-2048. I added code that reuses already created connections when checks for slave in the wait loop. It fixes slave_lag.t too.
I also added that prints more detailed error when fails to connect to the replica.

* PT-2160 - Fix tests for pt-online-schema-change

Modified t/pt-online-schema-change/slave_lag.t, so it runs and clean ups faster.

* PT-2160 - Fix tests for pt-online-schema-change

Modified t/pt-online-schema-change/pt-1455.t, so it runs and clean ups faster.

* PT-2160 - Fix tests for pt-online-schema-change

Fixed search for HASH and BTREE keys broken by fix for PT-2123
Updated modules for pt-archiver
Fixed die message for sandbox/start-sandbox
Added global_grants table to list of exceptions for the ok function in lib/Sandbox.pm
Added wait_for_slaves to bugs.t, so changes on the source are copied to replica before pt-osc starts working
Updated PXC tests
Added wait_for_slaves to pt-1455.t
Fixed regular expression in pt-229.t, so it works with both 5.x and 8.0 versions
Added innodb_directories option for pt-244.t, so it does not fail on 8.0
Modified slave_lag.t, so it is more stable and slow enough, so pt-osc can print message about delayed replicas
2023-02-27 01:19:11 +03:00
Sveta Smirnova
01de987154 PT-2141 fix tests for pt-archiver (#581)
* PT-2141 Fix tests for pt-archiver

Fixed tests t/pt-archiver/bulk_insert.t, t/pt-archiver/issue_1225.t, t/pt-archiver/issue_1229.t
Their failures were due to change of utf8 alias from utf8mb3 in MySQL 5.7 to utf8mb4 in MySQL 8.0.
And also due to character set match check between connection ad source table.

* PT-2141 Fix tests for pt-archiver

Removed test for PT-1898, because it was broken from the beginning:
- it called pt-online-schema-change instead of pt-archiver
- it announced it will run 6 tests while was running only 2
- the test case itself did not test the issue, described in PT-1898
2023-02-02 17:09:34 +03:00
Carlos Salguero
e570cecbab PT-1914 Column data lost when 'Generated' is in the column comment (#482)
* PMM-1914 Fixed column parsing having generated

Fixed table parser code that errouneously considered a column as
generated when the default was empty DEFAULT '' and the COMMENT had
the word 'Generated'.

* PMM-1914 Updated TableParser in all programs

* PT-1914 Updated changelog

* PT-1914 Added test
2021-03-09 11:46:05 -03:00
Carlos Salguero
4f78d5450c PT-1919 drop-swap can drop triggers (#483)
* PT-1919 drop-swap can drop triggers

* PT-1919 Update changelog
2021-03-05 11:32:03 -03:00
Carlos Salguero
9ef2b56f4d PT-1905 Reverse triggers (#477)
* PT-1905 Reverse triggers

* WIP

* PT-1905 Updated reverse triggers creation

* PT-1905 Fixed trigger creation
2021-01-12 13:58:34 -03:00
Carlos Salguero
71c9902532 PT-1898 pt archiver keeps transaction open (#479)
* PT-1898 WIP

* PT-1898 Added commit for open txns

* PT-1898 Added commit for open txns

* PT-1898 removed dev leftover
2021-01-12 13:40:51 -03:00
Carlos Salguero
2233224ff6 PT-1528 pt-online-schema-change "Invalid utf8mb4 character string (#473)
* PT-1528 [WIP] Proposed solution

* PT-1528 Ingore UTF8 warning
2020-12-24 16:22:46 -03:00
Carlos Salguero
d7a7a1c7a5 PT-169 Handle drop-swap errors in pt-online-schema-change (#467)
* PT-169 Fixed drop-swap error handling

* PT-169 Fixed drop_swap error handling
2020-10-12 15:36:45 -03:00
Carlos Salguero
c6b4bd747e PT-1852 Added --no-check-foreing-keys to pt-osc 2020-06-21 18:53:47 -03:00
Carlos Salguero
54f90e4bdf PT-1802 WIP 2020-04-02 09:57:45 -03:00
Carlos Salguero
6a302e2b07 PT-1757 Implemented fallback in NibbleIterator
Since now NibbleIterator can fallback to nibble (from one chunk) pt-osc
can nibble tables even if due to unacurate stats, it choses one nible as
the initial nibbling method.
2019-10-13 21:58:56 -03:00
Carlos Salguero
30896506db PT-1705 Added exit codes to pt-osc 2019-08-13 22:01:49 -03:00
Carlos Salguero
dc9edf7cda PT-1574 Fixed undefs handling 2018-08-07 14:21:44 -03:00
Carlos Salguero
7260bab2dc PT-1574 Added a test case 2018-08-07 01:03:58 -03:00
Carlos Salguero
2b45f192b0 PT-1574 Improved detection of nullable keys 2018-07-27 13:34:19 -03:00
Carlos Salguero
f5fd795fda PT-1559 pt-osc --alter-foreign-keys-method=drop_swap doesn't work with MySQL 8.0+ 2018-06-13 16:46:40 -03:00
Carlos Salguero
0004bb7bbc PT-1554 (WIP) Tests for MySQL 8
There are tests failing but the sandbox doesn't crash
2018-05-30 21:25:28 -03:00
Carlos Salguero
8943e0a9f6 Merge branch '3.0' into mysql-8 2018-02-19 12:11:07 -03:00
Carlos Salguero
d8ec16f213 PMM-1455 pt-osc is stuck when the table that is being altered is filtered out in the slave 2018-02-16 14:27:16 -03:00
Carlos Salguero
943cb68ee0 PMM-1455 Tests added 2018-02-08 13:07:13 -03:00
Carlos Salguero
d38a584271 Fixes for DSN parser to use UTF8 2018-01-28 14:46:51 -03:00
Carlos Salguero
7c1c99d9ca PT-244 Fixed --data-dir with partitions
Made DATA DIRECTORY to be inserted at the correct place, not at the end
of the create table query.
2018-01-16 15:57:06 -03:00
Carlos Salguero
bb3334de08 Updated tests for MySQL 5.7 2017-12-16 20:54:03 -03:00
Carlos Salguero
99a17cd041 PT-207 Fixed tests 2017-12-16 11:28:03 -03:00
Carlos Salguero
dc6b8c22f0 PT-205 pt-online-schema-change show message on rocksdb if binlog_format != row 2017-12-14 18:15:14 -03:00
Carlos Salguero
fe51f68587 PT-229 WIP 2017-12-07 16:28:48 -03:00
Carlos Salguero
6742025dd0 PT-209 Check adding FKs to a RocksDB table 2017-11-13 16:07:12 -03:00
Carlos Salguero
b51d09d811 PT-202 pt-online-schema-change fails with virtual columns
Modified TableParser to ignore GENERATED columns from the columns list
used to construct SELECTs/INSERTs
2017-10-05 15:19:57 -03:00
Carlos Salguero
7e59feb8dd PT-196 pt-onine-schema-change is pausing because {some_status_variable}=0
Description here
2017-08-30 14:54:47 -03:00
Carlos Salguero
d939d2bf30 PT-186 osc doesn't recognize mixed case in field names
--alter 'CHANGE COLUMN C1 c1 ...' was failing because osc was not
lowering the case of the field names when trying to detect renamed
columns.
2017-08-04 17:57:14 -03:00
Carlos Salguero
b6bec3965a PT-181 online-schema-change not in sync with modules
- Modules updated
- Improved tests
2017-07-27 11:28:46 -03:00
Carlos Salguero
abff09ab77 Merge pull request #235 from percona/PT-91-MySQL-5.7
PT-91 Added --preserve-triggers feature for MySQL 5.7+
2017-07-26 16:02:59 -03:00
Carlos Salguero
7e15cf2179 PT-178 Fixed regression in --check-slave-lag option
Reverted PR #119 https://github.com/percona/percona-toolkit/pull/119 and
Added new tests to prevent this happening again.
2017-07-26 13:29:38 -03:00
Carlos Salguero
7772630bf5 PT-91 WIP 2017-07-05 11:19:04 -03:00
Carlos Salguero
6f12882b91 PT-91 Added --preserve-triggers feature for MySQL 5.7+ 2017-07-04 14:23:32 -03:00
Carlos Salguero
3d0deabbdf PT-153 Added --[no]fail-on-unique-key-change param 2017-06-27 13:53:08 -03:00