mirror of
https://github.com/MariaDB/server.git
synced 2025-07-18 23:03:28 +03:00
Merge branch '10.3' into 10.4
This commit is contained in:
Submodule libmariadb updated: d204e83104...f5a4c73df4
BIN
mysql-test/std_data/rpl/master-bin-seq_10.3.36.000001
Normal file
BIN
mysql-test/std_data/rpl/master-bin-seq_10.3.36.000001
Normal file
Binary file not shown.
85
mysql-test/suite/rpl/r/rpl_parallel_seq.result
Normal file
85
mysql-test/suite/rpl/r/rpl_parallel_seq.result
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
include/master-slave.inc
|
||||||
|
[connection master]
|
||||||
|
connection slave;
|
||||||
|
include/stop_slave.inc
|
||||||
|
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||||
|
# MDEV-29621 the sequence engine binlog_row_image-full events
|
||||||
|
# MDL-deadlock on the parallel slave.
|
||||||
|
connection master;
|
||||||
|
CREATE SEQUENCE s1;
|
||||||
|
SET @@session.binlog_row_image=FULL;
|
||||||
|
SET @@session.debug_dbug="+d,binlog_force_commit_id";
|
||||||
|
SET @commit_id=7;
|
||||||
|
SET @@gtid_seq_no=100;
|
||||||
|
SELECT NEXT VALUE FOR s1;
|
||||||
|
NEXT VALUE FOR s1
|
||||||
|
1
|
||||||
|
INSERT INTO s1 VALUES(2, 1, 10, 1, 2, 1, 1, 0);
|
||||||
|
SET @@session.debug_dbug="";
|
||||||
|
connection slave;
|
||||||
|
SET @@global.slave_parallel_threads=2;
|
||||||
|
SET @@global.slave_parallel_mode=optimistic;
|
||||||
|
SET @@global.debug_dbug="+d,hold_worker_on_schedule";
|
||||||
|
include/start_slave.inc
|
||||||
|
SET DEBUG_SYNC = 'now SIGNAL continue_worker';
|
||||||
|
connection master;
|
||||||
|
DROP SEQUENCE s1;
|
||||||
|
connection slave;
|
||||||
|
include/stop_slave.inc
|
||||||
|
# Simulate buggy 10.3.36 master to prove the parallel applier
|
||||||
|
# does not deadlock now at replaying the above master load.
|
||||||
|
connection master;
|
||||||
|
include/rpl_stop_server.inc [server_number=1]
|
||||||
|
include/rpl_start_server.inc [server_number=1]
|
||||||
|
connection slave;
|
||||||
|
RESET MASTER;
|
||||||
|
SET @@global.gtid_slave_pos="";
|
||||||
|
CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_use_gtid=slave_pos;
|
||||||
|
START SLAVE UNTIL MASTER_GTID_POS='0-1-102';
|
||||||
|
SET DEBUG_SYNC = 'now SIGNAL continue_worker';
|
||||||
|
# Normal stop is expected
|
||||||
|
include/wait_for_slave_to_stop.inc
|
||||||
|
# MDEV-31077 ALTER SEQUENCE may end up in optimistic parallel slave binlog out-of-order
|
||||||
|
# The test proves ALTER-SEQUENCE binlogs first before the following transaction does so.
|
||||||
|
connection slave;
|
||||||
|
include/stop_slave.inc
|
||||||
|
Warnings:
|
||||||
|
Note 1255 Slave already has been stopped
|
||||||
|
RESET MASTER;
|
||||||
|
SET @@global.gtid_slave_pos="";
|
||||||
|
SET @@global.gtid_strict_mode=1;
|
||||||
|
connection master;
|
||||||
|
RESET MASTER;
|
||||||
|
CREATE TABLE ti (a INT) ENGINE=innodb;
|
||||||
|
CREATE SEQUENCE s2 ENGINE=innodb;
|
||||||
|
SET @@gtid_seq_no=100;
|
||||||
|
ALTER SEQUENCE s2 restart with 1;
|
||||||
|
INSERT INTO ti SET a=1;
|
||||||
|
include/save_master_gtid.inc
|
||||||
|
SELECT @@global.gtid_binlog_state "Master gtid state";
|
||||||
|
Master gtid state
|
||||||
|
0-1-101
|
||||||
|
connection slave;
|
||||||
|
include/start_slave.inc
|
||||||
|
SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "no 100,101 yet in both";
|
||||||
|
@@global.gtid_binlog_state no 100,101 yet in both
|
||||||
|
0-1-2 0-1-2
|
||||||
|
SET DEBUG_SYNC = 'now SIGNAL continue_worker';
|
||||||
|
# Normal sync with master proves the fixes correct
|
||||||
|
include/sync_with_master_gtid.inc
|
||||||
|
SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "all through 101 have been committed";
|
||||||
|
@@global.gtid_binlog_state all through 101 have been committed
|
||||||
|
0-1-101 0-1-101
|
||||||
|
connection slave;
|
||||||
|
include/stop_slave.inc
|
||||||
|
SET debug_sync = RESET;
|
||||||
|
SET @@global.slave_parallel_threads= 0;
|
||||||
|
SET @@global.slave_parallel_mode= conservative;
|
||||||
|
SET @@global.debug_dbug = "";
|
||||||
|
SET @@global.gtid_strict_mode=0;
|
||||||
|
include/start_slave.inc
|
||||||
|
connection master;
|
||||||
|
DROP SEQUENCE s2;
|
||||||
|
DROP TABLE ti;
|
||||||
|
connection slave;
|
||||||
|
include/rpl_end.inc
|
131
mysql-test/suite/rpl/t/rpl_parallel_seq.test
Normal file
131
mysql-test/suite/rpl/t/rpl_parallel_seq.test
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
--source include/have_innodb.inc
|
||||||
|
--source include/have_debug.inc
|
||||||
|
--source include/have_debug_sync.inc
|
||||||
|
--source include/have_binlog_format_row.inc
|
||||||
|
--source include/master-slave.inc
|
||||||
|
|
||||||
|
--connection slave
|
||||||
|
--source include/stop_slave.inc
|
||||||
|
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
|
||||||
|
|
||||||
|
--echo # MDEV-29621 the sequence engine binlog_row_image-full events
|
||||||
|
--echo # MDL-deadlock on the parallel slave.
|
||||||
|
--connection master
|
||||||
|
CREATE SEQUENCE s1;
|
||||||
|
SET @@session.binlog_row_image=FULL;
|
||||||
|
SET @@session.debug_dbug="+d,binlog_force_commit_id";
|
||||||
|
SET @commit_id=7;
|
||||||
|
SET @@gtid_seq_no=100;
|
||||||
|
SELECT NEXT VALUE FOR s1;
|
||||||
|
INSERT INTO s1 VALUES(2, 1, 10, 1, 2, 1, 1, 0);
|
||||||
|
SET @@session.debug_dbug="";
|
||||||
|
|
||||||
|
--connection slave
|
||||||
|
--let $slave_parallel_threads=`select @@global.slave_parallel_threads`
|
||||||
|
--let $slave_parallel_mode=`select @@global.slave_parallel_mode`
|
||||||
|
SET @@global.slave_parallel_threads=2;
|
||||||
|
SET @@global.slave_parallel_mode=optimistic;
|
||||||
|
SET @@global.debug_dbug="+d,hold_worker_on_schedule";
|
||||||
|
--source include/start_slave.inc
|
||||||
|
|
||||||
|
--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to start commit before starting%"
|
||||||
|
--source include/wait_condition.inc
|
||||||
|
SET DEBUG_SYNC = 'now SIGNAL continue_worker';
|
||||||
|
|
||||||
|
--connection master
|
||||||
|
DROP SEQUENCE s1;
|
||||||
|
--sync_slave_with_master
|
||||||
|
--source include/stop_slave.inc
|
||||||
|
|
||||||
|
--echo # Simulate buggy 10.3.36 master to prove the parallel applier
|
||||||
|
--echo # does not deadlock now at replaying the above master load.
|
||||||
|
--connection master
|
||||||
|
--let $datadir= `SELECT @@datadir`
|
||||||
|
|
||||||
|
--let $rpl_server_number= 1
|
||||||
|
--source include/rpl_stop_server.inc
|
||||||
|
|
||||||
|
--remove_file $datadir/master-bin.000001
|
||||||
|
--copy_file $MYSQL_TEST_DIR/std_data/rpl/master-bin-seq_10.3.36.000001 $datadir/master-bin.000001
|
||||||
|
|
||||||
|
--let $rpl_server_number= 1
|
||||||
|
--source include/rpl_start_server.inc
|
||||||
|
|
||||||
|
--source include/wait_until_connected_again.inc
|
||||||
|
--save_master_pos
|
||||||
|
|
||||||
|
--connection slave
|
||||||
|
RESET MASTER;
|
||||||
|
SET @@global.gtid_slave_pos="";
|
||||||
|
|
||||||
|
--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
|
||||||
|
eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, master_user='root', master_use_gtid=slave_pos;
|
||||||
|
|
||||||
|
START SLAVE UNTIL MASTER_GTID_POS='0-1-102';
|
||||||
|
|
||||||
|
--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit"
|
||||||
|
--source include/wait_condition.inc
|
||||||
|
SET DEBUG_SYNC = 'now SIGNAL continue_worker';
|
||||||
|
|
||||||
|
--echo # Normal stop is expected
|
||||||
|
--source include/wait_for_slave_to_stop.inc
|
||||||
|
|
||||||
|
--echo # MDEV-31077 ALTER SEQUENCE may end up in optimistic parallel slave binlog out-of-order
|
||||||
|
--echo # The test proves ALTER-SEQUENCE binlogs first before the following transaction does so.
|
||||||
|
|
||||||
|
--connection slave
|
||||||
|
--source include/stop_slave.inc
|
||||||
|
RESET MASTER;
|
||||||
|
SET @@global.gtid_slave_pos="";
|
||||||
|
--let $slave_gtid_strict_mode=`select @@global.gtid_strict_mode`
|
||||||
|
SET @@global.gtid_strict_mode=1;
|
||||||
|
--connection master
|
||||||
|
RESET MASTER;
|
||||||
|
|
||||||
|
# Load from master
|
||||||
|
CREATE TABLE ti (a INT) ENGINE=innodb;
|
||||||
|
CREATE SEQUENCE s2 ENGINE=innodb;
|
||||||
|
|
||||||
|
SET @@gtid_seq_no=100;
|
||||||
|
ALTER SEQUENCE s2 restart with 1;
|
||||||
|
INSERT INTO ti SET a=1;
|
||||||
|
--source include/save_master_gtid.inc
|
||||||
|
SELECT @@global.gtid_binlog_state "Master gtid state";
|
||||||
|
|
||||||
|
--connection slave
|
||||||
|
--source include/start_slave.inc
|
||||||
|
|
||||||
|
--let $wait_condition= SELECT count(*) = 1 FROM information_schema.processlist WHERE state LIKE "Waiting for prior transaction to commit"
|
||||||
|
--source include/wait_condition.inc
|
||||||
|
|
||||||
|
SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "no 100,101 yet in both";
|
||||||
|
|
||||||
|
# DEBUG_DBUG extension point of hold_worker_on_schedule is reused
|
||||||
|
# (gets deployed) in Sql_cmd_alter_sequence::execute.
|
||||||
|
SET DEBUG_SYNC = 'now SIGNAL continue_worker';
|
||||||
|
|
||||||
|
--echo # Normal sync with master proves the fixes correct
|
||||||
|
--source include/sync_with_master_gtid.inc
|
||||||
|
|
||||||
|
SELECT @@global.gtid_binlog_state, @@global.gtid_slave_pos as "all through 101 have been committed";
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-29621/MDEV-31077 clean up.
|
||||||
|
#
|
||||||
|
--connection slave
|
||||||
|
--source include/stop_slave.inc
|
||||||
|
|
||||||
|
SET debug_sync = RESET;
|
||||||
|
--eval SET @@global.slave_parallel_threads= $slave_parallel_threads
|
||||||
|
--eval SET @@global.slave_parallel_mode= $slave_parallel_mode
|
||||||
|
SET @@global.debug_dbug = "";
|
||||||
|
--eval SET @@global.gtid_strict_mode=$slave_gtid_strict_mode
|
||||||
|
--source include/start_slave.inc
|
||||||
|
|
||||||
|
--connection master
|
||||||
|
DROP SEQUENCE s2;
|
||||||
|
DROP TABLE ti;
|
||||||
|
|
||||||
|
--sync_slave_with_master
|
||||||
|
|
||||||
|
--source include/rpl_end.inc
|
@ -240,6 +240,8 @@ int ha_sequence::write_row(const uchar *buf)
|
|||||||
on master and slaves
|
on master and slaves
|
||||||
- Check that the new row is an accurate SEQUENCE object
|
- Check that the new row is an accurate SEQUENCE object
|
||||||
*/
|
*/
|
||||||
|
/* mark a full binlog image insert to force non-parallel slave */
|
||||||
|
thd->transaction.stmt.mark_trans_did_ddl();
|
||||||
if (table->s->tmp_table == NO_TMP_TABLE &&
|
if (table->s->tmp_table == NO_TMP_TABLE &&
|
||||||
thd->mdl_context.upgrade_shared_lock(table->mdl_ticket,
|
thd->mdl_context.upgrade_shared_lock(table->mdl_ticket,
|
||||||
MDL_EXCLUSIVE,
|
MDL_EXCLUSIVE,
|
||||||
|
@ -13762,8 +13762,14 @@ Rows_log_event::write_row(rpl_group_info *rgi,
|
|||||||
int Rows_log_event::update_sequence()
|
int Rows_log_event::update_sequence()
|
||||||
{
|
{
|
||||||
TABLE *table= m_table; // pointer to event's table
|
TABLE *table= m_table; // pointer to event's table
|
||||||
|
bool old_master= false;
|
||||||
|
int err= 0;
|
||||||
|
|
||||||
if (!bitmap_is_set(table->rpl_write_set, MIN_VALUE_FIELD_NO))
|
if (!bitmap_is_set(table->rpl_write_set, MIN_VALUE_FIELD_NO) ||
|
||||||
|
(!(table->in_use->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_DDL) &&
|
||||||
|
!(old_master=
|
||||||
|
rpl_master_has_bug(thd->rgi_slave->rli,
|
||||||
|
29621, FALSE, FALSE, FALSE, TRUE))))
|
||||||
{
|
{
|
||||||
/* This event come from a setval function executed on the master.
|
/* This event come from a setval function executed on the master.
|
||||||
Update the sequence next_number and round, like we do with setval()
|
Update the sequence next_number and round, like we do with setval()
|
||||||
@ -13776,12 +13782,27 @@ int Rows_log_event::update_sequence()
|
|||||||
|
|
||||||
return table->s->sequence->set_value(table, nextval, round, 0) > 0;
|
return table->s->sequence->set_value(table, nextval, round, 0) > 0;
|
||||||
}
|
}
|
||||||
|
if (thd->rgi_slave->is_parallel_exec && old_master)
|
||||||
|
{
|
||||||
|
DBUG_ASSERT(thd->rgi_slave->parallel_entry);
|
||||||
|
/*
|
||||||
|
With parallel replication enabled, we can't execute alongside any other
|
||||||
|
transaction in which we may depend, so we force retry to release
|
||||||
|
the server layer table lock for possible prior in binlog order
|
||||||
|
same table transactions.
|
||||||
|
*/
|
||||||
|
if (thd->rgi_slave->parallel_entry->last_committed_sub_id <
|
||||||
|
thd->rgi_slave->wait_commit_sub_id)
|
||||||
|
{
|
||||||
|
err= ER_LOCK_DEADLOCK;
|
||||||
|
my_error(err, MYF(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
Update all fields in table and update the active sequence, like with
|
Update all fields in table and update the active sequence, like with
|
||||||
ALTER SEQUENCE
|
ALTER SEQUENCE
|
||||||
*/
|
*/
|
||||||
return table->file->ha_write_row(table->record[0]);
|
return err == 0 ? table->file->ha_write_row(table->record[0]) : err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2847,7 +2847,12 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev,
|
|||||||
|
|
||||||
if (mode <= SLAVE_PARALLEL_MINIMAL ||
|
if (mode <= SLAVE_PARALLEL_MINIMAL ||
|
||||||
!(gtid_flags & Gtid_log_event::FL_GROUP_COMMIT_ID) ||
|
!(gtid_flags & Gtid_log_event::FL_GROUP_COMMIT_ID) ||
|
||||||
e->last_commit_id != gtid_ev->commit_id)
|
e->last_commit_id != gtid_ev->commit_id ||
|
||||||
|
/*
|
||||||
|
MULTI_BATCH is also set when the current gtid even being a member
|
||||||
|
of a commit group is flagged as DDL which disallows parallel.
|
||||||
|
*/
|
||||||
|
(gtid_flags & Gtid_log_event::FL_DDL))
|
||||||
flags|= group_commit_orderer::MULTI_BATCH;
|
flags|= group_commit_orderer::MULTI_BATCH;
|
||||||
/* Make sure we do not attempt to run DDL in parallel speculatively. */
|
/* Make sure we do not attempt to run DDL in parallel speculatively. */
|
||||||
if (gtid_flags & Gtid_log_event::FL_DDL)
|
if (gtid_flags & Gtid_log_event::FL_DDL)
|
||||||
|
35
sql/slave.cc
35
sql/slave.cc
@ -8086,14 +8086,15 @@ end:
|
|||||||
@return TRUE if master has the bug, FALSE if it does not.
|
@return TRUE if master has the bug, FALSE if it does not.
|
||||||
*/
|
*/
|
||||||
bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
|
bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
|
||||||
bool (*pred)(const void *), const void *param)
|
bool (*pred)(const void *), const void *param,
|
||||||
|
bool maria_master)
|
||||||
{
|
{
|
||||||
struct st_version_range_for_one_bug {
|
struct st_version_range_for_one_bug {
|
||||||
uint bug_id;
|
uint bug_id;
|
||||||
Version introduced_in; // first version with bug
|
Version introduced_in; // first version with bug
|
||||||
Version fixed_in; // first version with fix
|
Version fixed_in; // first version with fix
|
||||||
};
|
};
|
||||||
static struct st_version_range_for_one_bug versions_for_all_bugs[]=
|
static struct st_version_range_for_one_bug versions_for_their_bugs[]=
|
||||||
{
|
{
|
||||||
{24432, { 5, 0, 24 }, { 5, 0, 38 } },
|
{24432, { 5, 0, 24 }, { 5, 0, 38 } },
|
||||||
{24432, { 5, 1, 12 }, { 5, 1, 17 } },
|
{24432, { 5, 1, 12 }, { 5, 1, 17 } },
|
||||||
@ -8101,11 +8102,27 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
|
|||||||
{33029, { 5, 1, 0 }, { 5, 1, 12 } },
|
{33029, { 5, 1, 0 }, { 5, 1, 12 } },
|
||||||
{37426, { 5, 1, 0 }, { 5, 1, 26 } },
|
{37426, { 5, 1, 0 }, { 5, 1, 26 } },
|
||||||
};
|
};
|
||||||
|
static struct st_version_range_for_one_bug versions_for_our_bugs[]=
|
||||||
|
{
|
||||||
|
{29621, { 10, 3, 36 }, { 10, 3, 39 } },
|
||||||
|
{29621, { 10, 4, 26 }, { 10, 4, 29 } },
|
||||||
|
{29621, { 10, 5, 17 }, { 10, 5, 20 } },
|
||||||
|
{29621, { 10, 6, 9 }, { 10, 6, 13 } },
|
||||||
|
{29621, { 10, 7, 5 }, { 10, 7, 9 } },
|
||||||
|
{29621, { 10, 8, 4 }, { 10, 8, 8 } },
|
||||||
|
{29621, { 10, 9, 2 }, { 10, 9, 6 } },
|
||||||
|
{29621, { 10, 10,1 }, { 10, 10,4 } },
|
||||||
|
{29621, { 10, 11,1 }, { 10, 11,3 } },
|
||||||
|
};
|
||||||
const Version &master_ver=
|
const Version &master_ver=
|
||||||
rli->relay_log.description_event_for_exec->server_version_split;
|
rli->relay_log.description_event_for_exec->server_version_split;
|
||||||
|
struct st_version_range_for_one_bug* versions_for_all_bugs= maria_master ?
|
||||||
|
versions_for_our_bugs : versions_for_their_bugs;
|
||||||
|
uint all_size= maria_master ?
|
||||||
|
sizeof(versions_for_our_bugs)/sizeof(*versions_for_our_bugs) :
|
||||||
|
sizeof(versions_for_their_bugs)/sizeof(*versions_for_their_bugs);
|
||||||
|
|
||||||
for (uint i= 0;
|
for (uint i= 0; i < all_size; i++)
|
||||||
i < sizeof(versions_for_all_bugs)/sizeof(*versions_for_all_bugs);i++)
|
|
||||||
{
|
{
|
||||||
const Version &introduced_in= versions_for_all_bugs[i].introduced_in;
|
const Version &introduced_in= versions_for_all_bugs[i].introduced_in;
|
||||||
const Version &fixed_in= versions_for_all_bugs[i].fixed_in;
|
const Version &fixed_in= versions_for_all_bugs[i].fixed_in;
|
||||||
@ -8114,18 +8131,21 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
|
|||||||
fixed_in > master_ver &&
|
fixed_in > master_ver &&
|
||||||
(pred == NULL || (*pred)(param)))
|
(pred == NULL || (*pred)(param)))
|
||||||
{
|
{
|
||||||
|
const char *bug_source= maria_master ?
|
||||||
|
"https://jira.mariadb.org/browse/MDEV-" :
|
||||||
|
"http://bugs.mysql.com/bug.php?id=";
|
||||||
if (!report)
|
if (!report)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
// a short message for SHOW SLAVE STATUS (message length constraints)
|
// a short message for SHOW SLAVE STATUS (message length constraints)
|
||||||
my_printf_error(ER_UNKNOWN_ERROR, "master may suffer from"
|
my_printf_error(ER_UNKNOWN_ERROR, "master may suffer from"
|
||||||
" http://bugs.mysql.com/bug.php?id=%u"
|
" %s%u"
|
||||||
" so slave stops; check error log on slave"
|
" so slave stops; check error log on slave"
|
||||||
" for more info", MYF(0), bug_id);
|
" for more info", MYF(0), bug_source, bug_id);
|
||||||
// a verbose message for the error log
|
// a verbose message for the error log
|
||||||
rli->report(ERROR_LEVEL, ER_UNKNOWN_ERROR, NULL,
|
rli->report(ERROR_LEVEL, ER_UNKNOWN_ERROR, NULL,
|
||||||
"According to the master's version ('%s'),"
|
"According to the master's version ('%s'),"
|
||||||
" it is probable that master suffers from this bug:"
|
" it is probable that master suffers from this bug:"
|
||||||
" http://bugs.mysql.com/bug.php?id=%u"
|
" %s%u"
|
||||||
" and thus replicating the current binary log event"
|
" and thus replicating the current binary log event"
|
||||||
" may make the slave's data become different from the"
|
" may make the slave's data become different from the"
|
||||||
" master's data."
|
" master's data."
|
||||||
@ -8139,6 +8159,7 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
|
|||||||
" equal to '%d.%d.%d'. Then replication can be"
|
" equal to '%d.%d.%d'. Then replication can be"
|
||||||
" restarted.",
|
" restarted.",
|
||||||
rli->relay_log.description_event_for_exec->server_version,
|
rli->relay_log.description_event_for_exec->server_version,
|
||||||
|
bug_source,
|
||||||
bug_id,
|
bug_id,
|
||||||
fixed_in[0], fixed_in[1], fixed_in[2]);
|
fixed_in[0], fixed_in[1], fixed_in[2]);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -231,7 +231,8 @@ bool show_all_master_info(THD* thd);
|
|||||||
void show_binlog_info_get_fields(THD *thd, List<Item> *field_list);
|
void show_binlog_info_get_fields(THD *thd, List<Item> *field_list);
|
||||||
bool show_binlog_info(THD* thd);
|
bool show_binlog_info(THD* thd);
|
||||||
bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
|
bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report,
|
||||||
bool (*pred)(const void *), const void *param);
|
bool (*pred)(const void *), const void *param,
|
||||||
|
bool maria_master= false);
|
||||||
bool rpl_master_erroneous_autoinc(THD* thd);
|
bool rpl_master_erroneous_autoinc(THD* thd);
|
||||||
|
|
||||||
const char *print_slave_db_safe(const char *db);
|
const char *print_slave_db_safe(const char *db);
|
||||||
|
@ -1012,10 +1012,19 @@ bool Sql_cmd_alter_sequence::execute(THD *thd)
|
|||||||
else
|
else
|
||||||
table->file->print_error(error, MYF(0));
|
table->file->print_error(error, MYF(0));
|
||||||
table->s->sequence->write_unlock(table);
|
table->s->sequence->write_unlock(table);
|
||||||
|
{
|
||||||
|
wait_for_commit* suspended_wfc= thd->suspend_subsequent_commits();
|
||||||
if (trans_commit_stmt(thd))
|
if (trans_commit_stmt(thd))
|
||||||
error= 1;
|
error= 1;
|
||||||
if (trans_commit_implicit(thd))
|
if (trans_commit_implicit(thd))
|
||||||
error= 1;
|
error= 1;
|
||||||
|
thd->resume_subsequent_commits(suspended_wfc);
|
||||||
|
DBUG_EXECUTE_IF("hold_worker_on_schedule",
|
||||||
|
{
|
||||||
|
/* delay binlogging of a parent trx in rpl_parallel_seq */
|
||||||
|
my_sleep(100000);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (likely(!error))
|
if (likely(!error))
|
||||||
error= write_bin_log(thd, 1, thd->query(), thd->query_length());
|
error= write_bin_log(thd, 1, thd->query(), thd->query_length());
|
||||||
if (likely(!error))
|
if (likely(!error))
|
||||||
|
@ -1,6 +1,18 @@
|
|||||||
|
|
||||||
ChangeLog file for zlib
|
ChangeLog file for zlib
|
||||||
|
|
||||||
|
Changes in 1.2.13 (13 Oct 2022)
|
||||||
|
- Fix configure issue that discarded provided CC definition
|
||||||
|
- Correct incorrect inputs provided to the CRC functions
|
||||||
|
- Repair prototypes and exporting of new CRC functions
|
||||||
|
- Fix inflateBack to detect invalid input with distances too far
|
||||||
|
- Have infback() deliver all of the available output up to any error
|
||||||
|
- Fix a bug when getting a gzip header extra field with inflate()
|
||||||
|
- Fix bug in block type selection when Z_FIXED used
|
||||||
|
- Tighten deflateBound bounds
|
||||||
|
- Remove deleted assembler code references
|
||||||
|
- Various portability and appearance improvements
|
||||||
|
|
||||||
Changes in 1.2.12 (27 Mar 2022)
|
Changes in 1.2.12 (27 Mar 2022)
|
||||||
- Cygwin does not have _wopen(), so do not create gzopen_w() there
|
- Cygwin does not have _wopen(), so do not create gzopen_w() there
|
||||||
- Permit a deflateParams() parameter change as soon as possible
|
- Permit a deflateParams() parameter change as soon as possible
|
||||||
@ -159,7 +171,7 @@ Changes in 1.2.7.1 (24 Mar 2013)
|
|||||||
- Fix types in contrib/minizip to match result of get_crc_table()
|
- Fix types in contrib/minizip to match result of get_crc_table()
|
||||||
- Simplify contrib/vstudio/vc10 with 'd' suffix
|
- Simplify contrib/vstudio/vc10 with 'd' suffix
|
||||||
- Add TOP support to win32/Makefile.msc
|
- Add TOP support to win32/Makefile.msc
|
||||||
- Suport i686 and amd64 assembler builds in CMakeLists.txt
|
- Support i686 and amd64 assembler builds in CMakeLists.txt
|
||||||
- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h
|
- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h
|
||||||
- Add vc11 and vc12 build files to contrib/vstudio
|
- Add vc11 and vc12 build files to contrib/vstudio
|
||||||
- Add gzvprintf() as an undocumented function in zlib
|
- Add gzvprintf() as an undocumented function in zlib
|
||||||
@ -359,14 +371,14 @@ Changes in 1.2.5.1 (10 Sep 2011)
|
|||||||
- Use u4 type for crc_table to avoid conversion warnings
|
- Use u4 type for crc_table to avoid conversion warnings
|
||||||
- Apply casts in zlib.h to avoid conversion warnings
|
- Apply casts in zlib.h to avoid conversion warnings
|
||||||
- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
|
- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
|
||||||
- Improve inflateSync() documentation to note indeterminancy
|
- Improve inflateSync() documentation to note indeterminacy
|
||||||
- Add deflatePending() function to return the amount of pending output
|
- Add deflatePending() function to return the amount of pending output
|
||||||
- Correct the spelling of "specification" in FAQ [Randers-Pehrson]
|
- Correct the spelling of "specification" in FAQ [Randers-Pehrson]
|
||||||
- Add a check in configure for stdarg.h, use for gzprintf()
|
- Add a check in configure for stdarg.h, use for gzprintf()
|
||||||
- Check that pointers fit in ints when gzprint() compiled old style
|
- Check that pointers fit in ints when gzprint() compiled old style
|
||||||
- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
|
- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
|
||||||
- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
|
- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
|
||||||
- Add debug records in assmebler code [Londer]
|
- Add debug records in assembler code [Londer]
|
||||||
- Update RFC references to use http://tools.ietf.org/html/... [Li]
|
- Update RFC references to use http://tools.ietf.org/html/... [Li]
|
||||||
- Add --archs option, use of libtool to configure for Mac OS X [Borstel]
|
- Add --archs option, use of libtool to configure for Mac OS X [Borstel]
|
||||||
|
|
||||||
@ -1033,7 +1045,7 @@ Changes in 1.2.0.1 (17 March 2003)
|
|||||||
- Include additional header file on VMS for off_t typedef
|
- Include additional header file on VMS for off_t typedef
|
||||||
- Try to use _vsnprintf where it supplants vsprintf [Vollant]
|
- Try to use _vsnprintf where it supplants vsprintf [Vollant]
|
||||||
- Add some casts in inffast.c
|
- Add some casts in inffast.c
|
||||||
- Enchance comments in zlib.h on what happens if gzprintf() tries to
|
- Enhance comments in zlib.h on what happens if gzprintf() tries to
|
||||||
write more than 4095 bytes before compression
|
write more than 4095 bytes before compression
|
||||||
- Remove unused state from inflateBackEnd()
|
- Remove unused state from inflateBackEnd()
|
||||||
- Remove exit(0) from minigzip.c, example.c
|
- Remove exit(0) from minigzip.c, example.c
|
||||||
@ -1211,7 +1223,7 @@ Changes in 1.0.9 (17 Feb 1998)
|
|||||||
- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
|
- Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
|
||||||
- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
|
- in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
|
||||||
- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
|
- in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
|
||||||
the declaration of FAR (Gilles VOllant)
|
the declaration of FAR (Gilles Vollant)
|
||||||
- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
|
- install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
|
||||||
- read_buf buf parameter of type Bytef* instead of charf*
|
- read_buf buf parameter of type Bytef* instead of charf*
|
||||||
- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
|
- zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
|
||||||
@ -1567,7 +1579,7 @@ Changes in 0.4:
|
|||||||
- renamed deflateOptions as deflateInit2, call one or the other but not both
|
- renamed deflateOptions as deflateInit2, call one or the other but not both
|
||||||
- added the method parameter for deflateInit2
|
- added the method parameter for deflateInit2
|
||||||
- added inflateInit2
|
- added inflateInit2
|
||||||
- simplied considerably deflateInit and inflateInit by not supporting
|
- simplified considerably deflateInit and inflateInit by not supporting
|
||||||
user-provided history buffer. This is supported only in deflateInit2
|
user-provided history buffer. This is supported only in deflateInit2
|
||||||
and inflateInit2
|
and inflateInit2
|
||||||
|
|
||||||
|
22
zlib/LICENSE
Normal file
22
zlib/LICENSE
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
Copyright notice:
|
||||||
|
|
||||||
|
(C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||||
|
|
||||||
|
This software is provided 'as-is', without any express or implied
|
||||||
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
arising from the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
|
including commercial applications, and to alter it and redistribute it
|
||||||
|
freely, subject to the following restrictions:
|
||||||
|
|
||||||
|
1. The origin of this software must not be misrepresented; you must not
|
||||||
|
claim that you wrote the original software. If you use this software
|
||||||
|
in a product, an acknowledgment in the product documentation would be
|
||||||
|
appreciated but is not required.
|
||||||
|
2. Altered source versions must be plainly marked as such, and must not be
|
||||||
|
misrepresented as being the original software.
|
||||||
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
|
|
||||||
|
Jean-loup Gailly Mark Adler
|
||||||
|
jloup@gzip.org madler@alumni.caltech.edu
|
@ -1,6 +1,6 @@
|
|||||||
ZLIB DATA COMPRESSION LIBRARY
|
ZLIB DATA COMPRESSION LIBRARY
|
||||||
|
|
||||||
zlib 1.2.12 is a general purpose data compression library. All the code is
|
zlib 1.2.13 is a general purpose data compression library. All the code is
|
||||||
thread safe. The data format used by the zlib library is described by RFCs
|
thread safe. The data format used by the zlib library is described by RFCs
|
||||||
(Request for Comments) 1950 to 1952 in the files
|
(Request for Comments) 1950 to 1952 in the files
|
||||||
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
|
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
|
||||||
@ -31,7 +31,7 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
|
|||||||
issue of Dr. Dobb's Journal; a copy of the article is available at
|
issue of Dr. Dobb's Journal; a copy of the article is available at
|
||||||
http://marknelson.us/1997/01/01/zlib-engine/ .
|
http://marknelson.us/1997/01/01/zlib-engine/ .
|
||||||
|
|
||||||
The changes made in version 1.2.12 are documented in the file ChangeLog.
|
The changes made in version 1.2.13 are documented in the file ChangeLog.
|
||||||
|
|
||||||
Unsupported third party contributions are provided in directory contrib/ .
|
Unsupported third party contributions are provided in directory contrib/ .
|
||||||
|
|
||||||
|
33
zlib/crc32.c
33
zlib/crc32.c
@ -98,13 +98,22 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* If available, use the ARM processor CRC32 instruction. */
|
||||||
|
#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
|
||||||
|
# define ARMCRC32
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Local functions. */
|
/* Local functions. */
|
||||||
local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
|
local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
|
||||||
local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
|
local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
|
||||||
|
|
||||||
/* If available, use the ARM processor CRC32 instruction. */
|
#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
|
||||||
#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
|
local z_word_t byte_swap OF((z_word_t word));
|
||||||
# define ARMCRC32
|
#endif
|
||||||
|
|
||||||
|
#if defined(W) && !defined(ARMCRC32)
|
||||||
|
local z_crc_t crc_word OF((z_word_t data));
|
||||||
|
local z_word_t crc_word_big OF((z_word_t data));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
|
#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
|
||||||
@ -630,7 +639,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
|
|||||||
#endif /* DYNAMIC_CRC_TABLE */
|
#endif /* DYNAMIC_CRC_TABLE */
|
||||||
|
|
||||||
/* Pre-condition the CRC */
|
/* Pre-condition the CRC */
|
||||||
crc ^= 0xffffffff;
|
crc = (~crc) & 0xffffffff;
|
||||||
|
|
||||||
/* Compute the CRC up to a word boundary. */
|
/* Compute the CRC up to a word boundary. */
|
||||||
while (len && ((z_size_t)buf & 7) != 0) {
|
while (len && ((z_size_t)buf & 7) != 0) {
|
||||||
@ -645,8 +654,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
|
|||||||
len &= 7;
|
len &= 7;
|
||||||
|
|
||||||
/* Do three interleaved CRCs to realize the throughput of one crc32x
|
/* Do three interleaved CRCs to realize the throughput of one crc32x
|
||||||
instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three
|
instruction per cycle. Each CRC is calculated on Z_BATCH words. The
|
||||||
CRCs are combined into a single CRC after each set of batches. */
|
three CRCs are combined into a single CRC after each set of batches. */
|
||||||
while (num >= 3 * Z_BATCH) {
|
while (num >= 3 * Z_BATCH) {
|
||||||
crc1 = 0;
|
crc1 = 0;
|
||||||
crc2 = 0;
|
crc2 = 0;
|
||||||
@ -749,7 +758,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
|
|||||||
#endif /* DYNAMIC_CRC_TABLE */
|
#endif /* DYNAMIC_CRC_TABLE */
|
||||||
|
|
||||||
/* Pre-condition the CRC */
|
/* Pre-condition the CRC */
|
||||||
crc ^= 0xffffffff;
|
crc = (~crc) & 0xffffffff;
|
||||||
|
|
||||||
#ifdef W
|
#ifdef W
|
||||||
|
|
||||||
@ -1077,7 +1086,7 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
|
|||||||
#ifdef DYNAMIC_CRC_TABLE
|
#ifdef DYNAMIC_CRC_TABLE
|
||||||
once(&made, make_crc_table);
|
once(&made, make_crc_table);
|
||||||
#endif /* DYNAMIC_CRC_TABLE */
|
#endif /* DYNAMIC_CRC_TABLE */
|
||||||
return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
|
return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
@ -1086,7 +1095,7 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2)
|
|||||||
uLong crc2;
|
uLong crc2;
|
||||||
z_off_t len2;
|
z_off_t len2;
|
||||||
{
|
{
|
||||||
return crc32_combine64(crc1, crc2, len2);
|
return crc32_combine64(crc1, crc2, (z_off64_t)len2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
@ -1103,14 +1112,14 @@ uLong ZEXPORT crc32_combine_gen64(len2)
|
|||||||
uLong ZEXPORT crc32_combine_gen(len2)
|
uLong ZEXPORT crc32_combine_gen(len2)
|
||||||
z_off_t len2;
|
z_off_t len2;
|
||||||
{
|
{
|
||||||
return crc32_combine_gen64(len2);
|
return crc32_combine_gen64((z_off64_t)len2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ========================================================================= */
|
/* ========================================================================= */
|
||||||
uLong crc32_combine_op(crc1, crc2, op)
|
uLong ZEXPORT crc32_combine_op(crc1, crc2, op)
|
||||||
uLong crc1;
|
uLong crc1;
|
||||||
uLong crc2;
|
uLong crc2;
|
||||||
uLong op;
|
uLong op;
|
||||||
{
|
{
|
||||||
return multmodp(op, crc1) ^ crc2;
|
return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
#include "deflate.h"
|
#include "deflate.h"
|
||||||
|
|
||||||
const char deflate_copyright[] =
|
const char deflate_copyright[] =
|
||||||
" deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler ";
|
" deflate 1.2.13 Copyright 1995-2022 Jean-loup Gailly and Mark Adler ";
|
||||||
/*
|
/*
|
||||||
If you use the zlib library in a product, an acknowledgment is welcome
|
If you use the zlib library in a product, an acknowledgment is welcome
|
||||||
in the documentation of your product. If for some reason you cannot
|
in the documentation of your product. If for some reason you cannot
|
||||||
@ -87,13 +87,7 @@ local void lm_init OF((deflate_state *s));
|
|||||||
local void putShortMSB OF((deflate_state *s, uInt b));
|
local void putShortMSB OF((deflate_state *s, uInt b));
|
||||||
local void flush_pending OF((z_streamp strm));
|
local void flush_pending OF((z_streamp strm));
|
||||||
local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
|
local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size));
|
||||||
#ifdef ASMV
|
|
||||||
# pragma message("Assembler code may have bugs -- use at your own risk")
|
|
||||||
void match_init OF((void)); /* asm code initialization */
|
|
||||||
uInt longest_match OF((deflate_state *s, IPos cur_match));
|
|
||||||
#else
|
|
||||||
local uInt longest_match OF((deflate_state *s, IPos cur_match));
|
local uInt longest_match OF((deflate_state *s, IPos cur_match));
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ZLIB_DEBUG
|
#ifdef ZLIB_DEBUG
|
||||||
local void check_match OF((deflate_state *s, IPos start, IPos match,
|
local void check_match OF((deflate_state *s, IPos start, IPos match,
|
||||||
@ -285,6 +279,8 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
|
|||||||
|
|
||||||
if (windowBits < 0) { /* suppress zlib wrapper */
|
if (windowBits < 0) { /* suppress zlib wrapper */
|
||||||
wrap = 0;
|
wrap = 0;
|
||||||
|
if (windowBits < -15)
|
||||||
|
return Z_STREAM_ERROR;
|
||||||
windowBits = -windowBits;
|
windowBits = -windowBits;
|
||||||
}
|
}
|
||||||
#ifdef GZIP
|
#ifdef GZIP
|
||||||
@ -674,36 +670,50 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* =========================================================================
|
/* =========================================================================
|
||||||
* For the default windowBits of 15 and memLevel of 8, this function returns
|
* For the default windowBits of 15 and memLevel of 8, this function returns a
|
||||||
* a close to exact, as well as small, upper bound on the compressed size.
|
* close to exact, as well as small, upper bound on the compressed size. This
|
||||||
* They are coded as constants here for a reason--if the #define's are
|
* is an expansion of ~0.03%, plus a small constant.
|
||||||
* changed, then this function needs to be changed as well. The return
|
|
||||||
* value for 15 and 8 only works for those exact settings.
|
|
||||||
*
|
*
|
||||||
* For any setting other than those defaults for windowBits and memLevel,
|
* For any setting other than those defaults for windowBits and memLevel, one
|
||||||
* the value returned is a conservative worst case for the maximum expansion
|
* of two worst case bounds is returned. This is at most an expansion of ~4% or
|
||||||
* resulting from using fixed blocks instead of stored blocks, which deflate
|
* ~13%, plus a small constant.
|
||||||
* can emit on compressed data for some combinations of the parameters.
|
|
||||||
*
|
*
|
||||||
* This function could be more sophisticated to provide closer upper bounds for
|
* Both the 0.03% and 4% derive from the overhead of stored blocks. The first
|
||||||
* every combination of windowBits and memLevel. But even the conservative
|
* one is for stored blocks of 16383 bytes (memLevel == 8), whereas the second
|
||||||
* upper bound of about 14% expansion does not seem onerous for output buffer
|
* is for stored blocks of 127 bytes (the worst case memLevel == 1). The
|
||||||
* allocation.
|
* expansion results from five bytes of header for each stored block.
|
||||||
|
*
|
||||||
|
* The larger expansion of 13% results from a window size less than or equal to
|
||||||
|
* the symbols buffer size (windowBits <= memLevel + 7). In that case some of
|
||||||
|
* the data being compressed may have slid out of the sliding window, impeding
|
||||||
|
* a stored block from being emitted. Then the only choice is a fixed or
|
||||||
|
* dynamic block, where a fixed block limits the maximum expansion to 9 bits
|
||||||
|
* per 8-bit byte, plus 10 bits for every block. The smallest block size for
|
||||||
|
* which this can occur is 255 (memLevel == 2).
|
||||||
|
*
|
||||||
|
* Shifts are used to approximate divisions, for speed.
|
||||||
*/
|
*/
|
||||||
uLong ZEXPORT deflateBound(strm, sourceLen)
|
uLong ZEXPORT deflateBound(strm, sourceLen)
|
||||||
z_streamp strm;
|
z_streamp strm;
|
||||||
uLong sourceLen;
|
uLong sourceLen;
|
||||||
{
|
{
|
||||||
deflate_state *s;
|
deflate_state *s;
|
||||||
uLong complen, wraplen;
|
uLong fixedlen, storelen, wraplen;
|
||||||
|
|
||||||
/* conservative upper bound for compressed data */
|
/* upper bound for fixed blocks with 9-bit literals and length 255
|
||||||
complen = sourceLen +
|
(memLevel == 2, which is the lowest that may not use stored blocks) --
|
||||||
((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
|
~13% overhead plus a small constant */
|
||||||
|
fixedlen = sourceLen + (sourceLen >> 3) + (sourceLen >> 8) +
|
||||||
|
(sourceLen >> 9) + 4;
|
||||||
|
|
||||||
/* if can't get parameters, return conservative bound plus zlib wrapper */
|
/* upper bound for stored blocks with length 127 (memLevel == 1) --
|
||||||
|
~4% overhead plus a small constant */
|
||||||
|
storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) +
|
||||||
|
(sourceLen >> 11) + 7;
|
||||||
|
|
||||||
|
/* if can't get parameters, return larger bound plus a zlib wrapper */
|
||||||
if (deflateStateCheck(strm))
|
if (deflateStateCheck(strm))
|
||||||
return complen + 6;
|
return (fixedlen > storelen ? fixedlen : storelen) + 6;
|
||||||
|
|
||||||
/* compute wrapper length */
|
/* compute wrapper length */
|
||||||
s = strm->state;
|
s = strm->state;
|
||||||
@ -740,11 +750,12 @@ uLong ZEXPORT deflateBound(strm, sourceLen)
|
|||||||
wraplen = 6;
|
wraplen = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if not default parameters, return conservative bound */
|
/* if not default parameters, return one of the conservative bounds */
|
||||||
if (s->w_bits != 15 || s->hash_bits != 8 + 7)
|
if (s->w_bits != 15 || s->hash_bits != 8 + 7)
|
||||||
return complen + wraplen;
|
return (s->w_bits <= s->hash_bits ? fixedlen : storelen) + wraplen;
|
||||||
|
|
||||||
/* default settings: return tight bound for that case */
|
/* default settings: return tight bound for that case -- ~0.03% overhead
|
||||||
|
plus a small constant */
|
||||||
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
|
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
|
||||||
(sourceLen >> 25) + 13 - 6 + wraplen;
|
(sourceLen >> 25) + 13 - 6 + wraplen;
|
||||||
}
|
}
|
||||||
@ -1252,11 +1263,6 @@ local void lm_init (s)
|
|||||||
s->match_length = s->prev_length = MIN_MATCH-1;
|
s->match_length = s->prev_length = MIN_MATCH-1;
|
||||||
s->match_available = 0;
|
s->match_available = 0;
|
||||||
s->ins_h = 0;
|
s->ins_h = 0;
|
||||||
#ifndef FASTEST
|
|
||||||
#ifdef ASMV
|
|
||||||
match_init(); /* initialize the asm code */
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef FASTEST
|
#ifndef FASTEST
|
||||||
@ -1269,10 +1275,6 @@ local void lm_init (s)
|
|||||||
* string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
|
* string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
|
||||||
* OUT assertion: the match length is not greater than s->lookahead.
|
* OUT assertion: the match length is not greater than s->lookahead.
|
||||||
*/
|
*/
|
||||||
#ifndef ASMV
|
|
||||||
/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
|
|
||||||
* match.S. The code will be functionally equivalent.
|
|
||||||
*/
|
|
||||||
local uInt longest_match(s, cur_match)
|
local uInt longest_match(s, cur_match)
|
||||||
deflate_state *s;
|
deflate_state *s;
|
||||||
IPos cur_match; /* current match */
|
IPos cur_match; /* current match */
|
||||||
@ -1318,7 +1320,8 @@ local uInt longest_match(s, cur_match)
|
|||||||
*/
|
*/
|
||||||
if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
|
if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
|
||||||
|
|
||||||
Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
|
Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
|
||||||
|
"need lookahead");
|
||||||
|
|
||||||
do {
|
do {
|
||||||
Assert(cur_match < s->strstart, "no future");
|
Assert(cur_match < s->strstart, "no future");
|
||||||
@ -1342,7 +1345,7 @@ local uInt longest_match(s, cur_match)
|
|||||||
/* It is not necessary to compare scan[2] and match[2] since they are
|
/* It is not necessary to compare scan[2] and match[2] since they are
|
||||||
* always equal when the other bytes match, given that the hash keys
|
* always equal when the other bytes match, given that the hash keys
|
||||||
* are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
|
* are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
|
||||||
* strstart+3, +5, ... up to strstart+257. We check for insufficient
|
* strstart + 3, + 5, up to strstart + 257. We check for insufficient
|
||||||
* lookahead only every 4th comparison; the 128th check will be made
|
* lookahead only every 4th comparison; the 128th check will be made
|
||||||
* at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is
|
* at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is
|
||||||
* necessary to put more guard bytes at the end of the window, or
|
* necessary to put more guard bytes at the end of the window, or
|
||||||
@ -1359,7 +1362,8 @@ local uInt longest_match(s, cur_match)
|
|||||||
/* The funny "do {}" generates better code on most compilers */
|
/* The funny "do {}" generates better code on most compilers */
|
||||||
|
|
||||||
/* Here, scan <= window + strstart + 257 */
|
/* Here, scan <= window + strstart + 257 */
|
||||||
Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
|
Assert(scan <= s->window + (unsigned)(s->window_size - 1),
|
||||||
|
"wild scan");
|
||||||
if (*scan == *match) scan++;
|
if (*scan == *match) scan++;
|
||||||
|
|
||||||
len = (MAX_MATCH - 1) - (int)(strend - scan);
|
len = (MAX_MATCH - 1) - (int)(strend - scan);
|
||||||
@ -1391,7 +1395,8 @@ local uInt longest_match(s, cur_match)
|
|||||||
*++scan == *++match && *++scan == *++match &&
|
*++scan == *++match && *++scan == *++match &&
|
||||||
scan < strend);
|
scan < strend);
|
||||||
|
|
||||||
Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
|
Assert(scan <= s->window + (unsigned)(s->window_size - 1),
|
||||||
|
"wild scan");
|
||||||
|
|
||||||
len = MAX_MATCH - (int)(strend - scan);
|
len = MAX_MATCH - (int)(strend - scan);
|
||||||
scan = strend - MAX_MATCH;
|
scan = strend - MAX_MATCH;
|
||||||
@ -1415,7 +1420,6 @@ local uInt longest_match(s, cur_match)
|
|||||||
if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
|
if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
|
||||||
return s->lookahead;
|
return s->lookahead;
|
||||||
}
|
}
|
||||||
#endif /* ASMV */
|
|
||||||
|
|
||||||
#else /* FASTEST */
|
#else /* FASTEST */
|
||||||
|
|
||||||
@ -1436,7 +1440,8 @@ local uInt longest_match(s, cur_match)
|
|||||||
*/
|
*/
|
||||||
Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
|
Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
|
||||||
|
|
||||||
Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
|
Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
|
||||||
|
"need lookahead");
|
||||||
|
|
||||||
Assert(cur_match < s->strstart, "no future");
|
Assert(cur_match < s->strstart, "no future");
|
||||||
|
|
||||||
@ -1680,7 +1685,7 @@ local void fill_window(s)
|
|||||||
*
|
*
|
||||||
* deflate_stored() is written to minimize the number of times an input byte is
|
* deflate_stored() is written to minimize the number of times an input byte is
|
||||||
* copied. It is most efficient with large input and output buffers, which
|
* copied. It is most efficient with large input and output buffers, which
|
||||||
* maximizes the opportunites to have a single copy from next_in to next_out.
|
* maximizes the opportunities to have a single copy from next_in to next_out.
|
||||||
*/
|
*/
|
||||||
local block_state deflate_stored(s, flush)
|
local block_state deflate_stored(s, flush)
|
||||||
deflate_state *s;
|
deflate_state *s;
|
||||||
@ -2140,7 +2145,8 @@ local block_state deflate_rle(s, flush)
|
|||||||
if (s->match_length > s->lookahead)
|
if (s->match_length > s->lookahead)
|
||||||
s->match_length = s->lookahead;
|
s->match_length = s->lookahead;
|
||||||
}
|
}
|
||||||
Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
|
Assert(scan <= s->window + (uInt)(s->window_size - 1),
|
||||||
|
"wild scan");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
|
/* Emit match if have run of MIN_MATCH or longer, else emit literal */
|
||||||
|
@ -329,8 +329,8 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
|
|||||||
# define _tr_tally_dist(s, distance, length, flush) \
|
# define _tr_tally_dist(s, distance, length, flush) \
|
||||||
{ uch len = (uch)(length); \
|
{ uch len = (uch)(length); \
|
||||||
ush dist = (ush)(distance); \
|
ush dist = (ush)(distance); \
|
||||||
s->sym_buf[s->sym_next++] = (uchf) dist; \
|
s->sym_buf[s->sym_next++] = (uch)dist; \
|
||||||
s->sym_buf[s->sym_next++] = dist >> 8; \
|
s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
|
||||||
s->sym_buf[s->sym_next++] = len; \
|
s->sym_buf[s->sym_next++] = len; \
|
||||||
dist--; \
|
dist--; \
|
||||||
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
|
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
|
||||||
|
@ -157,11 +157,9 @@ local int gz_look(state)
|
|||||||
the output buffer is larger than the input buffer, which also assures
|
the output buffer is larger than the input buffer, which also assures
|
||||||
space for gzungetc() */
|
space for gzungetc() */
|
||||||
state->x.next = state->out;
|
state->x.next = state->out;
|
||||||
if (strm->avail_in) {
|
|
||||||
memcpy(state->x.next, strm->next_in, strm->avail_in);
|
memcpy(state->x.next, strm->next_in, strm->avail_in);
|
||||||
state->x.have = strm->avail_in;
|
state->x.have = strm->avail_in;
|
||||||
strm->avail_in = 0;
|
strm->avail_in = 0;
|
||||||
}
|
|
||||||
state->how = COPY;
|
state->how = COPY;
|
||||||
state->direct = 1;
|
state->direct = 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -66,6 +66,7 @@ int stream_size;
|
|||||||
state->window = window;
|
state->window = window;
|
||||||
state->wnext = 0;
|
state->wnext = 0;
|
||||||
state->whave = 0;
|
state->whave = 0;
|
||||||
|
state->sane = 1;
|
||||||
return Z_OK;
|
return Z_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -605,25 +606,27 @@ void FAR *out_desc;
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DONE:
|
case DONE:
|
||||||
/* inflate stream terminated properly -- write leftover output */
|
/* inflate stream terminated properly */
|
||||||
ret = Z_STREAM_END;
|
ret = Z_STREAM_END;
|
||||||
if (left < state->wsize) {
|
|
||||||
if (out(out_desc, state->window, state->wsize - left))
|
|
||||||
ret = Z_BUF_ERROR;
|
|
||||||
}
|
|
||||||
goto inf_leave;
|
goto inf_leave;
|
||||||
|
|
||||||
case BAD:
|
case BAD:
|
||||||
ret = Z_DATA_ERROR;
|
ret = Z_DATA_ERROR;
|
||||||
goto inf_leave;
|
goto inf_leave;
|
||||||
|
|
||||||
default: /* can't happen, but makes compilers happy */
|
default:
|
||||||
|
/* can't happen, but makes compilers happy */
|
||||||
ret = Z_STREAM_ERROR;
|
ret = Z_STREAM_ERROR;
|
||||||
goto inf_leave;
|
goto inf_leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return unused input */
|
/* Write leftover output and return unused input */
|
||||||
inf_leave:
|
inf_leave:
|
||||||
|
if (left < state->wsize) {
|
||||||
|
if (out(out_desc, state->window, state->wsize - left) &&
|
||||||
|
ret == Z_STREAM_END)
|
||||||
|
ret = Z_BUF_ERROR;
|
||||||
|
}
|
||||||
strm->next_in = next;
|
strm->next_in = next;
|
||||||
strm->avail_in = have;
|
strm->avail_in = have;
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -168,6 +168,8 @@ int windowBits;
|
|||||||
|
|
||||||
/* extract wrap request from windowBits parameter */
|
/* extract wrap request from windowBits parameter */
|
||||||
if (windowBits < 0) {
|
if (windowBits < 0) {
|
||||||
|
if (windowBits < -15)
|
||||||
|
return Z_STREAM_ERROR;
|
||||||
wrap = 0;
|
wrap = 0;
|
||||||
windowBits = -windowBits;
|
windowBits = -windowBits;
|
||||||
}
|
}
|
||||||
@ -764,8 +766,9 @@ int flush;
|
|||||||
if (copy > have) copy = have;
|
if (copy > have) copy = have;
|
||||||
if (copy) {
|
if (copy) {
|
||||||
if (state->head != Z_NULL &&
|
if (state->head != Z_NULL &&
|
||||||
state->head->extra != Z_NULL) {
|
state->head->extra != Z_NULL &&
|
||||||
len = state->head->extra_len - state->length;
|
(len = state->head->extra_len - state->length) <
|
||||||
|
state->head->extra_max) {
|
||||||
zmemcpy(state->head->extra + len, next,
|
zmemcpy(state->head->extra + len, next,
|
||||||
len + copy > state->head->extra_max ?
|
len + copy > state->head->extra_max ?
|
||||||
state->head->extra_max - len : copy);
|
state->head->extra_max - len : copy);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#define MAXBITS 15
|
#define MAXBITS 15
|
||||||
|
|
||||||
const char inflate_copyright[] =
|
const char inflate_copyright[] =
|
||||||
" inflate 1.2.12 Copyright 1995-2022 Mark Adler ";
|
" inflate 1.2.13 Copyright 1995-2022 Mark Adler ";
|
||||||
/*
|
/*
|
||||||
If you use the zlib library in a product, an acknowledgment is welcome
|
If you use the zlib library in a product, an acknowledgment is welcome
|
||||||
in the documentation of your product. If for some reason you cannot
|
in the documentation of your product. If for some reason you cannot
|
||||||
@ -62,7 +62,7 @@ unsigned short FAR *work;
|
|||||||
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
|
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
|
||||||
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
|
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
|
||||||
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
|
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
|
||||||
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 202};
|
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 194, 65};
|
||||||
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
|
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
|
||||||
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
|
||||||
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
|
||||||
|
@ -38,7 +38,7 @@ typedef struct {
|
|||||||
/* Maximum size of the dynamic table. The maximum number of code structures is
|
/* Maximum size of the dynamic table. The maximum number of code structures is
|
||||||
1444, which is the sum of 852 for literal/length codes and 592 for distance
|
1444, which is the sum of 852 for literal/length codes and 592 for distance
|
||||||
codes. These values were found by exhaustive searches using the program
|
codes. These values were found by exhaustive searches using the program
|
||||||
examples/enough.c found in the zlib distribtution. The arguments to that
|
examples/enough.c found in the zlib distribution. The arguments to that
|
||||||
program are the number of symbols, the initial root table size, and the
|
program are the number of symbols, the initial root table size, and the
|
||||||
maximum bit length of a code. "enough 286 9 15" for literal/length codes
|
maximum bit length of a code. "enough 286 9 15" for literal/length codes
|
||||||
returns returns 852, and "enough 30 6 15" for distance codes returns 592.
|
returns returns 852, and "enough 30 6 15" for distance codes returns 592.
|
||||||
|
@ -14,9 +14,9 @@ $! 0.02 20061008 Adapt to new Makefile.in
|
|||||||
$! 0.03 20091224 Add support for large file check
|
$! 0.03 20091224 Add support for large file check
|
||||||
$! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite
|
$! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite
|
||||||
$! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in
|
$! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in
|
||||||
$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new exmples
|
$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new examples
|
||||||
$! subdir path, update module search in makefile.in
|
$! subdir path, update module search in makefile.in
|
||||||
$! 0.07 20120115 Triggered by work done by Alexey Chupahin completly redesigned
|
$! 0.07 20120115 Triggered by work done by Alexey Chupahin completely redesigned
|
||||||
$! shared image creation
|
$! shared image creation
|
||||||
$! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared
|
$! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared
|
||||||
$! image
|
$! image
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
<QPG:Files>
|
<QPG:Files>
|
||||||
<QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
|
<QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
|
||||||
<QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
|
<QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
|
||||||
<QPG:Add file="../libz.so.1.2.12" install="/opt/lib/" user="root:bin" permission="644"/>
|
<QPG:Add file="../libz.so.1.2.13" install="/opt/lib/" user="root:bin" permission="644"/>
|
||||||
<QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.12"/>
|
<QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.13"/>
|
||||||
<QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.12"/>
|
<QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.13"/>
|
||||||
<QPG:Add file="../libz.so.1.2.12" install="/opt/lib/" component="slib"/>
|
<QPG:Add file="../libz.so.1.2.13" install="/opt/lib/" component="slib"/>
|
||||||
</QPG:Files>
|
</QPG:Files>
|
||||||
|
|
||||||
<QPG:PackageFilter>
|
<QPG:PackageFilter>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
</QPM:ProductDescription>
|
</QPM:ProductDescription>
|
||||||
|
|
||||||
<QPM:ReleaseDescription>
|
<QPM:ReleaseDescription>
|
||||||
<QPM:ReleaseVersion>1.2.12</QPM:ReleaseVersion>
|
<QPM:ReleaseVersion>1.2.13</QPM:ReleaseVersion>
|
||||||
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
|
<QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
|
||||||
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
|
<QPM:ReleaseStability>Stable</QPM:ReleaseStability>
|
||||||
<QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
|
<QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<package name="zlib" version="1.2.12">
|
<package name="zlib" version="1.2.13">
|
||||||
<library name="zlib" dlversion="1.2.12" dlname="z">
|
<library name="zlib" dlversion="1.2.13" dlname="z">
|
||||||
<property name="description"> zip compression library </property>
|
<property name="description"> zip compression library </property>
|
||||||
<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />
|
<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />
|
||||||
|
|
||||||
|
27
zlib/trees.c
27
zlib/trees.c
@ -312,7 +312,7 @@ local void tr_static_init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ===========================================================================
|
/* ===========================================================================
|
||||||
* Genererate the file trees.h describing the static trees.
|
* Generate the file trees.h describing the static trees.
|
||||||
*/
|
*/
|
||||||
#ifdef GEN_TREES_H
|
#ifdef GEN_TREES_H
|
||||||
# ifndef ZLIB_DEBUG
|
# ifndef ZLIB_DEBUG
|
||||||
@ -807,8 +807,8 @@ local int build_bl_tree(s)
|
|||||||
|
|
||||||
/* Build the bit length tree: */
|
/* Build the bit length tree: */
|
||||||
build_tree(s, (tree_desc *)(&(s->bl_desc)));
|
build_tree(s, (tree_desc *)(&(s->bl_desc)));
|
||||||
/* opt_len now includes the length of the tree representations, except
|
/* opt_len now includes the length of the tree representations, except the
|
||||||
* the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
|
* lengths of the bit lengths codes and the 5 + 5 + 4 bits for the counts.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Determine the number of bit length codes to send. The pkzip format
|
/* Determine the number of bit length codes to send. The pkzip format
|
||||||
@ -950,7 +950,10 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
|
|||||||
opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
|
opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
|
||||||
s->sym_next / 3));
|
s->sym_next / 3));
|
||||||
|
|
||||||
if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
|
#ifndef FORCE_STATIC
|
||||||
|
if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
|
||||||
|
#endif
|
||||||
|
opt_lenb = static_lenb;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Assert(buf != (char*)0, "lost buf");
|
Assert(buf != (char*)0, "lost buf");
|
||||||
@ -971,11 +974,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
|
|||||||
*/
|
*/
|
||||||
_tr_stored_block(s, buf, stored_len, last);
|
_tr_stored_block(s, buf, stored_len, last);
|
||||||
|
|
||||||
#ifdef FORCE_STATIC
|
} else if (static_lenb == opt_lenb) {
|
||||||
} else if (static_lenb >= 0) { /* force static trees */
|
|
||||||
#else
|
|
||||||
} else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
|
|
||||||
#endif
|
|
||||||
send_bits(s, (STATIC_TREES<<1) + last, 3);
|
send_bits(s, (STATIC_TREES<<1) + last, 3);
|
||||||
compress_block(s, (const ct_data *)static_ltree,
|
compress_block(s, (const ct_data *)static_ltree,
|
||||||
(const ct_data *)static_dtree);
|
(const ct_data *)static_dtree);
|
||||||
@ -1015,11 +1014,11 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
|
|||||||
int ZLIB_INTERNAL _tr_tally(s, dist, lc)
|
int ZLIB_INTERNAL _tr_tally(s, dist, lc)
|
||||||
deflate_state *s;
|
deflate_state *s;
|
||||||
unsigned dist; /* distance of matched string */
|
unsigned dist; /* distance of matched string */
|
||||||
unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
|
unsigned lc; /* match length - MIN_MATCH or unmatched char (dist==0) */
|
||||||
{
|
{
|
||||||
s->sym_buf[s->sym_next++] = dist;
|
s->sym_buf[s->sym_next++] = (uch)dist;
|
||||||
s->sym_buf[s->sym_next++] = dist >> 8;
|
s->sym_buf[s->sym_next++] = (uch)(dist >> 8);
|
||||||
s->sym_buf[s->sym_next++] = lc;
|
s->sym_buf[s->sym_next++] = (uch)lc;
|
||||||
if (dist == 0) {
|
if (dist == 0) {
|
||||||
/* lc is the unmatched char */
|
/* lc is the unmatched char */
|
||||||
s->dyn_ltree[lc].Freq++;
|
s->dyn_ltree[lc].Freq++;
|
||||||
@ -1061,7 +1060,7 @@ local void compress_block(s, ltree, dtree)
|
|||||||
} else {
|
} else {
|
||||||
/* Here, lc is the match length - MIN_MATCH */
|
/* Here, lc is the match length - MIN_MATCH */
|
||||||
code = _length_code[lc];
|
code = _length_code[lc];
|
||||||
send_code(s, code+LITERALS+1, ltree); /* send the length code */
|
send_code(s, code + LITERALS + 1, ltree); /* send length code */
|
||||||
extra = extra_lbits[code];
|
extra = extra_lbits[code];
|
||||||
if (extra != 0) {
|
if (extra != 0) {
|
||||||
lc -= base_length[code];
|
lc -= base_length[code];
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
ZLIB DATA COMPRESSION LIBRARY
|
ZLIB DATA COMPRESSION LIBRARY
|
||||||
|
|
||||||
zlib 1.2.12 is a general purpose data compression library. All the code is
|
zlib 1.2.13 is a general purpose data compression library. All the code is
|
||||||
thread safe. The data format used by the zlib library is described by RFCs
|
thread safe. The data format used by the zlib library is described by RFCs
|
||||||
(Request for Comments) 1950 to 1952 in the files
|
(Request for Comments) 1950 to 1952 in the files
|
||||||
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
|
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
|
||||||
@ -22,7 +22,7 @@ before asking for help.
|
|||||||
|
|
||||||
Manifest:
|
Manifest:
|
||||||
|
|
||||||
The package zlib-1.2.12-win32-x86.zip will contain the following files:
|
The package zlib-1.2.13-win32-x86.zip will contain the following files:
|
||||||
|
|
||||||
README-WIN32.txt This document
|
README-WIN32.txt This document
|
||||||
ChangeLog Changes since previous zlib packages
|
ChangeLog Changes since previous zlib packages
|
||||||
|
@ -26,7 +26,7 @@ BEGIN
|
|||||||
VALUE "FileDescription", "zlib data compression library\0"
|
VALUE "FileDescription", "zlib data compression library\0"
|
||||||
VALUE "FileVersion", ZLIB_VERSION "\0"
|
VALUE "FileVersion", ZLIB_VERSION "\0"
|
||||||
VALUE "InternalName", "zlib1.dll\0"
|
VALUE "InternalName", "zlib1.dll\0"
|
||||||
VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
|
VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
|
||||||
VALUE "OriginalFilename", "zlib1.dll\0"
|
VALUE "OriginalFilename", "zlib1.dll\0"
|
||||||
VALUE "ProductName", "zlib\0"
|
VALUE "ProductName", "zlib\0"
|
||||||
VALUE "ProductVersion", ZLIB_VERSION "\0"
|
VALUE "ProductVersion", ZLIB_VERSION "\0"
|
||||||
|
@ -40,6 +40,9 @@
|
|||||||
# define crc32 z_crc32
|
# define crc32 z_crc32
|
||||||
# define crc32_combine z_crc32_combine
|
# define crc32_combine z_crc32_combine
|
||||||
# define crc32_combine64 z_crc32_combine64
|
# define crc32_combine64 z_crc32_combine64
|
||||||
|
# define crc32_combine_gen z_crc32_combine_gen
|
||||||
|
# define crc32_combine_gen64 z_crc32_combine_gen64
|
||||||
|
# define crc32_combine_op z_crc32_combine_op
|
||||||
# define crc32_z z_crc32_z
|
# define crc32_z z_crc32_z
|
||||||
# define deflate z_deflate
|
# define deflate z_deflate
|
||||||
# define deflateBound z_deflateBound
|
# define deflateBound z_deflateBound
|
||||||
@ -351,6 +354,9 @@
|
|||||||
# ifdef FAR
|
# ifdef FAR
|
||||||
# undef FAR
|
# undef FAR
|
||||||
# endif
|
# endif
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
/* No need for _export, use ZLIB.DEF instead. */
|
/* No need for _export, use ZLIB.DEF instead. */
|
||||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||||
@ -469,11 +475,18 @@ typedef uLong FAR uLongf;
|
|||||||
# undef _LARGEFILE64_SOURCE
|
# undef _LARGEFILE64_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
|
#ifndef Z_HAVE_UNISTD_H
|
||||||
|
# ifdef __WATCOMC__
|
||||||
# define Z_HAVE_UNISTD_H
|
# define Z_HAVE_UNISTD_H
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef Z_HAVE_UNISTD_H
|
||||||
|
# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
|
||||||
|
# define Z_HAVE_UNISTD_H
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
#ifndef Z_SOLO
|
#ifndef Z_SOLO
|
||||||
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
|
# if defined(Z_HAVE_UNISTD_H)
|
||||||
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
|
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
|
||||||
# ifdef VMS
|
# ifdef VMS
|
||||||
# include <unixio.h> /* for off_t */
|
# include <unixio.h> /* for off_t */
|
||||||
|
@ -38,6 +38,9 @@
|
|||||||
# define crc32 z_crc32
|
# define crc32 z_crc32
|
||||||
# define crc32_combine z_crc32_combine
|
# define crc32_combine z_crc32_combine
|
||||||
# define crc32_combine64 z_crc32_combine64
|
# define crc32_combine64 z_crc32_combine64
|
||||||
|
# define crc32_combine_gen z_crc32_combine_gen
|
||||||
|
# define crc32_combine_gen64 z_crc32_combine_gen64
|
||||||
|
# define crc32_combine_op z_crc32_combine_op
|
||||||
# define crc32_z z_crc32_z
|
# define crc32_z z_crc32_z
|
||||||
# define deflate z_deflate
|
# define deflate z_deflate
|
||||||
# define deflateBound z_deflateBound
|
# define deflateBound z_deflateBound
|
||||||
@ -349,6 +352,9 @@
|
|||||||
# ifdef FAR
|
# ifdef FAR
|
||||||
# undef FAR
|
# undef FAR
|
||||||
# endif
|
# endif
|
||||||
|
# ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
# define WIN32_LEAN_AND_MEAN
|
||||||
|
# endif
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
/* No need for _export, use ZLIB.DEF instead. */
|
/* No need for _export, use ZLIB.DEF instead. */
|
||||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||||
@ -467,11 +473,18 @@ typedef uLong FAR uLongf;
|
|||||||
# undef _LARGEFILE64_SOURCE
|
# undef _LARGEFILE64_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
|
#ifndef Z_HAVE_UNISTD_H
|
||||||
|
# ifdef __WATCOMC__
|
||||||
# define Z_HAVE_UNISTD_H
|
# define Z_HAVE_UNISTD_H
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef Z_HAVE_UNISTD_H
|
||||||
|
# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
|
||||||
|
# define Z_HAVE_UNISTD_H
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
#ifndef Z_SOLO
|
#ifndef Z_SOLO
|
||||||
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
|
# if defined(Z_HAVE_UNISTD_H)
|
||||||
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
|
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
|
||||||
# ifdef VMS
|
# ifdef VMS
|
||||||
# include <unixio.h> /* for off_t */
|
# include <unixio.h> /* for off_t */
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.TH ZLIB 3 "27 Mar 2022"
|
.TH ZLIB 3 "13 Oct 2022"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
zlib \- compression/decompression library
|
zlib \- compression/decompression library
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -105,7 +105,7 @@ before asking for help.
|
|||||||
Send questions and/or comments to zlib@gzip.org,
|
Send questions and/or comments to zlib@gzip.org,
|
||||||
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
|
or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
|
||||||
.SH AUTHORS AND LICENSE
|
.SH AUTHORS AND LICENSE
|
||||||
Version 1.2.12
|
Version 1.2.13
|
||||||
.LP
|
.LP
|
||||||
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||||
.LP
|
.LP
|
||||||
|
16
zlib/zlib.h
16
zlib/zlib.h
@ -1,5 +1,5 @@
|
|||||||
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
/* zlib.h -- interface of the 'zlib' general purpose compression library
|
||||||
version 1.2.12, March 11th, 2022
|
version 1.2.13, October 13th, 2022
|
||||||
|
|
||||||
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
|
||||||
|
|
||||||
@ -37,11 +37,11 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ZLIB_VERSION "1.2.12"
|
#define ZLIB_VERSION "1.2.13"
|
||||||
#define ZLIB_VERNUM 0x12c0
|
#define ZLIB_VERNUM 0x12d0
|
||||||
#define ZLIB_VER_MAJOR 1
|
#define ZLIB_VER_MAJOR 1
|
||||||
#define ZLIB_VER_MINOR 2
|
#define ZLIB_VER_MINOR 2
|
||||||
#define ZLIB_VER_REVISION 12
|
#define ZLIB_VER_REVISION 13
|
||||||
#define ZLIB_VER_SUBREVISION 0
|
#define ZLIB_VER_SUBREVISION 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -276,7 +276,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
|
|||||||
== 0), or after each call of deflate(). If deflate returns Z_OK and with
|
== 0), or after each call of deflate(). If deflate returns Z_OK and with
|
||||||
zero avail_out, it must be called again after making room in the output
|
zero avail_out, it must be called again after making room in the output
|
||||||
buffer because there might be more output pending. See deflatePending(),
|
buffer because there might be more output pending. See deflatePending(),
|
||||||
which can be used if desired to determine whether or not there is more ouput
|
which can be used if desired to determine whether or not there is more output
|
||||||
in that case.
|
in that case.
|
||||||
|
|
||||||
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
|
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
|
||||||
@ -660,7 +660,7 @@ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
|
|||||||
to dictionary. dictionary must have enough space, where 32768 bytes is
|
to dictionary. dictionary must have enough space, where 32768 bytes is
|
||||||
always enough. If deflateGetDictionary() is called with dictionary equal to
|
always enough. If deflateGetDictionary() is called with dictionary equal to
|
||||||
Z_NULL, then only the dictionary length is returned, and nothing is copied.
|
Z_NULL, then only the dictionary length is returned, and nothing is copied.
|
||||||
Similary, if dictLength is Z_NULL, then it is not set.
|
Similarly, if dictLength is Z_NULL, then it is not set.
|
||||||
|
|
||||||
deflateGetDictionary() may return a length less than the window size, even
|
deflateGetDictionary() may return a length less than the window size, even
|
||||||
when more than the window size in input has been provided. It may return up
|
when more than the window size in input has been provided. It may return up
|
||||||
@ -915,7 +915,7 @@ ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
|
|||||||
to dictionary. dictionary must have enough space, where 32768 bytes is
|
to dictionary. dictionary must have enough space, where 32768 bytes is
|
||||||
always enough. If inflateGetDictionary() is called with dictionary equal to
|
always enough. If inflateGetDictionary() is called with dictionary equal to
|
||||||
Z_NULL, then only the dictionary length is returned, and nothing is copied.
|
Z_NULL, then only the dictionary length is returned, and nothing is copied.
|
||||||
Similary, if dictLength is Z_NULL, then it is not set.
|
Similarly, if dictLength is Z_NULL, then it is not set.
|
||||||
|
|
||||||
inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
|
inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
|
||||||
stream state is inconsistent.
|
stream state is inconsistent.
|
||||||
@ -1437,7 +1437,7 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
|
|||||||
|
|
||||||
In the event that the end of file is reached and only a partial item is
|
In the event that the end of file is reached and only a partial item is
|
||||||
available at the end, i.e. the remaining uncompressed data length is not a
|
available at the end, i.e. the remaining uncompressed data length is not a
|
||||||
multiple of size, then the final partial item is nevetheless read into buf
|
multiple of size, then the final partial item is nevertheless read into buf
|
||||||
and the end-of-file flag is set. The length of the partial item read is not
|
and the end-of-file flag is set. The length of the partial item read is not
|
||||||
provided, but could be inferred from the result of gztell(). This behavior
|
provided, but could be inferred from the result of gztell(). This behavior
|
||||||
is the same as the behavior of fread() implementations in common libraries,
|
is the same as the behavior of fread() implementations in common libraries,
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
#
|
#
|
||||||
# Asumes no function pointer parameters. unless they are typedefed.
|
# Assumes no function pointer parameters. unless they are typedefed.
|
||||||
# Assumes no literal strings that look like function definitions
|
# Assumes no literal strings that look like function definitions
|
||||||
# Assumes functions start at the beginning of a line
|
# Assumes functions start at the beginning of a line
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ sub StripComments
|
|||||||
|
|
||||||
no warnings;
|
no warnings;
|
||||||
|
|
||||||
# Strip C & C++ coments
|
# Strip C & C++ comments
|
||||||
# From the perlfaq
|
# From the perlfaq
|
||||||
$_[0] =~
|
$_[0] =~
|
||||||
|
|
||||||
|
@ -61,9 +61,11 @@ uLong ZEXPORT zlibCompileFlags()
|
|||||||
#ifdef ZLIB_DEBUG
|
#ifdef ZLIB_DEBUG
|
||||||
flags += 1 << 8;
|
flags += 1 << 8;
|
||||||
#endif
|
#endif
|
||||||
|
/*
|
||||||
#if defined(ASMV) || defined(ASMINF)
|
#if defined(ASMV) || defined(ASMINF)
|
||||||
flags += 1 << 9;
|
flags += 1 << 9;
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
#ifdef ZLIB_WINAPI
|
#ifdef ZLIB_WINAPI
|
||||||
flags += 1 << 10;
|
flags += 1 << 10;
|
||||||
#endif
|
#endif
|
||||||
|
@ -193,6 +193,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
|
|||||||
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
||||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
|
||||||
|
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* common defaults */
|
/* common defaults */
|
||||||
|
Reference in New Issue
Block a user