Yuan Wang | 1 Dec 2009 16:15
Picon

Does injector handle only insert/update/delete events?

We are developing a non-transactional storage engine. The default
behavior of binlog is not suitable for this engine because it will
cache all events to the end of the statement, however my engine
release row locks early. So we should use the injector interface to
write our own binlogs, as Mats suggested.

We have looked the injector interface. It seems that this interface
handles only row insert/update/delete operations? Is that right? Are
all binlogs of DDLs still handled by MySQL?

--

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals?unsub=gcdmd-internals <at> m.gmane.org

Sergei Golubchik | 1 Dec 2009 16:31
Picon
Favicon

Re: [Help] build MySQL 5.1.41 by VC++ on windows

Hi, yishion!

On Nov 26, yishion wrote:
> Hi,
>     
>     I tried to build mysql on windows.
>     I followed the documentations at "5.1 Building MySQL from Source
>     Using CMake and Visual Studio".
> 
>     After I build the source code by VC2005 or VC2008, there's no
>     client_debug or client_release directory in my work directory.
> 
>     I don't know what's wrong.

The manual.
Where the executables are depends on the configuration that you've
built, for example they can be in

  client/debug/*.exe
  sql/debug/*.exe
  ...

or just search for *.* in your work directory, if unsure.

Regards / Mit vielen Grüßen,
Sergei

--

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg <at> sun.com>
(Continue reading)

yishion | 1 Dec 2009 17:59
Picon
Favicon

Re: [Help] build MySQL 5.1.41 by VC++ on windows

Hi,

    Thank you for your help.
    
    I build the executables of release, and gather them to c:\mysql\bin.
    When I tried to strat the server, the error message occurred as following.
----------
    C:\mysql>C:\mysql\bin\mysqld.exe --console
    C:\mysql\bin\mysqld.exe: Table 'mysql.plugin' doesn't exist
    091202  0:45:52 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to cre
    ate it.
    091202  0:45:52 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.ho
    st' doesn't exist
----------    
    
    I don't know what's wrong.

yishion

----- 原始信件 ----
寄件者: Sergei Golubchik <serg <at> mysql.com>
收件者: yishion <sdera.tw <at> yahoo.com.tw>
副 本: internals <at> lists.mysql.com
寄件日期: 2009/12/1 (二) 11:31:49 PM
主 旨: Re: [Help] build MySQL 5.1.41 by VC++ on windows

Hi, yishion!

On Nov 26, yishion wrote:
> Hi,
(Continue reading)

Sergei Golubchik | 1 Dec 2009 19:13
Picon
Favicon

Re: [Help] build MySQL 5.1.41 by VC++ on windows

Hi, yishion!

On Dec 02, yishion wrote:
> Hi,
> 
>     Thank you for your help.
>     
>     I build the executables of release, and gather them to c:\mysql\bin.
>     When I tried to strat the server, the error message occurred as following.
> ----------
>     C:\mysql>C:\mysql\bin\mysqld.exe --console
>     C:\mysql\bin\mysqld.exe: Table 'mysql.plugin' doesn't exist
>     091202  0:45:52 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to cre
>     ate it.
>     091202  0:45:52 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.ho
>     st' doesn't exist
> ----------    
>     
>     I don't know what's wrong.

You need to create system tables.
I mainly use linux, so I'm not quite sure how to do that on windows, but
try this:

   mysqld --console --bootstrap --skip-grant-tables <mysql_system_tables.sql
   mysqld --console --bootstrap --skip-grant-tables <mysql_system_tables_data.sql

and optionally

   mysqld --console --bootstrap --skip-grant-tables <fill_help_tables.sql
(Continue reading)

Timothy P Clark | 1 Dec 2009 23:14
Picon
Favicon

Bad example in example storage engine

I've found what I believe to be a problem with the example storage engine. 
The problem also exists in the InnoDB and CSV storage engines. Strictly 
speaking, I can't call it a bug, since I don't think that any adverse 
behavior is generated for these cases. However, it does adversely affect 
our storage engine, which long ago used the example storage engine as its 
inspiration. Consequently, I would suggest that the example storage engine 
be fixed to prevent future storage engines from making a similar mistake.

The problem is this: in the storage engine initialization function 
(example_init_func), the example_open_tables hash table is initialized to 
use the system_charset_info character set. This hash table is used to 
track information on a table-wide basis that is shared among handlers 
belonging to that table. However, because system_charset_info uses the 
utf8_general_ci collation, table names that differ only in letter case 
(e.g. ABC and abc) will hash to the same share. When our storage engine 
has two such tables open at the same time, odd behavior occurs because of 
this collision. I suspect that the appropriate solution is to use 
my_charset_bin instead of system_charset_info, as the federated engine 
does.

Thank you,
Tim Clark

--

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals?unsub=gcdmd-internals <at> m.gmane.org

Sergei Golubchik | 2 Dec 2009 10:31
Picon
Favicon

Re: Bad example in example storage engine

Hi, Timothy!

Thanks.
I've submitted it as http://bugs.mysql.com/49329

Note that

1. there is a user visible incorrect behavior, so it's clearly a bug.

2. my_charset_bin is probably also incorrect, it'll result in a wrong
   behavior when lower_case_table_names is enabled, table_alias_charset
   is the one to use.

3. the recommended solution is to remove the hash completely and use
   TABLE_SHARE::ha_data - it was added in 5.1 precisely for this
   purpose, so that engines wouldn't need to maintain the mapping from
   table names to shares, MySQL already does it anyway, the engine can
   simply use it - remove the hash, the mutex to guard it, and simply
   store the pointer in the TABLE_SHARE::ha_data, if possible.

On Dec 01, Timothy P Clark wrote:
> I've found what I believe to be a problem with the example storage engine. 
> The problem also exists in the InnoDB and CSV storage engines. Strictly 
> speaking, I can't call it a bug, since I don't think that any adverse 
> behavior is generated for these cases. However, it does adversely affect 
> our storage engine, which long ago used the example storage engine as its 
> inspiration. Consequently, I would suggest that the example storage engine 
> be fixed to prevent future storage engines from making a similar mistake.
> 
> The problem is this: in the storage engine initialization function 
(Continue reading)

Mats Kindahl | 2 Dec 2009 15:43
Picon

Re: Does injector handle only insert/update/delete events?

Hi Yuan,

Yes, that is correct. The DDL is still handled by MySQL server itself, the
injector only handles the row data.

Just my few cents,
Mats Kindahl

Yuan Wang wrote:
> We are developing a non-transactional storage engine. The default
> behavior of binlog is not suitable for this engine because it will
> cache all events to the end of the statement, however my engine
> release row locks early. So we should use the injector interface to
> write our own binlogs, as Mats suggested.
> 
> We have looked the injector interface. It seems that this interface
> handles only row insert/update/delete operations? Is that right? Are
> all binlogs of DDLs still handled by MySQL?
> 

-- 
Mats Kindahl
Senior Software Engineer
Database Technology Group
Sun Microsystems

--

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals?unsub=gcdmd-internals <at> m.gmane.org
(Continue reading)

yishion | 2 Dec 2009 16:29
Picon
Favicon

Re: [Help] build MySQL 5.1.41 by VC++ on windows

Hi,

    After I tried it, and it showed the following.

    ----------
    C:\>C:\mysql\bin\mysqld.exe --console --bootstrap --skip-grant-tables < C:\mysql\scripts\m
    ysql_system_tables.sql
    ERROR: 1046  No database selected
    091202 23:23:23 [ERROR] Aborting
    091202 23:23:23 [Note] C:\mysql\bin\mysqld.exe: Shutdown complete
    
    C:\>C:\mysql\bin\mysqld.exe --console --bootstrap --skip-grant-tables < C:\mysql\scripts\m
    ysql_system_tables_data.sql
    ERROR: 1046  No database selected
    091202 23:23:50 [ERROR] Aborting
    091202 23:23:50 [Note] C:\mysql\bin\mysqld.exe: Shutdown complete
    
    C:\>C:\mysql\bin\mysqld.exe --console --bootstrap --skip-grant-tables < C:\mysql\scripts\f
    ill_help_tables.sql
    ERROR: 1046  No database selected
    091202 23:24:57 [ERROR] Aborting
    091202 23:24:57 [Note] C:\mysql\bin\mysqld.exe: Shutdown complete
    ----------

yishion

___________________________________________________ 
 您的生活即時通 - 溝通、娛樂、生活、工作一次搞定! 
 http://messenger.yahoo.com.tw/

(Continue reading)

Vladislav Vaintroub | 2 Dec 2009 18:02
Picon

RE: [Help] build MySQL 5.1.41 by VC++ on windows


> -----Original Message-----
> From: yishion [mailto:sdera.tw <at> yahoo.com.tw]
> Sent: Wednesday, December 02, 2009 4:30 PM
> To: Sergei Golubchik
> Cc: internals <at> lists.mysql.com
> Subject: Re: [Help] build MySQL 5.1.41 by VC++ on windows
> 
> Hi,
> 
>     After I tried it, and it showed the following.
<skip> 

<yishion

Hello, 

Batch script below creates a database in  subdirectory "data" of the current directory. It assumes that 
mysqld.exe is in .\bin, and SQL scripts  are in .\share, if it is not the case for you, you'd need to adjust the
paths appropriately.

mkdir data\mysql
mkdir data\test
echo use mysql; > bootstrap.sql
type share\mysql_system_tables.sql >> bootstrap.sql
type share\mysql_system_tables_data.sql >> bootstrap.sql
type share\fill_help_tables.sql >> bootstrap.sql
bin\mysqld --no-defaults --console --datadir=%CD%/data --bootstrap < bootstrap.sql

Vladislav
(Continue reading)

Timothy P Clark | 2 Dec 2009 20:40
Picon
Favicon

Re: Bad example in example storage engine

Thanks, Sergei.

Unfortunately, the ha_data solution has its own problems with partitioned 
tables--for our storage engine at least. Because there is only one 
TABLE_SHARE for all partitions, any information that needs to be shared 
among all handlers attached to a particular partition (but segregated from 
handlers of other partitions) still has to use the mangled partition file 
name ("blah#P#p1") to differentiate. I suppose we could build an array of 
STORAGE_ENGINE_SHAREs into ha_data on the basis of the partition 
information known to the storage engine. However, we would like our engine 
to be as ignorant of the partitioning scheme as possible (and comments in 
table.h lead me to believe this is also the intended direction for the 
storage engine architecture.) Is there some better way to handle the 
partitioning case?

Tim Clark

Sergei Golubchik <serg <at> mysql.com> wrote on 12/02/2009 03:31:23 AM:

> Re: Bad example in example storage engine
> Sergei Golubchik 
> to:
> Timothy P Clark
> 12/02/2009 03:34 AM
> Cc:
> internals
> 
> Hi, Timothy!
> 
> Thanks.
(Continue reading)


Gmane