mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-26 12:21:27 -07:00
Cut column-statistics disabling
Thanks to our test-container, we now use the correspond mysql-client. So to test mysql 5.7 we use mysql-client-5.7 and to test mysql 8 we use mysql-client-8.
This commit is contained in:
parent
fbb0290e19
commit
8f0d1f5b14
5 changed files with 1 additions and 181 deletions
|
@ -36,12 +36,6 @@
|
|||
command: "{{ mysql_command }} {{ db_latin1_name }} -e \"select * from testlatin1\""
|
||||
register: output
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Encoding | Dumping a table in Latin1 database
|
||||
mysql_db:
|
||||
login_user: '{{ mysql_user }}'
|
||||
|
@ -52,10 +46,6 @@
|
|||
encoding: latin1
|
||||
target: "{{ latin1_file1 }}"
|
||||
state: dump
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
|
|
|
@ -27,72 +27,32 @@
|
|||
- "CREATE TABLE db1.t2 (id int)"
|
||||
- "CREATE VIEW db2.v1 AS SELECT id from db1.t1"
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dumps errors | Full dump without compression
|
||||
community.mysql.mysql_db:
|
||||
state: dump
|
||||
name: all
|
||||
target: /tmp/full-dump.sql
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: full_dump
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dumps errors | Full dump with gunzip
|
||||
community.mysql.mysql_db:
|
||||
state: dump
|
||||
name: all
|
||||
target: /tmp/full-dump.sql.gz
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: full_dump_gz
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dumps errors | Distinct dump without compression
|
||||
community.mysql.mysql_db:
|
||||
state: dump
|
||||
name: db2
|
||||
target: /tmp/dump-db2.sql
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: dump_db2
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dumps errors | Distinct dump with gunzip
|
||||
community.mysql.mysql_db:
|
||||
state: dump
|
||||
name: db2
|
||||
target: /tmp/dump-db2.sql.gz
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: dump_db2_gz
|
||||
|
||||
- name: Dumps errors | Check distinct dumps are changed
|
||||
|
@ -107,60 +67,30 @@
|
|||
query:
|
||||
- "DROP TABLE db1.t1"
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dumps errors | Full dump after drop t1 without compression
|
||||
community.mysql.mysql_db:
|
||||
state: dump
|
||||
name: all
|
||||
target: /tmp/full-dump-without-t1.sql
|
||||
pipefail: true # This should do nothing
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
|
||||
register: full_dump_without_t1
|
||||
ignore_errors: true
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dumps errors | Full dump after drop t1 with gzip without the fix
|
||||
community.mysql.mysql_db:
|
||||
state: dump
|
||||
name: all
|
||||
target: /tmp/full-dump-without-t1.sql.gz
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: full_dump_without_t1_gz_without_fix
|
||||
ignore_errors: true
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dumps errors | Full dump after drop t1 with gzip with the fix
|
||||
community.mysql.mysql_db:
|
||||
state: dump
|
||||
name: all
|
||||
target: /tmp/full-dump-without-t1.sql.gz
|
||||
pipefail: true
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: full_dump_without_t1_gz_with_fix
|
||||
ignore_errors: true
|
||||
|
||||
|
@ -175,59 +105,29 @@
|
|||
- full_dump_without_t1_gz_with_fix.msg is search(
|
||||
'references invalid table')
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dumps errors | Distinct dump after drop t1 without compression
|
||||
community.mysql.mysql_db:
|
||||
state: dump
|
||||
name: db2
|
||||
target: /tmp/dump-db2-without_t1.sql
|
||||
pipefail: true # This should do nothing
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: dump_db2_without_t1
|
||||
ignore_errors: true
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dumps errors | Distinct dump after drop t1 with gzip without the fix
|
||||
community.mysql.mysql_db:
|
||||
state: dump
|
||||
name: db2
|
||||
target: /tmp/dump-db2-without_t1.sql.gz
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: dump_db2_without_t1_gz_without_fix
|
||||
ignore_errors: true
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dumps errors | Distinct dump after drop t1 with gzip with the fix
|
||||
community.mysql.mysql_db:
|
||||
state: dump
|
||||
name: db2
|
||||
target: /tmp/dump-db2-without_t1.sql.gz
|
||||
pipefail: true
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: dump_db2_without_t1_gz_with_fix
|
||||
ignore_errors: true
|
||||
|
||||
|
|
|
@ -385,12 +385,6 @@
|
|||
# ==========================================================================
|
||||
# Dump existing databases
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dump existing databases
|
||||
mysql_db:
|
||||
login_user: '{{ mysql_user }}'
|
||||
|
@ -403,10 +397,6 @@
|
|||
- '{{ db3_name }}'
|
||||
state: dump
|
||||
target: '{{ dump1_file }}'
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: dump_result
|
||||
|
||||
- name: Assert successful completion of dump operation (existing database)
|
||||
|
@ -448,12 +438,6 @@
|
|||
name: '{{ dump2_file }}'
|
||||
state: absent
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dump existing databases
|
||||
mysql_db:
|
||||
login_user: '{{ mysql_user }}'
|
||||
|
@ -463,10 +447,6 @@
|
|||
name: all
|
||||
state: dump
|
||||
target: '{{ dump2_file }}'
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: dump_result
|
||||
|
||||
- name: assert successful completion of dump operation
|
||||
|
|
|
@ -89,12 +89,6 @@
|
|||
name: '{{ dump_file2 }}'
|
||||
state: absent
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dump and Import | State dump without department table.
|
||||
mysql_db:
|
||||
login_user: '{{ db_user }}'
|
||||
|
@ -106,15 +100,12 @@
|
|||
state: dump
|
||||
target: '{{ db_file_name }}'
|
||||
ignore_tables:
|
||||
- "{{ db_name }}.department"
|
||||
- "{{ db_name }}.department"
|
||||
force: yes
|
||||
master_data: 1
|
||||
skip_lock_tables: yes
|
||||
dump_extra_args: >-
|
||||
--skip-triggers
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
config_file: '{{ config_file }}'
|
||||
restrict_config_file: yes
|
||||
check_implicit_admin: no
|
||||
|
@ -131,12 +122,6 @@
|
|||
name: '{{ db_file_name }}'
|
||||
state: file
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dump and Import | State dump with multiple databases in comma separated form for MySQL.
|
||||
mysql_db:
|
||||
login_user: '{{ mysql_user }}'
|
||||
|
@ -147,10 +132,6 @@
|
|||
state: dump
|
||||
target: '{{ dump_file1 }}'
|
||||
check_implicit_admin: yes
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: dump_result1
|
||||
|
||||
- name: Dump and Import | Assert successful completion of dump operation (with multiple databases in comma separated form)
|
||||
|
@ -164,12 +145,6 @@
|
|||
name: '{{ dump_file1 }}'
|
||||
state: file
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dump and Import | State dump with multiple databases in list form via check_mode
|
||||
mysql_db:
|
||||
login_user: '{{ mysql_user }}'
|
||||
|
@ -181,10 +156,6 @@
|
|||
- '{{ db_name2 }}'
|
||||
state: dump
|
||||
target: '{{ dump_file2 }}'
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: dump_result
|
||||
check_mode: yes
|
||||
|
||||
|
@ -203,12 +174,6 @@
|
|||
that:
|
||||
- stat_result.stat.exists is defined and not stat_result.stat.exists
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dump and Import | State dump with multiple databases in list form.
|
||||
mysql_db:
|
||||
login_user: '{{ mysql_user }}'
|
||||
|
@ -220,10 +185,6 @@
|
|||
- '{{ db_name2 }}'
|
||||
state: dump
|
||||
target: '{{ dump_file2 }}'
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: dump_result2
|
||||
|
||||
- name: Dump and Import | Assert successful completion of dump operation (with multiple databases in list form)
|
||||
|
@ -363,12 +324,6 @@
|
|||
that:
|
||||
- "'{{ db_name2 }}' in mysql_result.stdout"
|
||||
|
||||
# With MySQL 8, new options have been added. For instance, when attempt to dump
|
||||
# a MySQL 5.7 instance, mysqldump will throw "Unknown table 'COLUMN_STATISTICS'
|
||||
# in information_schema (1109)".
|
||||
# Unfortunatly, the mysql-client-5.7 is unavailable on Ubuntu for multiple
|
||||
# major relase :( So I add --column-statistics=0 as a workaround...
|
||||
# TODO : Remove this option in octobre 2023 when MySQL 5.7 will be End of Life.
|
||||
- name: Dump and Import | Test state=dump to backup the database of type {{ format_type }} (expect changed=true)
|
||||
mysql_db:
|
||||
login_user: '{{ mysql_user }}'
|
||||
|
@ -378,10 +333,6 @@
|
|||
name: '{{ db_name }}'
|
||||
state: dump
|
||||
target: '{{ db_file_name }}'
|
||||
dump_extra_args: >-
|
||||
{% if db_engine == 'mysql' %}
|
||||
--column-statistics=0
|
||||
{% endif %}
|
||||
register: result
|
||||
|
||||
- name: Dump and Import | Assert output message backup the database
|
||||
|
|
|
@ -63,7 +63,6 @@
|
|||
--ignore-table=mysql.innodb_index_stats
|
||||
--ignore-table=mysql.innodb_table_stats
|
||||
--master-data=2
|
||||
{% if db_engine == 'mysql' %}--column-statistics=0{% endif %}
|
||||
> {{ dump_path }}
|
||||
|
||||
- name: Restore the dump to replica1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue