summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <brian@zim.(none)>2005-12-23 12:22:31 -0800
committerunknown <brian@zim.(none)>2005-12-23 12:22:31 -0800
commit8ff680920a269c44b620306c801a7dd30a0eedbf (patch)
tree35030777a6375ac5331d70c5975b0c7c7b98b297
parent2c88b6395b6343a3849ef0d3cb932ce7f9c282d3 (diff)
downloadmariadb-git-8ff680920a269c44b620306c801a7dd30a0eedbf.tar.gz
Fix for Antony's push. I've also changed from using the zlib off_t pointer type to my_off_t to fix issues around buggy zlib versions and to make sure file sizes are consistent through out mysql.
mysql-test/r/information_schema.result: Fix for Antony adding plugins to information schema. sql/ha_archive.cc: Fix for now using my_off_t, no need to worry about buggy zlib's anymore. sql/ha_archive.h: Update to fix issues with buggy zlib. storage/archive/azio.c: Moved to using my_off_t (which should fix problems with most fille system size issues). storage/archive/azlib.h: Change to using my_off_t
-rw-r--r--mysql-test/r/information_schema.result4
-rw-r--r--sql/ha_archive.cc11
-rw-r--r--sql/ha_archive.h2
-rw-r--r--storage/archive/azio.c6
-rw-r--r--storage/archive/azlib.h12
5 files changed, 17 insertions, 18 deletions
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index f86e972dfe1..20e6c61c46b 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -725,7 +725,7 @@ CREATE TABLE t_crashme ( f1 BIGINT);
CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
count(*)
-103
+104
drop view a2, a1;
drop table t_crashme;
select table_schema,table_name, column_name from
@@ -796,7 +796,7 @@ delete from mysql.db where user='mysqltest_4';
flush privileges;
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
table_schema count(*)
-information_schema 17
+information_schema 18
mysql 18
create table t1 (i int, j int);
create trigger trg1 before insert on t1 for each row
diff --git a/sql/ha_archive.cc b/sql/ha_archive.cc
index 5fd995fefd2..6cfb29537a2 100644
--- a/sql/ha_archive.cc
+++ b/sql/ha_archive.cc
@@ -247,8 +247,7 @@ ha_archive::ha_archive(TABLE_SHARE *table_arg)
buffer.set((char *)byte_buffer, IO_SIZE, system_charset_info);
/* The size of the offset value we will use for position() */
- ref_length = 2 << ((zlibCompileFlags() >> 6) & 3);
- DBUG_ASSERT(ref_length <= sizeof(z_off_t));
+ ref_length = sizeof(my_off_t);
}
/*
@@ -612,7 +611,7 @@ error:
*/
int ha_archive::real_write_row(byte *buf, azio_stream *writer)
{
- z_off_t written;
+ my_off_t written;
uint *ptr, *end;
DBUG_ENTER("ha_archive::real_write_row");
@@ -621,7 +620,7 @@ int ha_archive::real_write_row(byte *buf, azio_stream *writer)
if (!delayed_insert || !bulk_insert)
share->dirty= TRUE;
- if (written != (z_off_t)table->s->reclength)
+ if (written != (my_off_t)table->s->reclength)
DBUG_RETURN(errno ? errno : -1);
/*
We should probably mark the table as damagaged if the record is written
@@ -638,7 +637,7 @@ int ha_archive::real_write_row(byte *buf, azio_stream *writer)
{
((Field_blob*) table->field[*ptr])->get_ptr(&data_ptr);
written= azwrite(writer, data_ptr, (unsigned)size);
- if (written != (z_off_t)size)
+ if (written != (my_off_t)size)
DBUG_RETURN(errno ? errno : -1);
}
}
@@ -830,7 +829,7 @@ int ha_archive::rnd_pos(byte * buf, byte *pos)
DBUG_ENTER("ha_archive::rnd_pos");
statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
&LOCK_status);
- current_position= (z_off_t)my_get_ptr(pos, ref_length);
+ current_position= (my_off_t)my_get_ptr(pos, ref_length);
(void)azseek(&archive, current_position, SEEK_SET);
DBUG_RETURN(get_row(&archive, buf));
diff --git a/sql/ha_archive.h b/sql/ha_archive.h
index 2df23eec6c3..7b957060f34 100644
--- a/sql/ha_archive.h
+++ b/sql/ha_archive.h
@@ -51,7 +51,7 @@ class ha_archive: public handler
THR_LOCK_DATA lock; /* MySQL lock */
ARCHIVE_SHARE *share; /* Shared lock info */
azio_stream archive; /* Archive file we are working with */
- z_off_t current_position; /* The position of the row we just read */
+ my_off_t current_position; /* The position of the row we just read */
byte byte_buffer[IO_SIZE]; /* Initial buffer for our string */
String buffer; /* Buffer used for blob storage */
ha_rows scan_rows; /* Number of rows left in scan */
diff --git a/storage/archive/azio.c b/storage/archive/azio.c
index 4a08f65ff30..425f26cef15 100644
--- a/storage/archive/azio.c
+++ b/storage/archive/azio.c
@@ -506,9 +506,9 @@ int azrewind (s)
SEEK_END is not implemented, returns error.
In this version of the library, azseek can be extremely slow.
*/
-z_off_t azseek (s, offset, whence)
+my_off_t azseek (s, offset, whence)
azio_stream *s;
- z_off_t offset;
+ my_off_t offset;
int whence;
{
@@ -589,7 +589,7 @@ z_off_t azseek (s, offset, whence)
given compressed file. This position represents a number of bytes in the
uncompressed data stream.
*/
-z_off_t ZEXPORT aztell (file)
+my_off_t ZEXPORT aztell (file)
azio_stream *file;
{
return azseek(file, 0L, SEEK_CUR);
diff --git a/storage/archive/azlib.h b/storage/archive/azlib.h
index 0c2daaea940..e63d1ed9997 100644
--- a/storage/archive/azlib.h
+++ b/storage/archive/azlib.h
@@ -166,9 +166,9 @@ typedef struct azio_stream {
char *msg; /* error message */
int transparent; /* 1 if input file is not a .gz file */
char mode; /* 'w' or 'r' */
- z_off_t start; /* start of compressed data in file (header skipped) */
- z_off_t in; /* bytes into deflate or inflate */
- z_off_t out; /* bytes out of deflate or inflate */
+ my_off_t start; /* start of compressed data in file (header skipped) */
+ my_off_t in; /* bytes into deflate or inflate */
+ my_off_t out; /* bytes out of deflate or inflate */
int back; /* one character push-back */
int last; /* true if push-back is last character */
} azio_stream;
@@ -232,8 +232,8 @@ extern int azflush(azio_stream *file, int flush);
degrade compression.
*/
-extern z_off_t azseek (azio_stream *file,
- z_off_t offset, int whence);
+extern my_off_t azseek (azio_stream *file,
+ my_off_t offset, int whence);
/*
Sets the starting position for the next gzread or gzwrite on the
given compressed file. The offset represents a number of bytes in the
@@ -257,7 +257,7 @@ extern int azrewind(azio_stream *file);
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
*/
-extern z_off_t aztell(azio_stream *file);
+extern my_off_t aztell(azio_stream *file);
/*
Returns the starting position for the next gzread or gzwrite on the
given compressed file. This position represents a number of bytes in the