Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  tablespace_size_warning.test  Sprache: unbekannt

 
Spracherkennung für: .test vermutete Sprache: SQL {SQL[81] ABAP[80] Masm[68]} [Methode: maximale Elemente, drei Dimensionen]

--source include/have_innodb.inc
--source include/have_innodb_16k.inc
--source include/have_sequence.inc
--source include/not_embedded.inc

--disable_query_log
call mtr.add_suppression("InnoDB: Tablespace .* size .* bytes reached .* of configured threshold");
--enable_query_log

--echo #
--echo # MDEV-38936: Proactive handling of InnoDB tablespace full condition
--echo #

--echo # Test basic warning emission
SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760;
SET GLOBAL innodb_tablespace_size_warning_pct = 70;

CREATE TABLE t1 (
  id INT AUTO_INCREMENT PRIMARY KEY,
  data LONGBLOB
) ENGINE=InnoDB;

INSERT INTO t1 (data) SELECT REPEAT('a', 1024*1024) FROM seq_1_to_10;

let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN=Tablespace 'test/t1' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=Tablespace 'test/t1' size 8388608 bytes reached 80% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=Tablespace 'test/t1' size 9437184 bytes reached 90% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=Tablespace 'test/t1' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc

DROP TABLE t1;

--echo # Test configurable warning percentage
SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760;
SET GLOBAL innodb_tablespace_size_warning_pct = 80;

CREATE TABLE t1b (
  id INT AUTO_INCREMENT PRIMARY KEY,
  data LONGBLOB
) ENGINE=InnoDB;

INSERT INTO t1b (data) SELECT REPEAT('x', 1024*1024) FROM seq_1_to_8;

let SEARCH_PATTERN=Tablespace 'test/t1b' size 8388608 bytes reached 80% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=Tablespace 'test/t1b' size 9437184 bytes reached 90% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc

DROP TABLE t1b;

--echo # Test threshold set to zero disables warnings
SET GLOBAL innodb_tablespace_size_warning_threshold = 0;

CREATE TABLE t2 (
  id INT AUTO_INCREMENT PRIMARY KEY,
  data LONGBLOB
) ENGINE=InnoDB;

INSERT INTO t2 (data) SELECT REPEAT('b', 1024*1024) FROM seq_1_to_5;

let SEARCH_PATTERN=Tablespace 'test/t2' size \d+ bytes reached \d+% of configured threshold;
--source include/search_pattern_in_file.inc

DROP TABLE t2;

--echo # Test disable via threshold=0 then re-enable
SET GLOBAL innodb_tablespace_size_warning_threshold = 0;
SET GLOBAL innodb_tablespace_size_warning_pct = 70;

CREATE TABLE t3 (
  id INT AUTO_INCREMENT PRIMARY KEY,
  data LONGBLOB
) ENGINE=InnoDB;

INSERT INTO t3 (data) SELECT REPEAT('c', 1024*1024) FROM seq_1_to_10;

SET GLOBAL innodb_tablespace_size_warning_threshold = 10485760;

INSERT INTO t3 (data) VALUES (REPEAT('d', 1024*1024));

let SEARCH_PATTERN=Tablespace 'test/t3' size 12582912 bytes reached 100% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc

DROP TABLE t3;

--echo # Test TRUNCATE TABLE resets warning state
CREATE TABLE t4 (
  id INT AUTO_INCREMENT PRIMARY KEY,
  data LONGBLOB
) ENGINE=InnoDB;

INSERT INTO t4 (data) SELECT REPEAT('e', 1024*1024) FROM seq_1_to_10;

let SEARCH_PATTERN=Tablespace 'test/t4' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=Tablespace 'test/t4' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc

TRUNCATE TABLE t4;

INSERT INTO t4 (data) SELECT REPEAT('f', 1024*1024) FROM seq_1_to_10;

let SEARCH_PATTERN=Tablespace 'test/t4' size 7340032 bytes reached 70% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=Tablespace 'test/t4' size 10485760 bytes reached 100% of configured threshold of 10485760 bytes;
--source include/search_pattern_in_file.inc

DROP TABLE t4;

--echo # Test behavior when tablespace exceeds 100% of threshold
SET GLOBAL innodb_tablespace_size_warning_threshold = 5242880;
SET GLOBAL innodb_tablespace_size_warning_pct = 70;

CREATE TABLE t5 (
  id INT AUTO_INCREMENT PRIMARY KEY,
  data LONGBLOB
) ENGINE=InnoDB;

INSERT INTO t5 (data) SELECT REPEAT('g', 1024*1024) FROM seq_1_to_10;

let SEARCH_PATTERN=Tablespace 'test/t5' size 4194304 bytes reached 80% of configured threshold of 5242880 bytes;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=Tablespace 'test/t5' size 5242880 bytes reached 100% of configured threshold of 5242880 bytes;
--source include/search_pattern_in_file.inc

DROP TABLE t5;

# Restore default values
SET GLOBAL innodb_tablespace_size_warning_threshold = 0;
SET GLOBAL innodb_tablespace_size_warning_pct = 85;

[Dauer der Verarbeitung: 0.11 Sekunden, vorverarbeitet 2026-10-08]

                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1126864
#Domains=1897691