Below is the list of changes that have just been committed into a local
5.1 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2190 06/03/21 15:30:53 msvensson@shellback.(none) +6 -0
Bug#17368 General log and slow query log don't work
- Port ha_tina.cc to run on windows
- Always compile with support for csv storage engine
storage/csv/ha_tina.h
1.15 06/03/21 15:30:46 msvensson@shellback.(none) +3 -3
Remove "typedef" since no name is defined and "tina_set" is used in the code
storage/csv/ha_tina.cc
1.37 06/03/21 15:30:46 msvensson@shellback.(none) +20 -11
Remove "include <sys/mman.h>", use the defines and functions from mysys
Add cast to byte* when calling 'my_write'
Add cast to char* when calling 'buffer.set'
munmap the file before setting it's size, my_chsize will fail if file is mapped.
sql/handlerton.cc.in
1.2 06/03/21 15:30:46 msvensson@shellback.(none) +2 -1
Add the tina_hton to list of htons that always are added
sql/cmakelists.txt
1.12 06/03/21 15:30:46 msvensson@shellback.(none) +2 -1
Add define to include support for CSV storage engine
Add ha_tina.cc to files that should be compiled
mysys/my_mmap.c
1.8 06/03/21 15:30:46 msvensson@shellback.(none) +1 -4
Remove unused flProtect
Look at "prot" argument when deciding if map should be read or write.
include/my_sys.h
1.189 06/03/21 15:30:46 msvensson@shellback.(none) +1 -0
Add define for MAP_PRIVATE, to be used in my_mmap to decide what kind of map to open.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: msvensson
# Host: shellback.(none)
# Root: /home/msvensson/mysql/bug17368/my51-bug17368
--- 1.188/include/my_sys.h 2006-02-24 22:20:42 +01:00
+++ 1.189/include/my_sys.h 2006-03-21 15:30:46 +01:00
@@ -850,6 +850,7 @@
#define PROT_WRITE 2
#define MAP_NORESERVE 0
#define MAP_SHARED 0x0001
+#define MAP_PRIVATE 0x0002
#define MAP_NOSYNC 0x0800
#define MAP_FAILED ((void *)-1)
#define MS_SYNC 0x0000
--- 1.1/sql/handlerton.cc.in 2005-11-07 16:24:47 +01:00
+++ 1.2/sql/handlerton.cc.in 2006-03-21 15:30:46 +01:00
@@ -9,6 +9,7 @@
*/
handlerton *sys_table_types[]=
{
- &heap_hton,&myisam_hton@mysql_se_htons@,&myisammrg_hton,&binlog_hton,NULL
+ &heap_hton,&myisam_hton,&tina_hton@mysql_se_htons@,
+ &myisammrg_hton,&binlog_hton,NULL
};
--- 1.36/storage/csv/ha_tina.cc 2006-03-06 19:03:09 +01:00
+++ 1.37/storage/csv/ha_tina.cc 2006-03-21 15:30:46 +01:00
@@ -49,7 +49,6 @@
#include "mysql_priv.h"
#include "ha_tina.h"
-#include <sys/mman.h>
#include <mysql/plugin.h>
@@ -143,7 +142,7 @@
share->mapped_file= (byte *)my_mmap(NULL, share->file_stat.st_size,
PROT_READ, MAP_PRIVATE,
share->data_file, 0);
- if ((share->mapped_file ==(caddr_t)-1))
+ if ((share->mapped_file == MAP_FAILED))
{
/*
Bad idea you think? See the problem is that nothing actually checks
@@ -331,7 +330,7 @@
records_is_known(0)
{
/* Set our original buffers from pre-allocated memory */
- buffer.set(byte_buffer, IO_SIZE, system_charset_info);
+ buffer.set((char*)byte_buffer, IO_SIZE, system_charset_info);
chain= chain_buffer;
}
@@ -688,7 +687,8 @@
size= encode_quote(buf);
- if (my_write(share->data_file, buffer.ptr(), size, MYF(MY_WME | MY_NABP)))
+ if (my_write(share->data_file, (byte*)buffer.ptr(), size,
+ MYF(MY_WME | MY_NABP)))
DBUG_RETURN(-1);
/*
@@ -740,7 +740,8 @@
if (chain_append())
DBUG_RETURN(-1);
- if (my_write(share->data_file, buffer.ptr(), size, MYF(MY_WME | MY_NABP)))
+ if (my_write(share->data_file, (byte*)buffer.ptr(), size,
+ MYF(MY_WME | MY_NABP)))
DBUG_RETURN(-1);
/* UPDATE should never happen on the log tables */
@@ -934,7 +935,7 @@
if ((chain_ptr - chain) > 0)
{
tina_set *ptr;
- off_t length;
+ size_t length;
/*
Setting up writable map, this will contain all of the data after the
@@ -958,15 +959,16 @@
length= length - (size_t)(ptr->end - ptr->begin);
}
- /* Truncate the file to the new size */
- if (my_chsize(share->data_file, length, 0, MYF(MY_WME)))
+ /* Unmap the file before the new size is set */
+ if (my_munmap(share->mapped_file, share->file_stat.st_size))
DBUG_RETURN(-1);
+ /* We set it to null so that get_mmap() won't try to unmap it */
+ share->mapped_file= NULL;
- if (my_munmap(share->mapped_file, length))
+ /* Set the file to the new size */
+ if (my_chsize(share->data_file, length, 0, MYF(MY_WME)))
DBUG_RETURN(-1);
- /* We set it to null so that get_mmap() won't try to unmap it */
- share->mapped_file= NULL;
if (get_mmap(share, 0) > 0)
DBUG_RETURN(-1);
}
@@ -986,6 +988,13 @@
if (!records_is_known)
return (my_errno=HA_ERR_WRONG_COMMAND);
+ /* Unmap the file before the new size is set */
+ if (share->mapped_file && my_munmap(share->mapped_file,
+ share->file_stat.st_size))
+ DBUG_RETURN(-1);
+ share->mapped_file= NULL;
+
+ /* Truncate the file to zero size */
int rc= my_chsize(share->data_file, 0, 0, MYF(MY_WME));
if (get_mmap(share, 0) > 0)
--- 1.14/storage/csv/ha_tina.h 2006-02-08 07:42:52 +01:00
+++ 1.15/storage/csv/ha_tina.h 2006-03-21 15:30:46 +01:00
@@ -41,9 +41,9 @@
THR_LOCK lock;
} TINA_SHARE;
-typedef struct tina_set {
- off_t begin;
- off_t end;
+struct tina_set {
+ off_t begin;
+ off_t end;
};
class ha_tina: public handler
--- 1.11/sql/cmakelists.txt 2006-03-16 14:55:50 +01:00
+++ 1.12/sql/cmakelists.txt 2006-03-21 15:30:46 +01:00
@@ -18,7 +18,7 @@
${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
${PROJECT_SOURCE_DIR}/include/sql_state.h PROPERTIES GENERATED 1)
-ADD_DEFINITIONS(-DWITH_INNOBASE_STORAGE_ENGINE -DHAVE_ARCHIVE_DB -DHAVE_BLACKHOLE_DB -DHAVE_EXAMPLE_DB)
+ADD_DEFINITIONS(-DWITH_INNOBASE_STORAGE_ENGINE -DWITH_CSV_STORAGE_ENGINE -DHAVE_ARCHIVE_DB -DHAVE_BLACKHOLE_DB -DHAVE_EXAMPLE_DB)
ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DHAVE_FEDERATED_DB -DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN -DWITH_PARTITION_STORAGE_ENGINE -D_CRT_SECURE_NO_DEPRECATE)
ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover.cc ../libmysql/errmsg.c field.cc
@@ -41,6 +41,7 @@
sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc time.cc tztime.cc
uniques.cc unireg.cc item_xmlfunc.cc rpl_tblmap.cc sql_binlog.cc event_executor.cc
event_timed.cc sql_tablespace.cc event.cc ../sql-common/my_user.c partition_info.cc
+ ../storage/csv/ha_tina.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
--- 1.7/mysys/my_mmap.c 2005-06-13 12:41:07 +02:00
+++ 1.8/mysys/my_mmap.c 2006-03-21 15:30:46 +01:00
@@ -43,22 +43,19 @@
void *my_mmap(void *addr, size_t len, int prot,
int flags, int fd, my_off_t offset)
{
- DWORD flProtect=0;
HANDLE hFileMap;
LPVOID ptr;
HANDLE hFile= (HANDLE)_get_osfhandle(fd);
if (hFile == INVALID_HANDLE_VALUE)
return MAP_FAILED;
- flProtect|=SEC_COMMIT;
-
hFileMap=CreateFileMapping(hFile, &mmap_security_attributes,
PAGE_READWRITE, 0, (DWORD) len, NULL);
if (hFileMap == 0)
return MAP_FAILED;
ptr=MapViewOfFile(hFileMap,
- flags & PROT_WRITE ? FILE_MAP_WRITE : FILE_MAP_READ,
+ prot & PROT_WRITE ? FILE_MAP_WRITE : FILE_MAP_READ,
(DWORD)(offset >> 32), (DWORD)offset, len);
/*
| Thread |
|---|
| • bk commit into 5.1 tree (msvensson:1.2190) BUG#17368 | msvensson | 21 Mar |