developers
Threads by month
- ----- 2025 -----
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 2 participants
- 6828 discussions
![](https://secure.gravatar.com/avatar/b38aed4ff9d39949c1acd04e43a0c640.jpg?s=120&d=mm&r=g)
[Maria-developers] Updated (by Knielsen): Store in binlog text of statements that caused RBR events (47)
by worklog-noreply@askmonty.org 23 Apr '10
by worklog-noreply@askmonty.org 23 Apr '10
23 Apr '10
-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: Store in binlog text of statements that caused RBR events
CREATION DATE..: Sat, 15 Aug 2009, 23:48
SUPERVISOR.....: Monty
IMPLEMENTOR....:
COPIES TO......: Knielsen, Serg
CATEGORY.......: Server-Sprint
TASK ID........: 47 (http://askmonty.org/worklog/?tid=47)
VERSION........: Server-9.x
STATUS.........: Code-Review
PRIORITY.......: 60
WORKED HOURS...: 47
ESTIMATE.......: 8 (hours remain)
ORIG. ESTIMATE.: 35
PROGRESS NOTES:
-=-=(Knielsen - Fri, 23 Apr 2010, 12:51)=-=-
Status updated.
--- /tmp/wklog.47.old.28747 2010-04-23 12:51:36.000000000 +0000
+++ /tmp/wklog.47.new.28747 2010-04-23 12:51:36.000000000 +0000
@@ -1 +1 @@
-In-Progress
+Code-Review
-=-=(Knielsen - Tue, 06 Apr 2010, 15:26)=-=-
Code review (mailed to maria-developers@).
Worked 7 hours and estimate 8 hours remain (original estimate unchanged).
-=-=(Knielsen - Tue, 06 Apr 2010, 15:25)=-=-
Status updated.
--- /tmp/wklog.47.old.12734 2010-04-06 15:25:54.000000000 +0000
+++ /tmp/wklog.47.new.12734 2010-04-06 15:25:54.000000000 +0000
@@ -1 +1 @@
-Code-Review
+In-Progress
-=-=(Knielsen - Mon, 29 Mar 2010, 10:59)=-=-
Status updated.
--- /tmp/wklog.47.old.27790 2010-03-29 10:59:53.000000000 +0000
+++ /tmp/wklog.47.new.27790 2010-03-29 10:59:53.000000000 +0000
@@ -1 +1 @@
-In-Progress
+Code-Review
-=-=(Alexi - Thu, 18 Feb 2010, 19:29)=-=-
Worked 20 hours (alexi)
Worked 20 hours and estimate 15 hours remain (original estimate unchanged).
-=-=(Serg - Fri, 05 Feb 2010, 14:04)=-=-
Observers changed: Knielsen,Serg
-=-=(Guest - Fri, 05 Feb 2010, 13:40)=-=-
Category updated.
--- /tmp/wklog.47.old.9197 2010-02-05 13:40:36.000000000 +0200
+++ /tmp/wklog.47.new.9197 2010-02-05 13:40:36.000000000 +0200
@@ -1 +1 @@
-Server-RawIdeaBin
+Server-Sprint
-=-=(Guest - Fri, 05 Feb 2010, 13:40)=-=-
Status updated.
--- /tmp/wklog.47.old.9197 2010-02-05 13:40:36.000000000 +0200
+++ /tmp/wklog.47.new.9197 2010-02-05 13:40:36.000000000 +0200
@@ -1 +1 @@
-Un-Assigned
+In-Progress
-=-=(Alexi - Thu, 04 Feb 2010, 09:54)=-=-
Low Level Design modified.
--- /tmp/wklog.47.old.16174 2010-02-04 09:54:13.000000000 +0200
+++ /tmp/wklog.47.new.16174 2010-02-04 09:54:13.000000000 +0200
@@ -171,35 +171,20 @@
5. How slave IO thread requests Annotate_rows events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-When requesting an event, the slave should inform the master whether
-it should send Annotate_rows events or not. To that end we add a new
-BINLOG_SEND_ANNOTATE_ROWS_EVENT flag used when requesting an event:
+If the replicate-annotate-rows-events option is not set on a slave, there
+is no need for master to send Annotate_rows events to this slave. The slave
+(or mysqlbinlog in remote case), before requesting binlog dump via the
+COM_BINLOG_DUMP command, informs the master whether it should send these
+events by executing the newly added COM_BINLOG_DUMP_OPTIONS_EXT server
+command:
+
+ case COM_BINLOG_DUMP_OPTIONS_EXT:
+ thd->binlog_dump_flags_ext= packet[0];
+ my_ok(thd);
+ break;
- #define BINLOG_DUMP_NON_BLOCK 1
- #define BINLOG_SEND_ANNOTATE_ROWS_EVENT 2
-
- pthread_handler_t handle_slave_io(void *arg)
- { ...
- request_dump(mysql, ...);
- ...
- }
-
- int request_dump(MYSQL* mysql, ...)
- { ...
- if (opt_log_slave_updates &&
- mi->io_thd->variables.binlog_annotate_rows_events)
- binlog_flags|= BINLOG_SEND_ANNOTATE_ROWS_EVENT;
- ...
- int2store(buf + 4, binlog_flags);
- ...
- simple_command(mysql, COM_BINLOG_DUMP, buf, ...);
- ...
- }
-
-NOTE. mysqlbinlog, when remotely requesting BINLOG_DUMP by calling the
-simple_command() function, should also use this flag if it wants (in case
-of the --print-annotate-rows-events option set) to recieve Annotate_rows
-events.
+Note. We add this new command and don't use COM_BINLOG_DUMP to avoid possible
+conflicts with MySQL/Sun.
6. How master executes the request
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -338,10 +323,4 @@
to internals(a)lists.mysql.com about this and suggesting to reserve the
event number.
-Also we should notice the introduction of the BINLOG_SEND_ANNOTATE_ROWS_EVENT
-flag taking into account that MySQL/Sun may also introduce a flag with the
-same value to be used in the request_dump-mysql_binlog_send interface.
-But this is mainly the question of merging: if a conflict concerning this
-flag occur, we may simply change the BINLOG_SEND_ANNOTATE_ROWS_EVENT value
-(this does not require additional changes in the code).
-=-=(Alexi - Sun, 20 Dec 2009, 16:00)=-=-
Low Level Design modified.
--- /tmp/wklog.47.old.19667 2009-12-20 14:00:56.000000000 +0000
+++ /tmp/wklog.47.new.19667 2009-12-20 14:00:56.000000000 +0000
@@ -196,6 +196,11 @@
...
}
+NOTE. mysqlbinlog, when remotely requesting BINLOG_DUMP by calling the
+simple_command() function, should also use this flag if it wants (in case
+of the --print-annotate-rows-events option set) to recieve Annotate_rows
+events.
+
6. How master executes the request
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -212,8 +217,7 @@
Log_event::read_log_event(&log, packet, ...);
...
if ((*packet)[EVENT_TYPE_OFFSET + 1] != ANNOTATE_ROWS_EVENT ||
- flags & BINLOG_SEND_ANNOTATE_ROWS_EVENT ||
- thd->server_id == 0 /* slave == mysqlbinlog */ )
+ flags & BINLOG_SEND_ANNOTATE_ROWS_EVENT)
{
my_net_write(net, packet->ptr(), packet->length());
}
------------------------------------------------------------
-=-=(View All Progress Notes, 28 total)=-=-
http://askmonty.org/worklog/index.pl?tid=47&nolimit=1
DESCRIPTION:
Store in binlog (and show in mysqlbinlog output) texts of statements that
caused RBR events
This is needed for (list from Monty):
- Easier to understand why updates happened
- Would make it easier to find out where in application things went
wrong (as you can search for exact strings)
- Allow one to filter things based on comments in the statement.
The cost of this can be that the binlog will be approximately 2x in size
(especially insert of big blob's would be a bit painful), so this should
be an optional feature.
HIGH-LEVEL SPECIFICATION:
Content
~~~~~~~
1. Annotate_rows_log_event
2. Server option: --binlog-annotate-rows-events
3. Server option: --replicate-annotate-rows-events
4. mysqlbinlog option: --print-annotate-rows-events
5. mysqlbinlog output
1. Annotate_rows_log_event [ ANNOTATE_ROWS_EVENT ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Describes the query which caused the corresponding rows events. Has empty
post-header and contains the query text in its data part. Example:
************************
ANNOTATE_ROWS_EVENT
************************
00000220 | B6 A0 2C 4B | time_when = 1261215926
00000224 | 33 | event_type = 51
00000225 | 64 00 00 00 | server_id = 100
00000229 | 36 00 00 00 | event_len = 54
0000022D | 56 02 00 00 | log_pos = 00000256
00000231 | 00 00 | flags = <none>
------------------------
00000233 | 49 4E 53 45 | query = "INSERT INTO t1 VALUES (1), (2), (3)"
00000237 | 52 54 20 49 |
0000023B | 4E 54 4F 20 |
0000023F | 74 31 20 56 |
00000243 | 41 4C 55 45 |
00000247 | 53 20 28 31 |
0000024B | 29 2C 20 28 |
0000024F | 32 29 2C 20 |
00000253 | 28 33 29 |
************************
In binary log, Annotate_rows event follows the (possible) 'BEGIN' Query event
and precedes the first of Table map events which accompany the corresponding
rows events. (See example in the "mysqlbinlog output" section below.)
2. Server option: --binlog-annotate-rows-events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tells the master to write Annotate_rows events to the binary log.
* Variable Name: binlog_annotate_rows_events
* Scope: Global & Session
* Access Type: Dynamic
* Data Type: bool
* Default Value: OFF
NOTE. Session values allows to annotate only some selected statements:
...
SET SESSION binlog_annotate_rows_events=ON;
... statements to be annotated ...
SET SESSION binlog_annotate_rows_events=OFF;
... statements not to be annotated ...
3. Server option: --replicate-annotate-rows-events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tells the slave to reproduce Annotate_rows events recieved from the master
in its own binary log (sensible only in pair with log-slave-updates option).
* Variable Name: replicate_annotate_rows_events
* Scope: Global
* Access Type: Read only
* Data Type: bool
* Default Value: OFF
NOTE. Why do we additionally need this 'replicate' option? Why not to make
the slave to reproduce this events when its binlog-annotate-rows-events
global value is ON? Well, because, for example, we may want to configure
the slave which should reproduce Annotate_rows events but has global
binlog-annotate-rows-events = OFF meaning this to be the default value for
the client threads (see also "How slave treats replicate-annotate-rows-events
option" in LLD part).
4. mysqlbinlog option: --print-annotate-rows-events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With this option, mysqlbinlog prints the content of Annotate_rows events (if
the binary log does contain them). Without this option (i.e. by default),
mysqlbinlog skips Annotate_rows events.
5. mysqlbinlog output
~~~~~~~~~~~~~~~~~~~~~
With --print-annotate-rows-events, mysqlbinlog outputs Annotate_rows events
in a form like this:
...
# at 1646
#091219 12:45:26 server id 100 end_log_pos 1714 Query thread_id=1
exec_time=0 error_code=0
SET TIMESTAMP=1261215926/*!*/;
BEGIN
/*!*/;
# at 1714
# at 1812
# at 1853
# at 1894
# at 1938
#091219 12:45:26 server id 100 end_log_pos 1812 Query: `DELETE t1, t2 FROM
t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.a=t2.a AND t2.a=t3.a`
#091219 12:45:26 server id 100 end_log_pos 1853 Table_map: `test`.`t1`
mapped to number 16
#091219 12:45:26 server id 100 end_log_pos 1894 Table_map: `test`.`t2`
mapped to number 17
#091219 12:45:26 server id 100 end_log_pos 1938 Delete_rows: table id 16
#091219 12:45:26 server id 100 end_log_pos 1982 Delete_rows: table id 17
flags: STMT_END_F
...
LOW-LEVEL DESIGN:
Content
~~~~~~~
1. Annotate_rows event number
2. Outline of Annotate_rows event behavior
3. How Master writes Annotate_rows events to the binary log
4. How slave treats replicate-annotate-rows-events option
5. How slave IO thread requests Annotate_rows events
6. How master executes the request
7. How slave SQL thread processes Annotate_rows events
8. General remarks
1. Annotate_rows event number
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To avoid possible event numbers conflict with MySQL/Sun, we leave a gap
between the last MySQL event number and the Annotate_rows event number:
enum Log_event_type
{ ...
INCIDENT_EVENT= 26,
// New MySQL event numbers are to be added here
MYSQL_EVENTS_END,
MARIA_EVENTS_BEGIN= 51,
// New Maria event numbers start from here
ANNOTATE_ROWS_EVENT= 51,
ENUM_END_EVENT
};
together with the corresponding extension of 'post_header_len' array in the
Format description event. (This extension does not affect the compatibility
of the binary log). Here is how Format description event looks like with
this extension:
************************
FORMAT_DESCRIPTION_EVENT
************************
00000004 | A1 A0 2C 4B | time_when = 1261215905
00000008 | 0F | event_type = 15
00000009 | 64 00 00 00 | server_id = 100
0000000D | 7F 00 00 00 | event_len = 127
00000011 | 83 00 00 00 | log_pos = 00000083
00000015 | 01 00 | flags = LOG_EVENT_BINLOG_IN_USE_F
------------------------
00000017 | 04 00 | binlog_ver = 4
00000019 | 35 2E 32 2E | server_ver = 5.2.0-MariaDB-alpha-debug-log
..... ...
0000004B | A1 A0 2C 4B | time_created = 1261215905
0000004F | 13 | common_header_len = 19
------------------------
post_header_len
------------------------
00000050 | 38 | 56 - START_EVENT_V3 [1]
..... ...
00000069 | 02 | 2 - INCIDENT_EVENT [26]
0000006A | 00 | 0 - RESERVED [27]
..... ...
00000081 | 00 | 0 - RESERVED [50]
00000082 | 00 | 0 - ANNOTATE_ROWS_EVENT [51]
************************
2. Outline of Annotate_rows event behavior
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Each Annotate_rows_log_event object has two private members describing the
corresponding query:
char *m_query_txt;
uint m_query_len;
When the object is created for writing to a binary log, this query is taken
from 'thd' (for short, below we omit the 'Annotate_rows_log_event::' prefix
as well as other implementation details):
Annotate_rows_log_event(THD *thd)
{
m_query_txt = thd->query();
m_query_len = thd->query_length();
}
When the object is read from a binary log, the query is taken from the buffer
containing the binary log representation of the event (this buffer is allocated
in Log_event object from which all Log events are derived):
Annotate_rows_log_event(char *buf, uint event_len,
Format_description_log_event *desc)
{
m_query_len = event_len - desc->common_header_len;
m_query_txt = buf + desc->common_header_len;
}
The events are written to the binary log by the Log_event::write() member
which calls virtual write_data_header() and write_data_body() members
("data header" and "post header" are synonym in replication terminology).
In our case, data header is empty and data body is just the query:
bool write_data_body(IO_CACHE *file)
{
return my_b_safe_write(file, (uchar*) m_query_txt, m_query_len);
}
Printing the event is just printing the query:
void Annotate_rows_log_event::print(FILE *file, PRINT_EVENT_INFO *pinfo)
{
my_b_printf(&pinfo->head_cache, "\tQuery: `%s`\n", m_query_txt);
}
3. How Master writes Annotate_rows events to the binary log
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The event is written to the binary log just before the group of Table_map
events which precede corresponding Rows events (one query may generate
several Table map events in the binary log, but the corresponding
Annotate_rows event must be written only once before the first Table map
event; hence the boolean variable 'with_annotate' below):
int write_locked_table_maps(THD *thd)
{ ...
bool with_annotate= thd->variables.binlog_annotate_rows_events;
...
for (uint i= 0; i < ... <number of tables> ...; ++i)
{ ...
thd->binlog_write_table_map(table, ..., with_annotate);
with_annotate= 0; // write Annotate_event not more than once
...
}
...
}
int THD::binlog_write_table_map(TABLE *table, ..., bool with_annotate)
{ ...
Table_map_log_event the_event(...);
...
if (with_annotate)
{
Annotate_rows_log_event anno(this);
mysql_bin_log.write(&anno);
}
mysql_bin_log.write(&the_event);
...
}
4. How slave treats replicate-annotate-rows-events option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The replicate-annotate-rows-events option is treated just as the session
value of the binlog_annotate_rows_events variable for the slave IO and
SQL threads. This setting is done during initialization of these threads:
pthread_handler_t handle_slave_io(void *arg)
{
THD *thd= new THD;
...
init_slave_thread(thd, SLAVE_THD_IO);
...
}
pthread_handler_t handle_slave_sql(void *arg)
{
THD *thd= new THD;
...
init_slave_thread(thd, SLAVE_THD_SQL);
...
}
int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
{ ...
thd->variables.binlog_annotate_rows_events=
opt_replicate_annotate_rows_events;
...
}
5. How slave IO thread requests Annotate_rows events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the replicate-annotate-rows-events option is not set on a slave, there
is no need for master to send Annotate_rows events to this slave. The slave
(or mysqlbinlog in remote case), before requesting binlog dump via the
COM_BINLOG_DUMP command, informs the master whether it should send these
events by executing the newly added COM_BINLOG_DUMP_OPTIONS_EXT server
command:
case COM_BINLOG_DUMP_OPTIONS_EXT:
thd->binlog_dump_flags_ext= packet[0];
my_ok(thd);
break;
Note. We add this new command and don't use COM_BINLOG_DUMP to avoid possible
conflicts with MySQL/Sun.
6. How master executes the request
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
case COM_BINLOG_DUMP:
{ ...
flags= uint2korr(packet + 4);
...
mysql_binlog_send(thd, ..., flags);
...
}
void mysql_binlog_send(THD* thd, ..., ushort flags)
{ ...
Log_event::read_log_event(&log, packet, ...);
...
if ((*packet)[EVENT_TYPE_OFFSET + 1] != ANNOTATE_ROWS_EVENT ||
flags & BINLOG_SEND_ANNOTATE_ROWS_EVENT)
{
my_net_write(net, packet->ptr(), packet->length());
}
...
}
7. How slave SQL thread processes Annotate_rows events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The slave processes each recieved event by "applying" it, i.e. by
calling the Log_event::apply_event() function which in turn calls
the virtual do_apply_event() member specific for each type of the
event.
int exec_relay_log_event(THD* thd, Relay_log_info* rli)
{ ...
Log_event *ev = next_event(rli);
...
apply_event_and_update_pos(ev, ...);
if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
delete ev;
...
}
int apply_event_and_update_pos(Log_event *ev, ...)
{ ...
ev->apply_event(...);
...
}
int Log_event::apply_event(...)
{
return do_apply_event(...);
}
What does it mean to "apply" an Annotate_rows event? It means to set current
thd query to that of the described by the event, i.e. to the query which
caused the subsequent Rows events (see "How Master writes Annotate_rows
events to the binary log" to follow what happens further when the subsequent
Rows events are applied):
int Annotate_rows_log_event::do_apply_event(...)
{
thd->set_query(m_query_txt, m_query_len);
}
NOTE. I am not sure, but possibly current values of thd->query and
thd->query_length should be saved before calling set_query() and to be
restored on the Annotate_rows_log_event object deletion.
Is it really needed ?
After calling this do_apply_event() function we may not delete the
Annotate_rows_log_event object immediatedly (see exec_relay_log_event()
above) because thd->query now points to the string inside this object.
We may keep the pointer to this object in the Relay_log_info:
class Relay_log_info
{
public:
...
void set_annotate_event(Annotate_rows_log_event*);
Annotate_rows_log_event* get_annotate_event();
void free_annotate_event();
...
private:
Annotate_rows_log_event* m_annotate_event;
};
The saved Annotate_rows object should be deleted when all corresponding
Rows events will be processed:
int exec_relay_log_event(THD* thd, Relay_log_info* rli)
{ ...
Log_event *ev= next_event(rli);
...
apply_event_and_update_pos(ev, ...);
if (rli->get_annotate_event() && is_last_rows_event(ev))
rli->free_annotate_event();
else if (ev->get_type_code() == ANNOTATE_ROWS_EVENT)
rli->set_annotate_event((Annotate_rows_log_event*) ev);
else if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
delete ev;
...
}
where
bool is_last_rows_event(Log_event* ev)
{
Log_event_type type= ev->get_type_code();
if (IS_ROWS_EVENT_TYPE(type))
{
Rows_log_event* rows= (Rows_log_event*)ev;
return rows->get_flags(Rows_log_event::STMT_END_F);
}
return 0;
}
#define IS_ROWS_EVENT_TYPE(type) ((type) == WRITE_ROWS_EVENT || \
(type) == UPDATE_ROWS_EVENT || \
(type) == DELETE_ROWS_EVENT)
8. General remarks
~~~~~~~~~~~~~~~~~~
Kristian noticed that introducing new log event type should be coordinated
somehow with MySQL/Sun:
Kristian: The numeric code for this event must be assigned carefully.
It should be coordinated with MySQL/Sun, otherwise we can get into a
situation where MySQL uses the same numeric code for one event that
MariaDB uses for ANNOTATE_ROWS_EVENT, which would make merging the two
impossible.
Alex: I reserved about 20 numbers not to have possible conflicts
with MySQL.
Kristian: Still, I think it would be appropriate to send a polite email
to internals(a)lists.mysql.com about this and suggesting to reserve the
event number.
ESTIMATED WORK TIME
ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)
1
0
![](https://secure.gravatar.com/avatar/b38aed4ff9d39949c1acd04e43a0c640.jpg?s=120&d=mm&r=g)
[Maria-developers] Updated (by Knielsen): Store in binlog text of statements that caused RBR events (47)
by worklog-noreply@askmonty.org 23 Apr '10
by worklog-noreply@askmonty.org 23 Apr '10
23 Apr '10
-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: Store in binlog text of statements that caused RBR events
CREATION DATE..: Sat, 15 Aug 2009, 23:48
SUPERVISOR.....: Monty
IMPLEMENTOR....:
COPIES TO......: Knielsen, Serg
CATEGORY.......: Server-Sprint
TASK ID........: 47 (http://askmonty.org/worklog/?tid=47)
VERSION........: Server-9.x
STATUS.........: Code-Review
PRIORITY.......: 60
WORKED HOURS...: 47
ESTIMATE.......: 8 (hours remain)
ORIG. ESTIMATE.: 35
PROGRESS NOTES:
-=-=(Knielsen - Fri, 23 Apr 2010, 12:51)=-=-
Status updated.
--- /tmp/wklog.47.old.28747 2010-04-23 12:51:36.000000000 +0000
+++ /tmp/wklog.47.new.28747 2010-04-23 12:51:36.000000000 +0000
@@ -1 +1 @@
-In-Progress
+Code-Review
-=-=(Knielsen - Tue, 06 Apr 2010, 15:26)=-=-
Code review (mailed to maria-developers@).
Worked 7 hours and estimate 8 hours remain (original estimate unchanged).
-=-=(Knielsen - Tue, 06 Apr 2010, 15:25)=-=-
Status updated.
--- /tmp/wklog.47.old.12734 2010-04-06 15:25:54.000000000 +0000
+++ /tmp/wklog.47.new.12734 2010-04-06 15:25:54.000000000 +0000
@@ -1 +1 @@
-Code-Review
+In-Progress
-=-=(Knielsen - Mon, 29 Mar 2010, 10:59)=-=-
Status updated.
--- /tmp/wklog.47.old.27790 2010-03-29 10:59:53.000000000 +0000
+++ /tmp/wklog.47.new.27790 2010-03-29 10:59:53.000000000 +0000
@@ -1 +1 @@
-In-Progress
+Code-Review
-=-=(Alexi - Thu, 18 Feb 2010, 19:29)=-=-
Worked 20 hours (alexi)
Worked 20 hours and estimate 15 hours remain (original estimate unchanged).
-=-=(Serg - Fri, 05 Feb 2010, 14:04)=-=-
Observers changed: Knielsen,Serg
-=-=(Guest - Fri, 05 Feb 2010, 13:40)=-=-
Category updated.
--- /tmp/wklog.47.old.9197 2010-02-05 13:40:36.000000000 +0200
+++ /tmp/wklog.47.new.9197 2010-02-05 13:40:36.000000000 +0200
@@ -1 +1 @@
-Server-RawIdeaBin
+Server-Sprint
-=-=(Guest - Fri, 05 Feb 2010, 13:40)=-=-
Status updated.
--- /tmp/wklog.47.old.9197 2010-02-05 13:40:36.000000000 +0200
+++ /tmp/wklog.47.new.9197 2010-02-05 13:40:36.000000000 +0200
@@ -1 +1 @@
-Un-Assigned
+In-Progress
-=-=(Alexi - Thu, 04 Feb 2010, 09:54)=-=-
Low Level Design modified.
--- /tmp/wklog.47.old.16174 2010-02-04 09:54:13.000000000 +0200
+++ /tmp/wklog.47.new.16174 2010-02-04 09:54:13.000000000 +0200
@@ -171,35 +171,20 @@
5. How slave IO thread requests Annotate_rows events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-When requesting an event, the slave should inform the master whether
-it should send Annotate_rows events or not. To that end we add a new
-BINLOG_SEND_ANNOTATE_ROWS_EVENT flag used when requesting an event:
+If the replicate-annotate-rows-events option is not set on a slave, there
+is no need for master to send Annotate_rows events to this slave. The slave
+(or mysqlbinlog in remote case), before requesting binlog dump via the
+COM_BINLOG_DUMP command, informs the master whether it should send these
+events by executing the newly added COM_BINLOG_DUMP_OPTIONS_EXT server
+command:
+
+ case COM_BINLOG_DUMP_OPTIONS_EXT:
+ thd->binlog_dump_flags_ext= packet[0];
+ my_ok(thd);
+ break;
- #define BINLOG_DUMP_NON_BLOCK 1
- #define BINLOG_SEND_ANNOTATE_ROWS_EVENT 2
-
- pthread_handler_t handle_slave_io(void *arg)
- { ...
- request_dump(mysql, ...);
- ...
- }
-
- int request_dump(MYSQL* mysql, ...)
- { ...
- if (opt_log_slave_updates &&
- mi->io_thd->variables.binlog_annotate_rows_events)
- binlog_flags|= BINLOG_SEND_ANNOTATE_ROWS_EVENT;
- ...
- int2store(buf + 4, binlog_flags);
- ...
- simple_command(mysql, COM_BINLOG_DUMP, buf, ...);
- ...
- }
-
-NOTE. mysqlbinlog, when remotely requesting BINLOG_DUMP by calling the
-simple_command() function, should also use this flag if it wants (in case
-of the --print-annotate-rows-events option set) to recieve Annotate_rows
-events.
+Note. We add this new command and don't use COM_BINLOG_DUMP to avoid possible
+conflicts with MySQL/Sun.
6. How master executes the request
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -338,10 +323,4 @@
to internals(a)lists.mysql.com about this and suggesting to reserve the
event number.
-Also we should notice the introduction of the BINLOG_SEND_ANNOTATE_ROWS_EVENT
-flag taking into account that MySQL/Sun may also introduce a flag with the
-same value to be used in the request_dump-mysql_binlog_send interface.
-But this is mainly the question of merging: if a conflict concerning this
-flag occur, we may simply change the BINLOG_SEND_ANNOTATE_ROWS_EVENT value
-(this does not require additional changes in the code).
-=-=(Alexi - Sun, 20 Dec 2009, 16:00)=-=-
Low Level Design modified.
--- /tmp/wklog.47.old.19667 2009-12-20 14:00:56.000000000 +0000
+++ /tmp/wklog.47.new.19667 2009-12-20 14:00:56.000000000 +0000
@@ -196,6 +196,11 @@
...
}
+NOTE. mysqlbinlog, when remotely requesting BINLOG_DUMP by calling the
+simple_command() function, should also use this flag if it wants (in case
+of the --print-annotate-rows-events option set) to recieve Annotate_rows
+events.
+
6. How master executes the request
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -212,8 +217,7 @@
Log_event::read_log_event(&log, packet, ...);
...
if ((*packet)[EVENT_TYPE_OFFSET + 1] != ANNOTATE_ROWS_EVENT ||
- flags & BINLOG_SEND_ANNOTATE_ROWS_EVENT ||
- thd->server_id == 0 /* slave == mysqlbinlog */ )
+ flags & BINLOG_SEND_ANNOTATE_ROWS_EVENT)
{
my_net_write(net, packet->ptr(), packet->length());
}
------------------------------------------------------------
-=-=(View All Progress Notes, 28 total)=-=-
http://askmonty.org/worklog/index.pl?tid=47&nolimit=1
DESCRIPTION:
Store in binlog (and show in mysqlbinlog output) texts of statements that
caused RBR events
This is needed for (list from Monty):
- Easier to understand why updates happened
- Would make it easier to find out where in application things went
wrong (as you can search for exact strings)
- Allow one to filter things based on comments in the statement.
The cost of this can be that the binlog will be approximately 2x in size
(especially insert of big blob's would be a bit painful), so this should
be an optional feature.
HIGH-LEVEL SPECIFICATION:
Content
~~~~~~~
1. Annotate_rows_log_event
2. Server option: --binlog-annotate-rows-events
3. Server option: --replicate-annotate-rows-events
4. mysqlbinlog option: --print-annotate-rows-events
5. mysqlbinlog output
1. Annotate_rows_log_event [ ANNOTATE_ROWS_EVENT ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Describes the query which caused the corresponding rows events. Has empty
post-header and contains the query text in its data part. Example:
************************
ANNOTATE_ROWS_EVENT
************************
00000220 | B6 A0 2C 4B | time_when = 1261215926
00000224 | 33 | event_type = 51
00000225 | 64 00 00 00 | server_id = 100
00000229 | 36 00 00 00 | event_len = 54
0000022D | 56 02 00 00 | log_pos = 00000256
00000231 | 00 00 | flags = <none>
------------------------
00000233 | 49 4E 53 45 | query = "INSERT INTO t1 VALUES (1), (2), (3)"
00000237 | 52 54 20 49 |
0000023B | 4E 54 4F 20 |
0000023F | 74 31 20 56 |
00000243 | 41 4C 55 45 |
00000247 | 53 20 28 31 |
0000024B | 29 2C 20 28 |
0000024F | 32 29 2C 20 |
00000253 | 28 33 29 |
************************
In binary log, Annotate_rows event follows the (possible) 'BEGIN' Query event
and precedes the first of Table map events which accompany the corresponding
rows events. (See example in the "mysqlbinlog output" section below.)
2. Server option: --binlog-annotate-rows-events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tells the master to write Annotate_rows events to the binary log.
* Variable Name: binlog_annotate_rows_events
* Scope: Global & Session
* Access Type: Dynamic
* Data Type: bool
* Default Value: OFF
NOTE. Session values allows to annotate only some selected statements:
...
SET SESSION binlog_annotate_rows_events=ON;
... statements to be annotated ...
SET SESSION binlog_annotate_rows_events=OFF;
... statements not to be annotated ...
3. Server option: --replicate-annotate-rows-events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tells the slave to reproduce Annotate_rows events recieved from the master
in its own binary log (sensible only in pair with log-slave-updates option).
* Variable Name: replicate_annotate_rows_events
* Scope: Global
* Access Type: Read only
* Data Type: bool
* Default Value: OFF
NOTE. Why do we additionally need this 'replicate' option? Why not to make
the slave to reproduce this events when its binlog-annotate-rows-events
global value is ON? Well, because, for example, we may want to configure
the slave which should reproduce Annotate_rows events but has global
binlog-annotate-rows-events = OFF meaning this to be the default value for
the client threads (see also "How slave treats replicate-annotate-rows-events
option" in LLD part).
4. mysqlbinlog option: --print-annotate-rows-events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With this option, mysqlbinlog prints the content of Annotate_rows events (if
the binary log does contain them). Without this option (i.e. by default),
mysqlbinlog skips Annotate_rows events.
5. mysqlbinlog output
~~~~~~~~~~~~~~~~~~~~~
With --print-annotate-rows-events, mysqlbinlog outputs Annotate_rows events
in a form like this:
...
# at 1646
#091219 12:45:26 server id 100 end_log_pos 1714 Query thread_id=1
exec_time=0 error_code=0
SET TIMESTAMP=1261215926/*!*/;
BEGIN
/*!*/;
# at 1714
# at 1812
# at 1853
# at 1894
# at 1938
#091219 12:45:26 server id 100 end_log_pos 1812 Query: `DELETE t1, t2 FROM
t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.a=t2.a AND t2.a=t3.a`
#091219 12:45:26 server id 100 end_log_pos 1853 Table_map: `test`.`t1`
mapped to number 16
#091219 12:45:26 server id 100 end_log_pos 1894 Table_map: `test`.`t2`
mapped to number 17
#091219 12:45:26 server id 100 end_log_pos 1938 Delete_rows: table id 16
#091219 12:45:26 server id 100 end_log_pos 1982 Delete_rows: table id 17
flags: STMT_END_F
...
LOW-LEVEL DESIGN:
Content
~~~~~~~
1. Annotate_rows event number
2. Outline of Annotate_rows event behavior
3. How Master writes Annotate_rows events to the binary log
4. How slave treats replicate-annotate-rows-events option
5. How slave IO thread requests Annotate_rows events
6. How master executes the request
7. How slave SQL thread processes Annotate_rows events
8. General remarks
1. Annotate_rows event number
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To avoid possible event numbers conflict with MySQL/Sun, we leave a gap
between the last MySQL event number and the Annotate_rows event number:
enum Log_event_type
{ ...
INCIDENT_EVENT= 26,
// New MySQL event numbers are to be added here
MYSQL_EVENTS_END,
MARIA_EVENTS_BEGIN= 51,
// New Maria event numbers start from here
ANNOTATE_ROWS_EVENT= 51,
ENUM_END_EVENT
};
together with the corresponding extension of 'post_header_len' array in the
Format description event. (This extension does not affect the compatibility
of the binary log). Here is how Format description event looks like with
this extension:
************************
FORMAT_DESCRIPTION_EVENT
************************
00000004 | A1 A0 2C 4B | time_when = 1261215905
00000008 | 0F | event_type = 15
00000009 | 64 00 00 00 | server_id = 100
0000000D | 7F 00 00 00 | event_len = 127
00000011 | 83 00 00 00 | log_pos = 00000083
00000015 | 01 00 | flags = LOG_EVENT_BINLOG_IN_USE_F
------------------------
00000017 | 04 00 | binlog_ver = 4
00000019 | 35 2E 32 2E | server_ver = 5.2.0-MariaDB-alpha-debug-log
..... ...
0000004B | A1 A0 2C 4B | time_created = 1261215905
0000004F | 13 | common_header_len = 19
------------------------
post_header_len
------------------------
00000050 | 38 | 56 - START_EVENT_V3 [1]
..... ...
00000069 | 02 | 2 - INCIDENT_EVENT [26]
0000006A | 00 | 0 - RESERVED [27]
..... ...
00000081 | 00 | 0 - RESERVED [50]
00000082 | 00 | 0 - ANNOTATE_ROWS_EVENT [51]
************************
2. Outline of Annotate_rows event behavior
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Each Annotate_rows_log_event object has two private members describing the
corresponding query:
char *m_query_txt;
uint m_query_len;
When the object is created for writing to a binary log, this query is taken
from 'thd' (for short, below we omit the 'Annotate_rows_log_event::' prefix
as well as other implementation details):
Annotate_rows_log_event(THD *thd)
{
m_query_txt = thd->query();
m_query_len = thd->query_length();
}
When the object is read from a binary log, the query is taken from the buffer
containing the binary log representation of the event (this buffer is allocated
in Log_event object from which all Log events are derived):
Annotate_rows_log_event(char *buf, uint event_len,
Format_description_log_event *desc)
{
m_query_len = event_len - desc->common_header_len;
m_query_txt = buf + desc->common_header_len;
}
The events are written to the binary log by the Log_event::write() member
which calls virtual write_data_header() and write_data_body() members
("data header" and "post header" are synonym in replication terminology).
In our case, data header is empty and data body is just the query:
bool write_data_body(IO_CACHE *file)
{
return my_b_safe_write(file, (uchar*) m_query_txt, m_query_len);
}
Printing the event is just printing the query:
void Annotate_rows_log_event::print(FILE *file, PRINT_EVENT_INFO *pinfo)
{
my_b_printf(&pinfo->head_cache, "\tQuery: `%s`\n", m_query_txt);
}
3. How Master writes Annotate_rows events to the binary log
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The event is written to the binary log just before the group of Table_map
events which precede corresponding Rows events (one query may generate
several Table map events in the binary log, but the corresponding
Annotate_rows event must be written only once before the first Table map
event; hence the boolean variable 'with_annotate' below):
int write_locked_table_maps(THD *thd)
{ ...
bool with_annotate= thd->variables.binlog_annotate_rows_events;
...
for (uint i= 0; i < ... <number of tables> ...; ++i)
{ ...
thd->binlog_write_table_map(table, ..., with_annotate);
with_annotate= 0; // write Annotate_event not more than once
...
}
...
}
int THD::binlog_write_table_map(TABLE *table, ..., bool with_annotate)
{ ...
Table_map_log_event the_event(...);
...
if (with_annotate)
{
Annotate_rows_log_event anno(this);
mysql_bin_log.write(&anno);
}
mysql_bin_log.write(&the_event);
...
}
4. How slave treats replicate-annotate-rows-events option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The replicate-annotate-rows-events option is treated just as the session
value of the binlog_annotate_rows_events variable for the slave IO and
SQL threads. This setting is done during initialization of these threads:
pthread_handler_t handle_slave_io(void *arg)
{
THD *thd= new THD;
...
init_slave_thread(thd, SLAVE_THD_IO);
...
}
pthread_handler_t handle_slave_sql(void *arg)
{
THD *thd= new THD;
...
init_slave_thread(thd, SLAVE_THD_SQL);
...
}
int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type)
{ ...
thd->variables.binlog_annotate_rows_events=
opt_replicate_annotate_rows_events;
...
}
5. How slave IO thread requests Annotate_rows events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the replicate-annotate-rows-events option is not set on a slave, there
is no need for master to send Annotate_rows events to this slave. The slave
(or mysqlbinlog in remote case), before requesting binlog dump via the
COM_BINLOG_DUMP command, informs the master whether it should send these
events by executing the newly added COM_BINLOG_DUMP_OPTIONS_EXT server
command:
case COM_BINLOG_DUMP_OPTIONS_EXT:
thd->binlog_dump_flags_ext= packet[0];
my_ok(thd);
break;
Note. We add this new command and don't use COM_BINLOG_DUMP to avoid possible
conflicts with MySQL/Sun.
6. How master executes the request
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
case COM_BINLOG_DUMP:
{ ...
flags= uint2korr(packet + 4);
...
mysql_binlog_send(thd, ..., flags);
...
}
void mysql_binlog_send(THD* thd, ..., ushort flags)
{ ...
Log_event::read_log_event(&log, packet, ...);
...
if ((*packet)[EVENT_TYPE_OFFSET + 1] != ANNOTATE_ROWS_EVENT ||
flags & BINLOG_SEND_ANNOTATE_ROWS_EVENT)
{
my_net_write(net, packet->ptr(), packet->length());
}
...
}
7. How slave SQL thread processes Annotate_rows events
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The slave processes each recieved event by "applying" it, i.e. by
calling the Log_event::apply_event() function which in turn calls
the virtual do_apply_event() member specific for each type of the
event.
int exec_relay_log_event(THD* thd, Relay_log_info* rli)
{ ...
Log_event *ev = next_event(rli);
...
apply_event_and_update_pos(ev, ...);
if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
delete ev;
...
}
int apply_event_and_update_pos(Log_event *ev, ...)
{ ...
ev->apply_event(...);
...
}
int Log_event::apply_event(...)
{
return do_apply_event(...);
}
What does it mean to "apply" an Annotate_rows event? It means to set current
thd query to that of the described by the event, i.e. to the query which
caused the subsequent Rows events (see "How Master writes Annotate_rows
events to the binary log" to follow what happens further when the subsequent
Rows events are applied):
int Annotate_rows_log_event::do_apply_event(...)
{
thd->set_query(m_query_txt, m_query_len);
}
NOTE. I am not sure, but possibly current values of thd->query and
thd->query_length should be saved before calling set_query() and to be
restored on the Annotate_rows_log_event object deletion.
Is it really needed ?
After calling this do_apply_event() function we may not delete the
Annotate_rows_log_event object immediatedly (see exec_relay_log_event()
above) because thd->query now points to the string inside this object.
We may keep the pointer to this object in the Relay_log_info:
class Relay_log_info
{
public:
...
void set_annotate_event(Annotate_rows_log_event*);
Annotate_rows_log_event* get_annotate_event();
void free_annotate_event();
...
private:
Annotate_rows_log_event* m_annotate_event;
};
The saved Annotate_rows object should be deleted when all corresponding
Rows events will be processed:
int exec_relay_log_event(THD* thd, Relay_log_info* rli)
{ ...
Log_event *ev= next_event(rli);
...
apply_event_and_update_pos(ev, ...);
if (rli->get_annotate_event() && is_last_rows_event(ev))
rli->free_annotate_event();
else if (ev->get_type_code() == ANNOTATE_ROWS_EVENT)
rli->set_annotate_event((Annotate_rows_log_event*) ev);
else if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
delete ev;
...
}
where
bool is_last_rows_event(Log_event* ev)
{
Log_event_type type= ev->get_type_code();
if (IS_ROWS_EVENT_TYPE(type))
{
Rows_log_event* rows= (Rows_log_event*)ev;
return rows->get_flags(Rows_log_event::STMT_END_F);
}
return 0;
}
#define IS_ROWS_EVENT_TYPE(type) ((type) == WRITE_ROWS_EVENT || \
(type) == UPDATE_ROWS_EVENT || \
(type) == DELETE_ROWS_EVENT)
8. General remarks
~~~~~~~~~~~~~~~~~~
Kristian noticed that introducing new log event type should be coordinated
somehow with MySQL/Sun:
Kristian: The numeric code for this event must be assigned carefully.
It should be coordinated with MySQL/Sun, otherwise we can get into a
situation where MySQL uses the same numeric code for one event that
MariaDB uses for ANNOTATE_ROWS_EVENT, which would make merging the two
impossible.
Alex: I reserved about 20 numbers not to have possible conflicts
with MySQL.
Kristian: Still, I think it would be appropriate to send a polite email
to internals(a)lists.mysql.com about this and suggesting to reserve the
event number.
ESTIMATED WORK TIME
ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)
1
0
![](https://secure.gravatar.com/avatar/b38aed4ff9d39949c1acd04e43a0c640.jpg?s=120&d=mm&r=g)
[Maria-developers] Updated (by Serg): Add info to engine description (61)
by worklog-noreply@askmonty.org 23 Apr '10
by worklog-noreply@askmonty.org 23 Apr '10
23 Apr '10
-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: Add info to engine description
CREATION DATE..: Mon, 02 Nov 2009, 22:58
SUPERVISOR.....: Monty
IMPLEMENTOR....: Sanja
COPIES TO......:
CATEGORY.......: Server-BackLog
TASK ID........: 61 (http://askmonty.org/worklog/?tid=61)
VERSION........: Server-5.1
STATUS.........: Complete
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 5 (hours remain)
ORIG. ESTIMATE.: 5
PROGRESS NOTES:
-=-=(Serg - Fri, 23 Apr 2010, 11:02)=-=-
Status updated.
--- /tmp/wklog.61.old.24344 2010-04-23 11:02:39.000000000 +0000
+++ /tmp/wklog.61.new.24344 2010-04-23 11:02:39.000000000 +0000
@@ -1 +1 @@
-Code-Review
+Complete
-=-=(Sanja - Fri, 04 Dec 2009, 13:50)=-=-
Status updated.
--- /tmp/wklog.61.old.16175 2009-12-04 13:50:12.000000000 +0200
+++ /tmp/wklog.61.new.16175 2009-12-04 13:50:12.000000000 +0200
@@ -1 +1 @@
-Assigned
+Code-Review
-=-=(Sanja - Fri, 20 Nov 2009, 00:18)=-=-
High-Level Specification modified.
--- /tmp/wklog.61.old.19932 2009-11-20 00:18:57.000000000 +0200
+++ /tmp/wklog.61.new.19932 2009-11-20 00:18:57.000000000 +0200
@@ -1 +1,9 @@
+There is two time of engines/plugins build in and loadable. For both we add
+structure with additional information
+1) for build in we will modify MYSQL_PLUGIN_STATIC to collect that strucures in
+array also with builtin_*_plugin structures.
+
+2) for dinamic plugins we check in plugin_dl_add() if the pligin defins maria
+simbols we read info in if no then fill maturety with UNKNOWN and version with
+empty string.
-=-=(Sanja - Thu, 19 Nov 2009, 23:56)=-=-
High Level Description modified.
--- /tmp/wklog.61.old.19057 2009-11-19 23:56:48.000000000 +0200
+++ /tmp/wklog.61.new.19057 2009-11-19 23:56:48.000000000 +0200
@@ -1,8 +1,6 @@
-Add additional information about engine and show it in SHOW ENGINES:
+Add additional information about engine and show it in information schema:
-License (PROPRIETARY, GPL, BSD) (it is already present, just have to be shown)
-
-Maturity (TEST, ALPHA, BETA, GAMMA, RELEASE)
+Maturity (UNKNOWN, TEST, ALPHA, BETA, GAMMA, RELEASE)
Version (just string from engine developer like "0.99 beta", better if it will
be monotonically increasing in terms of alphabetical sort).
-=-=(Hakan - Thu, 05 Nov 2009, 21:09)=-=-
High Level Description modified.
--- /tmp/wklog.61.old.22402 2009-11-05 21:09:08.000000000 +0200
+++ /tmp/wklog.61.new.22402 2009-11-05 21:09:08.000000000 +0200
@@ -1,8 +1,8 @@
Add additional information about engine and show it in SHOW ENGINES:
-License (PROPRIETARY, GPL, BSD) (it is present just have to be shown)
+License (PROPRIETARY, GPL, BSD) (it is already present, just have to be shown)
Maturity (TEST, ALPHA, BETA, GAMMA, RELEASE)
-Version (just string from engine developer like "0.99 betta", better if it will
+Version (just string from engine developer like "0.99 beta", better if it will
be monotonically increasing in terms of alphabetical sort).
DESCRIPTION:
Add additional information about engine and show it in information schema:
Maturity (UNKNOWN, TEST, ALPHA, BETA, GAMMA, RELEASE)
Version (just string from engine developer like "0.99 beta", better if it will
be monotonically increasing in terms of alphabetical sort).
HIGH-LEVEL SPECIFICATION:
There is two time of engines/plugins build in and loadable. For both we add
structure with additional information
1) for build in we will modify MYSQL_PLUGIN_STATIC to collect that strucures in
array also with builtin_*_plugin structures.
2) for dinamic plugins we check in plugin_dl_add() if the pligin defins maria
simbols we read info in if no then fill maturety with UNKNOWN and version with
empty string.
ESTIMATED WORK TIME
ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)
1
0
![](https://secure.gravatar.com/avatar/b38aed4ff9d39949c1acd04e43a0c640.jpg?s=120&d=mm&r=g)
[Maria-developers] Updated (by Serg): Add info to engine description (61)
by worklog-noreply@askmonty.org 23 Apr '10
by worklog-noreply@askmonty.org 23 Apr '10
23 Apr '10
-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: Add info to engine description
CREATION DATE..: Mon, 02 Nov 2009, 22:58
SUPERVISOR.....: Monty
IMPLEMENTOR....: Sanja
COPIES TO......:
CATEGORY.......: Server-BackLog
TASK ID........: 61 (http://askmonty.org/worklog/?tid=61)
VERSION........: Server-5.1
STATUS.........: Complete
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 5 (hours remain)
ORIG. ESTIMATE.: 5
PROGRESS NOTES:
-=-=(Serg - Fri, 23 Apr 2010, 11:02)=-=-
Status updated.
--- /tmp/wklog.61.old.24344 2010-04-23 11:02:39.000000000 +0000
+++ /tmp/wklog.61.new.24344 2010-04-23 11:02:39.000000000 +0000
@@ -1 +1 @@
-Code-Review
+Complete
-=-=(Sanja - Fri, 04 Dec 2009, 13:50)=-=-
Status updated.
--- /tmp/wklog.61.old.16175 2009-12-04 13:50:12.000000000 +0200
+++ /tmp/wklog.61.new.16175 2009-12-04 13:50:12.000000000 +0200
@@ -1 +1 @@
-Assigned
+Code-Review
-=-=(Sanja - Fri, 20 Nov 2009, 00:18)=-=-
High-Level Specification modified.
--- /tmp/wklog.61.old.19932 2009-11-20 00:18:57.000000000 +0200
+++ /tmp/wklog.61.new.19932 2009-11-20 00:18:57.000000000 +0200
@@ -1 +1,9 @@
+There is two time of engines/plugins build in and loadable. For both we add
+structure with additional information
+1) for build in we will modify MYSQL_PLUGIN_STATIC to collect that strucures in
+array also with builtin_*_plugin structures.
+
+2) for dinamic plugins we check in plugin_dl_add() if the pligin defins maria
+simbols we read info in if no then fill maturety with UNKNOWN and version with
+empty string.
-=-=(Sanja - Thu, 19 Nov 2009, 23:56)=-=-
High Level Description modified.
--- /tmp/wklog.61.old.19057 2009-11-19 23:56:48.000000000 +0200
+++ /tmp/wklog.61.new.19057 2009-11-19 23:56:48.000000000 +0200
@@ -1,8 +1,6 @@
-Add additional information about engine and show it in SHOW ENGINES:
+Add additional information about engine and show it in information schema:
-License (PROPRIETARY, GPL, BSD) (it is already present, just have to be shown)
-
-Maturity (TEST, ALPHA, BETA, GAMMA, RELEASE)
+Maturity (UNKNOWN, TEST, ALPHA, BETA, GAMMA, RELEASE)
Version (just string from engine developer like "0.99 beta", better if it will
be monotonically increasing in terms of alphabetical sort).
-=-=(Hakan - Thu, 05 Nov 2009, 21:09)=-=-
High Level Description modified.
--- /tmp/wklog.61.old.22402 2009-11-05 21:09:08.000000000 +0200
+++ /tmp/wklog.61.new.22402 2009-11-05 21:09:08.000000000 +0200
@@ -1,8 +1,8 @@
Add additional information about engine and show it in SHOW ENGINES:
-License (PROPRIETARY, GPL, BSD) (it is present just have to be shown)
+License (PROPRIETARY, GPL, BSD) (it is already present, just have to be shown)
Maturity (TEST, ALPHA, BETA, GAMMA, RELEASE)
-Version (just string from engine developer like "0.99 betta", better if it will
+Version (just string from engine developer like "0.99 beta", better if it will
be monotonically increasing in terms of alphabetical sort).
DESCRIPTION:
Add additional information about engine and show it in information schema:
Maturity (UNKNOWN, TEST, ALPHA, BETA, GAMMA, RELEASE)
Version (just string from engine developer like "0.99 beta", better if it will
be monotonically increasing in terms of alphabetical sort).
HIGH-LEVEL SPECIFICATION:
There is two time of engines/plugins build in and loadable. For both we add
structure with additional information
1) for build in we will modify MYSQL_PLUGIN_STATIC to collect that strucures in
array also with builtin_*_plugin structures.
2) for dinamic plugins we check in plugin_dl_add() if the pligin defins maria
simbols we read info in if no then fill maturety with UNKNOWN and version with
empty string.
ESTIMATED WORK TIME
ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)
1
0
![](https://secure.gravatar.com/avatar/b38aed4ff9d39949c1acd04e43a0c640.jpg?s=120&d=mm&r=g)
[Maria-developers] Updated (by Guest): options for CREATE TABLE (43)
by worklog-noreply@askmonty.org 23 Apr '10
by worklog-noreply@askmonty.org 23 Apr '10
23 Apr '10
-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: options for CREATE TABLE
CREATION DATE..: Tue, 11 Aug 2009, 17:02
SUPERVISOR.....: Bothorsen
IMPLEMENTOR....: Sanja
COPIES TO......: Sergei, Monty
CATEGORY.......: Server-BackLog
TASK ID........: 43 (http://askmonty.org/worklog/?tid=43)
VERSION........: Server-5.2
STATUS.........: Complete
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 32 (hours remain)
ORIG. ESTIMATE.: 32
PROGRESS NOTES:
-=-=(Guest - Fri, 23 Apr 2010, 11:02)=-=-
Status updated.
--- /tmp/wklog.43.old.24328 2010-04-23 11:02:07.000000000 +0000
+++ /tmp/wklog.43.new.24328 2010-04-23 11:02:07.000000000 +0000
@@ -1 +1 @@
-Assigned
+Complete
-=-=(Serg - Sun, 11 Apr 2010, 11:58)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.24176 2010-04-11 11:58:36.000000000 +0000
+++ /tmp/wklog.43.new.24176 2010-04-11 11:58:36.000000000 +0000
@@ -2,6 +2,5 @@
Handler have access to the options during creation and after opening frm.
-It should has C interface.
-=-=(Serg - Thu, 04 Mar 2010, 16:15)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.32502 2010-03-04 16:15:12.000000000 +0000
+++ /tmp/wklog.43.new.32502 2010-03-04 16:15:12.000000000 +0000
@@ -1,13 +1,13 @@
-Table definition ca looks like following
+Table definition will look like the following:
CREATE TABLE table
(field int ... field_opt1=fval1 field_opt2=fval2,
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
-Exclusion should be made for old table and key options where
-'=' was not obligatory. Behaviour and way of storage for existing options will
-be left as is.
+Exceptions should be made for old table and key options where
+'=' was not obligatory. These options will behave as they did,
+no changes from the user point of view.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
@@ -37,12 +37,11 @@
default charset
default collation
DATA DIRECTORY
+INDEX DIRECTORY
TABLESPACE
STORAGE
-For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
-be separated from them by '=' sign.
-
-Incorrect option during creation/altering table lead only to worning. During
-opening unrecognised options should be ignored.
+Incorrect option during creation/altering table lead only to a warning.
+Strict mode makes them errors, as expected.
+When opening a table all unrecognised options should be ignored.
-=-=(Sergei - Mon, 18 Jan 2010, 22:12)=-=-
Observers changed: Monty,Sergei
-=-=(Monty - Tue, 12 Jan 2010, 17:04)=-=-
Version updated.
--- /tmp/wklog.43.old.21802 2010-01-12 17:04:31.000000000 +0200
+++ /tmp/wklog.43.new.21802 2010-01-12 17:04:31.000000000 +0200
@@ -1 +1 @@
-Server-5.1
+Server-5.2
-=-=(Guest - Fri, 18 Sep 2009, 14:24)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.31654 2009-09-18 14:24:41.000000000 +0300
+++ /tmp/wklog.43.new.31654 2009-09-18 14:24:41.000000000 +0300
@@ -2,4 +2,6 @@
Handler have access to the options during creation and after opening frm.
+It should has C interface.
+
-=-=(Sanja - Fri, 18 Sep 2009, 13:32)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.29567 2009-09-18 13:32:41.000000000 +0300
+++ /tmp/wklog.43.new.29567 2009-09-18 13:32:41.000000000 +0300
@@ -1 +1,5 @@
+Options stored in a list as pairs key, value which are LEX_STRING.
+
+Handler have access to the options during creation and after opening frm.
+
-=-=(Sanja - Fri, 18 Sep 2009, 13:21)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.29107 2009-09-18 13:21:19.000000000 +0300
+++ /tmp/wklog.43.new.29107 2009-09-18 13:21:19.000000000 +0300
@@ -6,7 +6,8 @@
table_option1=tval1, table_option2=tval2;
Exclusion should be made for old table and key options where
-'=' was not obligatory.
+'=' was not obligatory. Behaviour and way of storage for existing options will
+be left as is.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
@@ -42,6 +43,6 @@
For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
be separated from them by '=' sign.
-
-
+Incorrect option during creation/altering table lead only to worning. During
+opening unrecognised options should be ignored.
-=-=(Guest - Tue, 11 Aug 2009, 19:57)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.31856 2009-08-11 19:57:38.000000000 +0300
+++ /tmp/wklog.43.new.31856 2009-08-11 19:57:38.000000000 +0300
@@ -5,8 +5,43 @@
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
-Exclusion should be made for old table and key (KEY_BLOCK_SIZE) options where
+Exclusion should be made for old table and key options where
'=' was not obligatory.
+Old key options:
+KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
+WITH PARSER <name> -> PARSER=name
+
+Old table options:
+ENGINE name -> ENGINE=name
+TYPE name -> TYPE=name
+MAX_ROWS num -> MAX_ROWS=num
+MIX_ROWS num -> MIX_ROWS=num
+AVG_ROW_LENGTH num -> AVG_ROW_LENGTH=num
+PASSWORD string -> PASSWORD=string
+COMMENT string -> COMMENT=string
+AUTO_INCREMENT num -> AUTO_INCREMENT=num
+PACK_KEYS num/default -> PACK_KEYS=num/default
+CHECKSUM num -> CHECKSUM=num
+TABLE_CHECKSUM num -> TABLE_CHECKSUM=num
+PAGE_CHECKSUM num -> PAGE_CHECKSUM=num
+DELAY_KEY_WRITE num -> DELAY_KEY_WRITE=num
+ROW_FORMAT name -> ROW_FORMAT=name
+INSERT_METHOD name -> INSERT_METHOD=name
+KEY_BLOCK_SIZE num -> KEY_BLOCK_SIZE=num
+TRANSACTIONAL num -> TRANSACTIONAL=num
+
+Table options which will be left hardcoded
+UNION
+default charset
+default collation
+DATA DIRECTORY
+TABLESPACE
+STORAGE
+
For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
be separated from them by '=' sign.
+
+
+
+
-=-=(Guest - Tue, 11 Aug 2009, 19:36)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.30883 2009-08-11 19:36:45.000000000 +0300
+++ /tmp/wklog.43.new.30883 2009-08-11 19:36:45.000000000 +0300
@@ -1 +1,12 @@
+Table definition ca looks like following
+CREATE TABLE table
+ (field int ... field_opt1=fval1 field_opt2=fval2,
+ key key1(field) key_opt1=kval1 key_opt2=kval2)
+ table_option1=tval1, table_option2=tval2;
+
+Exclusion should be made for old table and key (KEY_BLOCK_SIZE) options where
+'=' was not obligatory.
+
+For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
+be separated from them by '=' sign.
DESCRIPTION:
Add ability to create table with additional option which can be passed to engine.
Also make current options such as TRANSACTIONAL working via this mechanism.
HIGH-LEVEL SPECIFICATION:
Table definition will look like the following:
CREATE TABLE table
(field int ... field_opt1=fval1 field_opt2=fval2,
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
Exceptions should be made for old table and key options where
'=' was not obligatory. These options will behave as they did,
no changes from the user point of view.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
WITH PARSER <name> -> PARSER=name
Old table options:
ENGINE name -> ENGINE=name
TYPE name -> TYPE=name
MAX_ROWS num -> MAX_ROWS=num
MIX_ROWS num -> MIX_ROWS=num
AVG_ROW_LENGTH num -> AVG_ROW_LENGTH=num
PASSWORD string -> PASSWORD=string
COMMENT string -> COMMENT=string
AUTO_INCREMENT num -> AUTO_INCREMENT=num
PACK_KEYS num/default -> PACK_KEYS=num/default
CHECKSUM num -> CHECKSUM=num
TABLE_CHECKSUM num -> TABLE_CHECKSUM=num
PAGE_CHECKSUM num -> PAGE_CHECKSUM=num
DELAY_KEY_WRITE num -> DELAY_KEY_WRITE=num
ROW_FORMAT name -> ROW_FORMAT=name
INSERT_METHOD name -> INSERT_METHOD=name
KEY_BLOCK_SIZE num -> KEY_BLOCK_SIZE=num
TRANSACTIONAL num -> TRANSACTIONAL=num
Table options which will be left hardcoded
UNION
default charset
default collation
DATA DIRECTORY
INDEX DIRECTORY
TABLESPACE
STORAGE
Incorrect option during creation/altering table lead only to a warning.
Strict mode makes them errors, as expected.
When opening a table all unrecognised options should be ignored.
LOW-LEVEL DESIGN:
Options stored in a list as pairs key, value which are LEX_STRING.
Handler have access to the options during creation and after opening frm.
ESTIMATED WORK TIME
ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)
1
0
![](https://secure.gravatar.com/avatar/b38aed4ff9d39949c1acd04e43a0c640.jpg?s=120&d=mm&r=g)
[Maria-developers] Updated (by Guest): options for CREATE TABLE (43)
by worklog-noreply@askmonty.org 23 Apr '10
by worklog-noreply@askmonty.org 23 Apr '10
23 Apr '10
-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: options for CREATE TABLE
CREATION DATE..: Tue, 11 Aug 2009, 17:02
SUPERVISOR.....: Bothorsen
IMPLEMENTOR....: Sanja
COPIES TO......: Sergei, Monty
CATEGORY.......: Server-BackLog
TASK ID........: 43 (http://askmonty.org/worklog/?tid=43)
VERSION........: Server-5.2
STATUS.........: Complete
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 32 (hours remain)
ORIG. ESTIMATE.: 32
PROGRESS NOTES:
-=-=(Guest - Fri, 23 Apr 2010, 11:02)=-=-
Status updated.
--- /tmp/wklog.43.old.24328 2010-04-23 11:02:07.000000000 +0000
+++ /tmp/wklog.43.new.24328 2010-04-23 11:02:07.000000000 +0000
@@ -1 +1 @@
-Assigned
+Complete
-=-=(Serg - Sun, 11 Apr 2010, 11:58)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.24176 2010-04-11 11:58:36.000000000 +0000
+++ /tmp/wklog.43.new.24176 2010-04-11 11:58:36.000000000 +0000
@@ -2,6 +2,5 @@
Handler have access to the options during creation and after opening frm.
-It should has C interface.
-=-=(Serg - Thu, 04 Mar 2010, 16:15)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.32502 2010-03-04 16:15:12.000000000 +0000
+++ /tmp/wklog.43.new.32502 2010-03-04 16:15:12.000000000 +0000
@@ -1,13 +1,13 @@
-Table definition ca looks like following
+Table definition will look like the following:
CREATE TABLE table
(field int ... field_opt1=fval1 field_opt2=fval2,
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
-Exclusion should be made for old table and key options where
-'=' was not obligatory. Behaviour and way of storage for existing options will
-be left as is.
+Exceptions should be made for old table and key options where
+'=' was not obligatory. These options will behave as they did,
+no changes from the user point of view.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
@@ -37,12 +37,11 @@
default charset
default collation
DATA DIRECTORY
+INDEX DIRECTORY
TABLESPACE
STORAGE
-For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
-be separated from them by '=' sign.
-
-Incorrect option during creation/altering table lead only to worning. During
-opening unrecognised options should be ignored.
+Incorrect option during creation/altering table lead only to a warning.
+Strict mode makes them errors, as expected.
+When opening a table all unrecognised options should be ignored.
-=-=(Sergei - Mon, 18 Jan 2010, 22:12)=-=-
Observers changed: Monty,Sergei
-=-=(Monty - Tue, 12 Jan 2010, 17:04)=-=-
Version updated.
--- /tmp/wklog.43.old.21802 2010-01-12 17:04:31.000000000 +0200
+++ /tmp/wklog.43.new.21802 2010-01-12 17:04:31.000000000 +0200
@@ -1 +1 @@
-Server-5.1
+Server-5.2
-=-=(Guest - Fri, 18 Sep 2009, 14:24)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.31654 2009-09-18 14:24:41.000000000 +0300
+++ /tmp/wklog.43.new.31654 2009-09-18 14:24:41.000000000 +0300
@@ -2,4 +2,6 @@
Handler have access to the options during creation and after opening frm.
+It should has C interface.
+
-=-=(Sanja - Fri, 18 Sep 2009, 13:32)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.29567 2009-09-18 13:32:41.000000000 +0300
+++ /tmp/wklog.43.new.29567 2009-09-18 13:32:41.000000000 +0300
@@ -1 +1,5 @@
+Options stored in a list as pairs key, value which are LEX_STRING.
+
+Handler have access to the options during creation and after opening frm.
+
-=-=(Sanja - Fri, 18 Sep 2009, 13:21)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.29107 2009-09-18 13:21:19.000000000 +0300
+++ /tmp/wklog.43.new.29107 2009-09-18 13:21:19.000000000 +0300
@@ -6,7 +6,8 @@
table_option1=tval1, table_option2=tval2;
Exclusion should be made for old table and key options where
-'=' was not obligatory.
+'=' was not obligatory. Behaviour and way of storage for existing options will
+be left as is.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
@@ -42,6 +43,6 @@
For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
be separated from them by '=' sign.
-
-
+Incorrect option during creation/altering table lead only to worning. During
+opening unrecognised options should be ignored.
-=-=(Guest - Tue, 11 Aug 2009, 19:57)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.31856 2009-08-11 19:57:38.000000000 +0300
+++ /tmp/wklog.43.new.31856 2009-08-11 19:57:38.000000000 +0300
@@ -5,8 +5,43 @@
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
-Exclusion should be made for old table and key (KEY_BLOCK_SIZE) options where
+Exclusion should be made for old table and key options where
'=' was not obligatory.
+Old key options:
+KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
+WITH PARSER <name> -> PARSER=name
+
+Old table options:
+ENGINE name -> ENGINE=name
+TYPE name -> TYPE=name
+MAX_ROWS num -> MAX_ROWS=num
+MIX_ROWS num -> MIX_ROWS=num
+AVG_ROW_LENGTH num -> AVG_ROW_LENGTH=num
+PASSWORD string -> PASSWORD=string
+COMMENT string -> COMMENT=string
+AUTO_INCREMENT num -> AUTO_INCREMENT=num
+PACK_KEYS num/default -> PACK_KEYS=num/default
+CHECKSUM num -> CHECKSUM=num
+TABLE_CHECKSUM num -> TABLE_CHECKSUM=num
+PAGE_CHECKSUM num -> PAGE_CHECKSUM=num
+DELAY_KEY_WRITE num -> DELAY_KEY_WRITE=num
+ROW_FORMAT name -> ROW_FORMAT=name
+INSERT_METHOD name -> INSERT_METHOD=name
+KEY_BLOCK_SIZE num -> KEY_BLOCK_SIZE=num
+TRANSACTIONAL num -> TRANSACTIONAL=num
+
+Table options which will be left hardcoded
+UNION
+default charset
+default collation
+DATA DIRECTORY
+TABLESPACE
+STORAGE
+
For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
be separated from them by '=' sign.
+
+
+
+
-=-=(Guest - Tue, 11 Aug 2009, 19:36)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.30883 2009-08-11 19:36:45.000000000 +0300
+++ /tmp/wklog.43.new.30883 2009-08-11 19:36:45.000000000 +0300
@@ -1 +1,12 @@
+Table definition ca looks like following
+CREATE TABLE table
+ (field int ... field_opt1=fval1 field_opt2=fval2,
+ key key1(field) key_opt1=kval1 key_opt2=kval2)
+ table_option1=tval1, table_option2=tval2;
+
+Exclusion should be made for old table and key (KEY_BLOCK_SIZE) options where
+'=' was not obligatory.
+
+For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
+be separated from them by '=' sign.
DESCRIPTION:
Add ability to create table with additional option which can be passed to engine.
Also make current options such as TRANSACTIONAL working via this mechanism.
HIGH-LEVEL SPECIFICATION:
Table definition will look like the following:
CREATE TABLE table
(field int ... field_opt1=fval1 field_opt2=fval2,
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
Exceptions should be made for old table and key options where
'=' was not obligatory. These options will behave as they did,
no changes from the user point of view.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
WITH PARSER <name> -> PARSER=name
Old table options:
ENGINE name -> ENGINE=name
TYPE name -> TYPE=name
MAX_ROWS num -> MAX_ROWS=num
MIX_ROWS num -> MIX_ROWS=num
AVG_ROW_LENGTH num -> AVG_ROW_LENGTH=num
PASSWORD string -> PASSWORD=string
COMMENT string -> COMMENT=string
AUTO_INCREMENT num -> AUTO_INCREMENT=num
PACK_KEYS num/default -> PACK_KEYS=num/default
CHECKSUM num -> CHECKSUM=num
TABLE_CHECKSUM num -> TABLE_CHECKSUM=num
PAGE_CHECKSUM num -> PAGE_CHECKSUM=num
DELAY_KEY_WRITE num -> DELAY_KEY_WRITE=num
ROW_FORMAT name -> ROW_FORMAT=name
INSERT_METHOD name -> INSERT_METHOD=name
KEY_BLOCK_SIZE num -> KEY_BLOCK_SIZE=num
TRANSACTIONAL num -> TRANSACTIONAL=num
Table options which will be left hardcoded
UNION
default charset
default collation
DATA DIRECTORY
INDEX DIRECTORY
TABLESPACE
STORAGE
Incorrect option during creation/altering table lead only to a warning.
Strict mode makes them errors, as expected.
When opening a table all unrecognised options should be ignored.
LOW-LEVEL DESIGN:
Options stored in a list as pairs key, value which are LEX_STRING.
Handler have access to the options during creation and after opening frm.
ESTIMATED WORK TIME
ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)
1
0
![](https://secure.gravatar.com/avatar/b38aed4ff9d39949c1acd04e43a0c640.jpg?s=120&d=mm&r=g)
[Maria-developers] Updated (by Guest): options for CREATE TABLE (43)
by worklog-noreply@askmonty.org 23 Apr '10
by worklog-noreply@askmonty.org 23 Apr '10
23 Apr '10
-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: options for CREATE TABLE
CREATION DATE..: Tue, 11 Aug 2009, 17:02
SUPERVISOR.....: Bothorsen
IMPLEMENTOR....: Sanja
COPIES TO......: Sergei, Monty
CATEGORY.......: Server-BackLog
TASK ID........: 43 (http://askmonty.org/worklog/?tid=43)
VERSION........: Server-5.2
STATUS.........: Complete
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 32 (hours remain)
ORIG. ESTIMATE.: 32
PROGRESS NOTES:
-=-=(Guest - Fri, 23 Apr 2010, 11:02)=-=-
Status updated.
--- /tmp/wklog.43.old.24328 2010-04-23 11:02:07.000000000 +0000
+++ /tmp/wklog.43.new.24328 2010-04-23 11:02:07.000000000 +0000
@@ -1 +1 @@
-Assigned
+Complete
-=-=(Serg - Sun, 11 Apr 2010, 11:58)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.24176 2010-04-11 11:58:36.000000000 +0000
+++ /tmp/wklog.43.new.24176 2010-04-11 11:58:36.000000000 +0000
@@ -2,6 +2,5 @@
Handler have access to the options during creation and after opening frm.
-It should has C interface.
-=-=(Serg - Thu, 04 Mar 2010, 16:15)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.32502 2010-03-04 16:15:12.000000000 +0000
+++ /tmp/wklog.43.new.32502 2010-03-04 16:15:12.000000000 +0000
@@ -1,13 +1,13 @@
-Table definition ca looks like following
+Table definition will look like the following:
CREATE TABLE table
(field int ... field_opt1=fval1 field_opt2=fval2,
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
-Exclusion should be made for old table and key options where
-'=' was not obligatory. Behaviour and way of storage for existing options will
-be left as is.
+Exceptions should be made for old table and key options where
+'=' was not obligatory. These options will behave as they did,
+no changes from the user point of view.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
@@ -37,12 +37,11 @@
default charset
default collation
DATA DIRECTORY
+INDEX DIRECTORY
TABLESPACE
STORAGE
-For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
-be separated from them by '=' sign.
-
-Incorrect option during creation/altering table lead only to worning. During
-opening unrecognised options should be ignored.
+Incorrect option during creation/altering table lead only to a warning.
+Strict mode makes them errors, as expected.
+When opening a table all unrecognised options should be ignored.
-=-=(Sergei - Mon, 18 Jan 2010, 22:12)=-=-
Observers changed: Monty,Sergei
-=-=(Monty - Tue, 12 Jan 2010, 17:04)=-=-
Version updated.
--- /tmp/wklog.43.old.21802 2010-01-12 17:04:31.000000000 +0200
+++ /tmp/wklog.43.new.21802 2010-01-12 17:04:31.000000000 +0200
@@ -1 +1 @@
-Server-5.1
+Server-5.2
-=-=(Guest - Fri, 18 Sep 2009, 14:24)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.31654 2009-09-18 14:24:41.000000000 +0300
+++ /tmp/wklog.43.new.31654 2009-09-18 14:24:41.000000000 +0300
@@ -2,4 +2,6 @@
Handler have access to the options during creation and after opening frm.
+It should has C interface.
+
-=-=(Sanja - Fri, 18 Sep 2009, 13:32)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.29567 2009-09-18 13:32:41.000000000 +0300
+++ /tmp/wklog.43.new.29567 2009-09-18 13:32:41.000000000 +0300
@@ -1 +1,5 @@
+Options stored in a list as pairs key, value which are LEX_STRING.
+
+Handler have access to the options during creation and after opening frm.
+
-=-=(Sanja - Fri, 18 Sep 2009, 13:21)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.29107 2009-09-18 13:21:19.000000000 +0300
+++ /tmp/wklog.43.new.29107 2009-09-18 13:21:19.000000000 +0300
@@ -6,7 +6,8 @@
table_option1=tval1, table_option2=tval2;
Exclusion should be made for old table and key options where
-'=' was not obligatory.
+'=' was not obligatory. Behaviour and way of storage for existing options will
+be left as is.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
@@ -42,6 +43,6 @@
For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
be separated from them by '=' sign.
-
-
+Incorrect option during creation/altering table lead only to worning. During
+opening unrecognised options should be ignored.
-=-=(Guest - Tue, 11 Aug 2009, 19:57)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.31856 2009-08-11 19:57:38.000000000 +0300
+++ /tmp/wklog.43.new.31856 2009-08-11 19:57:38.000000000 +0300
@@ -5,8 +5,43 @@
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
-Exclusion should be made for old table and key (KEY_BLOCK_SIZE) options where
+Exclusion should be made for old table and key options where
'=' was not obligatory.
+Old key options:
+KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
+WITH PARSER <name> -> PARSER=name
+
+Old table options:
+ENGINE name -> ENGINE=name
+TYPE name -> TYPE=name
+MAX_ROWS num -> MAX_ROWS=num
+MIX_ROWS num -> MIX_ROWS=num
+AVG_ROW_LENGTH num -> AVG_ROW_LENGTH=num
+PASSWORD string -> PASSWORD=string
+COMMENT string -> COMMENT=string
+AUTO_INCREMENT num -> AUTO_INCREMENT=num
+PACK_KEYS num/default -> PACK_KEYS=num/default
+CHECKSUM num -> CHECKSUM=num
+TABLE_CHECKSUM num -> TABLE_CHECKSUM=num
+PAGE_CHECKSUM num -> PAGE_CHECKSUM=num
+DELAY_KEY_WRITE num -> DELAY_KEY_WRITE=num
+ROW_FORMAT name -> ROW_FORMAT=name
+INSERT_METHOD name -> INSERT_METHOD=name
+KEY_BLOCK_SIZE num -> KEY_BLOCK_SIZE=num
+TRANSACTIONAL num -> TRANSACTIONAL=num
+
+Table options which will be left hardcoded
+UNION
+default charset
+default collation
+DATA DIRECTORY
+TABLESPACE
+STORAGE
+
For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
be separated from them by '=' sign.
+
+
+
+
-=-=(Guest - Tue, 11 Aug 2009, 19:36)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.30883 2009-08-11 19:36:45.000000000 +0300
+++ /tmp/wklog.43.new.30883 2009-08-11 19:36:45.000000000 +0300
@@ -1 +1,12 @@
+Table definition ca looks like following
+CREATE TABLE table
+ (field int ... field_opt1=fval1 field_opt2=fval2,
+ key key1(field) key_opt1=kval1 key_opt2=kval2)
+ table_option1=tval1, table_option2=tval2;
+
+Exclusion should be made for old table and key (KEY_BLOCK_SIZE) options where
+'=' was not obligatory.
+
+For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
+be separated from them by '=' sign.
DESCRIPTION:
Add ability to create table with additional option which can be passed to engine.
Also make current options such as TRANSACTIONAL working via this mechanism.
HIGH-LEVEL SPECIFICATION:
Table definition will look like the following:
CREATE TABLE table
(field int ... field_opt1=fval1 field_opt2=fval2,
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
Exceptions should be made for old table and key options where
'=' was not obligatory. These options will behave as they did,
no changes from the user point of view.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
WITH PARSER <name> -> PARSER=name
Old table options:
ENGINE name -> ENGINE=name
TYPE name -> TYPE=name
MAX_ROWS num -> MAX_ROWS=num
MIX_ROWS num -> MIX_ROWS=num
AVG_ROW_LENGTH num -> AVG_ROW_LENGTH=num
PASSWORD string -> PASSWORD=string
COMMENT string -> COMMENT=string
AUTO_INCREMENT num -> AUTO_INCREMENT=num
PACK_KEYS num/default -> PACK_KEYS=num/default
CHECKSUM num -> CHECKSUM=num
TABLE_CHECKSUM num -> TABLE_CHECKSUM=num
PAGE_CHECKSUM num -> PAGE_CHECKSUM=num
DELAY_KEY_WRITE num -> DELAY_KEY_WRITE=num
ROW_FORMAT name -> ROW_FORMAT=name
INSERT_METHOD name -> INSERT_METHOD=name
KEY_BLOCK_SIZE num -> KEY_BLOCK_SIZE=num
TRANSACTIONAL num -> TRANSACTIONAL=num
Table options which will be left hardcoded
UNION
default charset
default collation
DATA DIRECTORY
INDEX DIRECTORY
TABLESPACE
STORAGE
Incorrect option during creation/altering table lead only to a warning.
Strict mode makes them errors, as expected.
When opening a table all unrecognised options should be ignored.
LOW-LEVEL DESIGN:
Options stored in a list as pairs key, value which are LEX_STRING.
Handler have access to the options during creation and after opening frm.
ESTIMATED WORK TIME
ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)
1
0
![](https://secure.gravatar.com/avatar/b38aed4ff9d39949c1acd04e43a0c640.jpg?s=120&d=mm&r=g)
[Maria-developers] Updated (by Guest): options for CREATE TABLE (43)
by worklog-noreply@askmonty.org 23 Apr '10
by worklog-noreply@askmonty.org 23 Apr '10
23 Apr '10
-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: options for CREATE TABLE
CREATION DATE..: Tue, 11 Aug 2009, 17:02
SUPERVISOR.....: Bothorsen
IMPLEMENTOR....: Sanja
COPIES TO......: Sergei, Monty
CATEGORY.......: Server-BackLog
TASK ID........: 43 (http://askmonty.org/worklog/?tid=43)
VERSION........: Server-5.2
STATUS.........: Complete
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 32 (hours remain)
ORIG. ESTIMATE.: 32
PROGRESS NOTES:
-=-=(Guest - Fri, 23 Apr 2010, 11:02)=-=-
Status updated.
--- /tmp/wklog.43.old.24328 2010-04-23 11:02:07.000000000 +0000
+++ /tmp/wklog.43.new.24328 2010-04-23 11:02:07.000000000 +0000
@@ -1 +1 @@
-Assigned
+Complete
-=-=(Serg - Sun, 11 Apr 2010, 11:58)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.24176 2010-04-11 11:58:36.000000000 +0000
+++ /tmp/wklog.43.new.24176 2010-04-11 11:58:36.000000000 +0000
@@ -2,6 +2,5 @@
Handler have access to the options during creation and after opening frm.
-It should has C interface.
-=-=(Serg - Thu, 04 Mar 2010, 16:15)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.32502 2010-03-04 16:15:12.000000000 +0000
+++ /tmp/wklog.43.new.32502 2010-03-04 16:15:12.000000000 +0000
@@ -1,13 +1,13 @@
-Table definition ca looks like following
+Table definition will look like the following:
CREATE TABLE table
(field int ... field_opt1=fval1 field_opt2=fval2,
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
-Exclusion should be made for old table and key options where
-'=' was not obligatory. Behaviour and way of storage for existing options will
-be left as is.
+Exceptions should be made for old table and key options where
+'=' was not obligatory. These options will behave as they did,
+no changes from the user point of view.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
@@ -37,12 +37,11 @@
default charset
default collation
DATA DIRECTORY
+INDEX DIRECTORY
TABLESPACE
STORAGE
-For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
-be separated from them by '=' sign.
-
-Incorrect option during creation/altering table lead only to worning. During
-opening unrecognised options should be ignored.
+Incorrect option during creation/altering table lead only to a warning.
+Strict mode makes them errors, as expected.
+When opening a table all unrecognised options should be ignored.
-=-=(Sergei - Mon, 18 Jan 2010, 22:12)=-=-
Observers changed: Monty,Sergei
-=-=(Monty - Tue, 12 Jan 2010, 17:04)=-=-
Version updated.
--- /tmp/wklog.43.old.21802 2010-01-12 17:04:31.000000000 +0200
+++ /tmp/wklog.43.new.21802 2010-01-12 17:04:31.000000000 +0200
@@ -1 +1 @@
-Server-5.1
+Server-5.2
-=-=(Guest - Fri, 18 Sep 2009, 14:24)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.31654 2009-09-18 14:24:41.000000000 +0300
+++ /tmp/wklog.43.new.31654 2009-09-18 14:24:41.000000000 +0300
@@ -2,4 +2,6 @@
Handler have access to the options during creation and after opening frm.
+It should has C interface.
+
-=-=(Sanja - Fri, 18 Sep 2009, 13:32)=-=-
Low Level Design modified.
--- /tmp/wklog.43.old.29567 2009-09-18 13:32:41.000000000 +0300
+++ /tmp/wklog.43.new.29567 2009-09-18 13:32:41.000000000 +0300
@@ -1 +1,5 @@
+Options stored in a list as pairs key, value which are LEX_STRING.
+
+Handler have access to the options during creation and after opening frm.
+
-=-=(Sanja - Fri, 18 Sep 2009, 13:21)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.29107 2009-09-18 13:21:19.000000000 +0300
+++ /tmp/wklog.43.new.29107 2009-09-18 13:21:19.000000000 +0300
@@ -6,7 +6,8 @@
table_option1=tval1, table_option2=tval2;
Exclusion should be made for old table and key options where
-'=' was not obligatory.
+'=' was not obligatory. Behaviour and way of storage for existing options will
+be left as is.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
@@ -42,6 +43,6 @@
For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
be separated from them by '=' sign.
-
-
+Incorrect option during creation/altering table lead only to worning. During
+opening unrecognised options should be ignored.
-=-=(Guest - Tue, 11 Aug 2009, 19:57)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.31856 2009-08-11 19:57:38.000000000 +0300
+++ /tmp/wklog.43.new.31856 2009-08-11 19:57:38.000000000 +0300
@@ -5,8 +5,43 @@
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
-Exclusion should be made for old table and key (KEY_BLOCK_SIZE) options where
+Exclusion should be made for old table and key options where
'=' was not obligatory.
+Old key options:
+KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
+WITH PARSER <name> -> PARSER=name
+
+Old table options:
+ENGINE name -> ENGINE=name
+TYPE name -> TYPE=name
+MAX_ROWS num -> MAX_ROWS=num
+MIX_ROWS num -> MIX_ROWS=num
+AVG_ROW_LENGTH num -> AVG_ROW_LENGTH=num
+PASSWORD string -> PASSWORD=string
+COMMENT string -> COMMENT=string
+AUTO_INCREMENT num -> AUTO_INCREMENT=num
+PACK_KEYS num/default -> PACK_KEYS=num/default
+CHECKSUM num -> CHECKSUM=num
+TABLE_CHECKSUM num -> TABLE_CHECKSUM=num
+PAGE_CHECKSUM num -> PAGE_CHECKSUM=num
+DELAY_KEY_WRITE num -> DELAY_KEY_WRITE=num
+ROW_FORMAT name -> ROW_FORMAT=name
+INSERT_METHOD name -> INSERT_METHOD=name
+KEY_BLOCK_SIZE num -> KEY_BLOCK_SIZE=num
+TRANSACTIONAL num -> TRANSACTIONAL=num
+
+Table options which will be left hardcoded
+UNION
+default charset
+default collation
+DATA DIRECTORY
+TABLESPACE
+STORAGE
+
For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
be separated from them by '=' sign.
+
+
+
+
-=-=(Guest - Tue, 11 Aug 2009, 19:36)=-=-
High-Level Specification modified.
--- /tmp/wklog.43.old.30883 2009-08-11 19:36:45.000000000 +0300
+++ /tmp/wklog.43.new.30883 2009-08-11 19:36:45.000000000 +0300
@@ -1 +1,12 @@
+Table definition ca looks like following
+CREATE TABLE table
+ (field int ... field_opt1=fval1 field_opt2=fval2,
+ key key1(field) key_opt1=kval1 key_opt2=kval2)
+ table_option1=tval1, table_option2=tval2;
+
+Exclusion should be made for old table and key (KEY_BLOCK_SIZE) options where
+'=' was not obligatory.
+
+For fields options can go with field attributes (NOT NULL, UNIQUE and so on) can
+be separated from them by '=' sign.
DESCRIPTION:
Add ability to create table with additional option which can be passed to engine.
Also make current options such as TRANSACTIONAL working via this mechanism.
HIGH-LEVEL SPECIFICATION:
Table definition will look like the following:
CREATE TABLE table
(field int ... field_opt1=fval1 field_opt2=fval2,
key key1(field) key_opt1=kval1 key_opt2=kval2)
table_option1=tval1, table_option2=tval2;
Exceptions should be made for old table and key options where
'=' was not obligatory. These options will behave as they did,
no changes from the user point of view.
Old key options:
KEY_BLOCK_SIZE <num> -> KEY_BLOCK_SIZE=num
WITH PARSER <name> -> PARSER=name
Old table options:
ENGINE name -> ENGINE=name
TYPE name -> TYPE=name
MAX_ROWS num -> MAX_ROWS=num
MIX_ROWS num -> MIX_ROWS=num
AVG_ROW_LENGTH num -> AVG_ROW_LENGTH=num
PASSWORD string -> PASSWORD=string
COMMENT string -> COMMENT=string
AUTO_INCREMENT num -> AUTO_INCREMENT=num
PACK_KEYS num/default -> PACK_KEYS=num/default
CHECKSUM num -> CHECKSUM=num
TABLE_CHECKSUM num -> TABLE_CHECKSUM=num
PAGE_CHECKSUM num -> PAGE_CHECKSUM=num
DELAY_KEY_WRITE num -> DELAY_KEY_WRITE=num
ROW_FORMAT name -> ROW_FORMAT=name
INSERT_METHOD name -> INSERT_METHOD=name
KEY_BLOCK_SIZE num -> KEY_BLOCK_SIZE=num
TRANSACTIONAL num -> TRANSACTIONAL=num
Table options which will be left hardcoded
UNION
default charset
default collation
DATA DIRECTORY
INDEX DIRECTORY
TABLESPACE
STORAGE
Incorrect option during creation/altering table lead only to a warning.
Strict mode makes them errors, as expected.
When opening a table all unrecognised options should be ignored.
LOW-LEVEL DESIGN:
Options stored in a list as pairs key, value which are LEX_STRING.
Handler have access to the options during creation and after opening frm.
ESTIMATED WORK TIME
ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)
1
0
![](https://secure.gravatar.com/avatar/bccaf81a23eecaecd9feaf01c7c42ff4.jpg?s=120&d=mm&r=g)
[Maria-developers] Rev 2842: A test implementation of having SQL layer to supply the storage engine with in file:///home/psergey/dev/maria-5.1-minmax/
by Sergey Petrunya 21 Apr '10
by Sergey Petrunya 21 Apr '10
21 Apr '10
At file:///home/psergey/dev/maria-5.1-minmax/
------------------------------------------------------------
revno: 2842
revision-id: psergey(a)askmonty.org-20100421141933-707cy6l3iha89lm5
parent: monty(a)askmonty.org-20100406224708-i62wvtw3nl14fhv4
committer: Sergey Petrunya <psergey(a)askmonty.org>
branch nick: maria-5.1-minmax
timestamp: Wed 2010-04-21 10:19:33 -0400
message:
A test implementation of having SQL layer to supply the storage engine with
interval lists for each unindexed column.
This patch consists of
- SQL layer providing service of taking a condition and extracting
list<column, disjoint_ordered_list<interval>> from it (see opt_field_minmax.h)
- An storage engine's "Implementation" that prints passed intervals to
server stderr.
Things need to be done:
- Comments, better names
- Make the interface compatible with Query Fragment Pushdown ideas.
- Invent something that would allow to have test coverage for this.
=== added file 'sql/opt_field_minmax.h'
--- a/sql/opt_field_minmax.h 1970-01-01 00:00:00 +0000
+++ b/sql/opt_field_minmax.h 2010-04-21 14:19:33 +0000
@@ -0,0 +1,35 @@
+//#include "../sql/opt_field_minmax.h"
+
+class RANGE_OPT_PARAM;
+class SEL_TREE;
+class SEL_ARG;
+
+typedef bool (*take_int_return_bool)(void* param, uint index);
+
+class Condition_analyzer
+{
+ TABLE *table;
+ MEM_ROOT alloc;
+ RANGE_OPT_PARAM *range_par;
+ SEL_TREE *tree;
+ my_bitmap_map *old_sets[2];
+ uchar min_val[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
+ uchar max_val[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
+
+ uint n_keys;
+
+ int cur_key;
+ SEL_ARG *cur_interval;
+public:
+ Condition_analyzer(TABLE *table_arg) :
+ table(table_arg), range_par(NULL), cur_key(-1) {}
+
+ bool analyze(Item *cond, take_int_return_bool field_filter_func,
+ void *field_filter_param);
+
+ bool start_intervals_walk_for_field(uint *fieldno);
+ bool get_next_interval(KEY_MULTI_RANGE *mrange);
+
+ void dispose();
+};
+
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc 2010-01-15 15:27:55 +0000
+++ b/sql/opt_range.cc 2010-04-21 14:19:33 +0000
@@ -2788,6 +2788,248 @@
DBUG_RETURN(retval);
}
+// psergey-minmax: start
+
+#include "opt_field_minmax.h"
+
+/*
+ Create one-column pseudo-indexes for each column.
+*/
+
+static
+bool create_minmax_indexes_descriptions(RANGE_OPT_PARAM *range_par,
+ take_int_return_bool field_filter_func,
+ void *func_param,
+ uint *n_keys)
+{
+ TABLE *table= range_par->table;
+ MEM_ROOT *alloc= range_par->mem_root;
+ *n_keys= 0;
+ uint fieldno;
+ for (fieldno= 0; fieldno < range_par->table->s->fields; fieldno++)
+ {
+ enum_field_types type= table->field[fieldno]->type();
+ if (!(type == MYSQL_TYPE_TINY_BLOB ||
+ type == MYSQL_TYPE_MEDIUM_BLOB ||
+ type == MYSQL_TYPE_LONG_BLOB ||
+ type == MYSQL_TYPE_BLOB ||
+ type == MYSQL_TYPE_GEOMETRY) &&
+ field_filter_func(func_param, fieldno) &&
+ *n_keys < MAX_INDEXES)
+ {
+ (*n_keys)++;
+ }
+ }
+
+ if (!*n_keys)
+ return TRUE;
+
+ KEY_PART *key_part;
+ key_part= (KEY_PART*)alloc_root(alloc, sizeof(KEY_PART)* (*n_keys));
+ range_par->key_parts= key_part;
+ range_par->key_parts_end= key_part + *n_keys;
+
+ uint idx= 0;
+ for (fieldno= 0; fieldno < range_par->table->s->fields; fieldno++)
+ {
+ enum_field_types type= table->field[fieldno]->type();
+ if (!(type == MYSQL_TYPE_TINY_BLOB ||
+ type == MYSQL_TYPE_MEDIUM_BLOB ||
+ type == MYSQL_TYPE_LONG_BLOB ||
+ type == MYSQL_TYPE_BLOB ||
+ type == MYSQL_TYPE_GEOMETRY) &&
+ field_filter_func(func_param, fieldno) &&
+ idx < MAX_INDEXES)
+ {
+ idx++;
+ Field **field= table->field + fieldno;
+ key_part->key= 0;
+ key_part->part= 0;
+ key_part->store_length= key_part->length= (uint16) (*field)->key_length();
+ if ((*field)->real_maybe_null())
+ key_part->store_length+= HA_KEY_NULL_LENGTH;
+ if ((*field)->type() == MYSQL_TYPE_BLOB ||
+ (*field)->real_type() == MYSQL_TYPE_VARCHAR)
+ key_part->store_length+= HA_KEY_BLOB_LENGTH;
+
+ key_part->field= (*field);
+ key_part->image_type = Field::itRAW;
+ /*
+ We set keypart flag to 0 here as the only HA_PART_KEY_SEG is checked
+ in the RangeAnalysisModule.
+ */
+ key_part->flag= 0;
+ /* We don't set key_parts->null_bit as it will not be used */
+
+ key_part++;
+ }
+ }
+ return FALSE;
+}
+
+
+
+
+bool Condition_analyzer::analyze(Item *cond,
+ take_int_return_bool func,
+ void *func_param)
+{
+ bool retval= FALSE;
+ THD *thd= current_thd;
+ uint i;
+ DBUG_ENTER("find_min_max_bounds");
+
+ init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
+ range_par= (RANGE_OPT_PARAM*)alloc_root(&alloc, sizeof(RANGE_OPT_PARAM));
+ range_par->mem_root= &alloc;
+ range_par->old_root= thd->mem_root;
+ range_par->thd= thd;
+ range_par->table= table;
+ /* range_par->cond doesn't need initialization */
+ range_par->prev_tables= range_par->read_tables= 0;
+ range_par->current_table= table->map;
+
+ if (create_minmax_indexes_descriptions(range_par, func, func_param, &n_keys))
+ {
+ free_root(&alloc,MYF(0)); // Return memory & allocator
+ DBUG_RETURN(FALSE);
+ }
+ range_par->keys= n_keys;
+
+ dbug_tmp_use_all_columns(table, old_sets,
+ table->read_set, table->write_set);
+ range_par->using_real_indexes= FALSE;
+ range_par->remove_jump_scans= TRUE;
+ for (i=0; i < n_keys; i++)
+ range_par->real_keynr[i]= i;
+ range_par->alloced_sel_args= 0;
+
+
+ thd->no_errors=1; // Don't warn about NULL
+ thd->mem_root=&alloc;
+
+ tree= get_mm_tree(range_par, cond);
+ if (!tree)
+ {
+ retval= TRUE;
+ goto end;
+ }
+
+ if (tree->type == SEL_TREE::IMPOSSIBLE)
+ {
+ retval= TRUE;
+ goto end;
+ }
+
+ if ((tree->type != SEL_TREE::KEY && tree->type != SEL_TREE::KEY_SMALLER) ||
+ !tree->merges.is_empty())
+ {
+ retval= TRUE;
+ goto end;
+ }
+
+end:
+ DBUG_RETURN(retval);
+}
+
+
+bool Condition_analyzer::start_intervals_walk_for_field(uint *fieldno)
+{
+ if (!tree)
+ return FALSE;
+ for (cur_key++; cur_key < (int)n_keys; cur_key++)
+ {
+ if (tree->keys[cur_key])
+ {
+ *fieldno= range_par->key_parts[cur_key].field->field_index;
+ cur_interval= tree->keys[0]->first();
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+
+bool Condition_analyzer::get_next_interval(KEY_MULTI_RANGE *mrange)
+{
+ uchar *key_ptr;
+ key_range *min_range= &mrange->start_key;
+ key_range *max_range= &mrange->end_key;
+
+ if (!cur_interval)
+ return FALSE;
+
+// uchar min_val[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
+// uchar max_val[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
+ min_range->key= this->min_val;
+ max_range->key= this->max_val;
+
+ key_ptr= (uchar*)min_range->key;
+ cur_interval->store_min(range_par->key_parts[cur_key].store_length,
+ &key_ptr, /*cur_interval->min_flag*/ 0);
+ min_range->keypart_map= key_part_map(1);
+ min_range->length= key_ptr - min_range->key;
+ min_range->flag= (cur_interval->min_flag & NEAR_MIN ? HA_READ_AFTER_KEY :
+ HA_READ_KEY_EXACT);
+
+ key_ptr= (uchar*)max_range->key;
+ cur_interval->store_max(range_par->key_parts[cur_key].store_length,
+ &key_ptr, /* cur_interval->max_flag */ 0);
+ max_range->keypart_map= key_part_map(1);
+ max_range->length= key_ptr - max_range->key;
+ max_range->flag= (cur_interval->max_flag & NEAR_MAX ?
+ HA_READ_BEFORE_KEY : HA_READ_AFTER_KEY);
+
+ mrange->range_flag= cur_interval->min_flag | cur_interval->max_flag;
+
+ cur_interval= cur_interval->next;
+ return TRUE;
+}
+
+
+void Condition_analyzer::dispose()
+{
+ THD *thd= current_thd;
+ dbug_tmp_restore_column_maps(table->read_set, table->write_set, old_sets);
+ thd->no_errors=0;
+ thd->mem_root= range_par->old_root;
+ free_root(&alloc,MYF(0)); // Return memory & allocator
+}
+
+
+#if 0
+static
+int search_min_max_bounds(RANGE_OPT_PARAM *ppar, SEL_ARG *key_tree)
+{
+ int res, left_res=0, right_res=0;
+
+ if (key_tree->left != &null_element)
+ {
+ if (-1 == (left_res= search_min_max_bounds(ppar,key_tree->left)))
+ return -1;
+ }
+
+ if (key_tree->type == SEL_ARG::KEY_RANGE)
+ {
+ /*
+ Partitioning is done by RANGE|INTERVAL(monotonic_expr(fieldX)), and
+ we got "const1 CMP fieldX CMP const2" interval <-- psergey-todo: change
+ */
+ DBUG_EXECUTE("info", dbug_print_segment_range(key_tree,
+ ppar->key_parts););
+ // key_tree->min_value, key_tree->max_value, key_tree->min_flag | key_tree->max_flag,
+ }
+
+ if (key_tree->right != &null_element)
+ {
+ if (-1 == (right_res= search_min_max_bounds(ppar,key_tree->right)))
+ return -1;
+ }
+ return (left_res || right_res || res);
+}
+#endif
+// psergey-minmax: end;
+
/*
Store field key image to table record
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2010-03-04 08:03:07 +0000
+++ b/sql/sql_parse.cc 2010-04-21 14:19:33 +0000
@@ -1237,6 +1237,7 @@
general_log_write(thd, command, thd->query(), thd->query_length());
DBUG_PRINT("query",("%-.4096s",thd->query()));
+ fprintf(stderr, "query: %-.4096s\n",thd->query());
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
thd->profiling.set_query_source(thd->query(), thd->query_length());
#endif
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2010-03-10 09:12:23 +0000
+++ b/sql/sql_select.cc 2010-04-21 14:19:33 +0000
@@ -6643,6 +6643,8 @@
}
}
+//psergey-minmax:
+bool find_min_max_bounds(THD *thd, TABLE *table, Item *pprune_cond);
static void
make_join_readinfo(JOIN *join, ulonglong options)
@@ -6681,6 +6683,7 @@
table->status=STATUS_NO_RECORD;
pick_table_access_method (tab);
+ //find_min_max_bounds(join->thd, table, tab->select_cond);
switch (tab->type) {
case JT_EQ_REF:
tab->read_record.unlock_row= join_read_key_unlock_row;
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2009-12-03 11:34:11 +0000
+++ b/storage/myisam/ha_myisam.cc 2010-04-21 14:19:33 +0000
@@ -2269,3 +2269,88 @@
DBUG_RETURN(TRUE);
}
#endif
+
+static bool do_min_max_for_index(void* param, uint index)
+{
+ /* param is what was to Condition_analyzer::analyze */
+ return TRUE;
+}
+
+#include "../sql/opt_field_minmax.h"
+
+void store_key_image_to_rec(Field *field, uchar *ptr, uint len);
+static void print_segment_range(Field *field, KEY_MULTI_RANGE *mrange);
+
+static void print_field(Field *field)
+{
+ if (field->is_real_null())
+ fprintf(stderr, "NULL");
+ else
+ {
+ char buf[256];
+ String str(buf, sizeof(buf), &my_charset_bin);
+ str.length(0);
+ String *pstr;
+ pstr= field->val_str(&str);
+ fprintf(stderr, "'%s'", pstr->c_ptr_safe());
+ }
+}
+
+/* Print a "c1 < keypartX < c2" - type interval into debug trace. */
+static void print_segment_range(Field *field, KEY_MULTI_RANGE *mrange)
+{
+ if (!(mrange->range_flag & NO_MIN_RANGE))
+ {
+ //DBUG_ASSERT(field->key_length() == mrange->start_key.length);
+ store_key_image_to_rec(field, (uchar*)mrange->start_key.key, mrange->start_key.length);
+ print_field(field);
+ if (mrange->range_flag & NEAR_MIN)
+ fputs(" < ", stderr);
+ else
+ fputs(" <= ", stderr);
+ }
+
+ fprintf(stderr, "%s", field->field_name);
+
+ if (!(mrange->range_flag & NO_MAX_RANGE))
+ {
+ if (mrange->range_flag & NEAR_MAX)
+ fputs(" < ", stderr);
+ else
+ fputs(" <= ", stderr);
+ //DBUG_ASSERT(field->key_length() == mrange->end_key.length);
+ store_key_image_to_rec(field, (uchar*)mrange->end_key.key, mrange->end_key.length);
+ print_field(field);
+ }
+ fputs("\n", stderr);
+}
+
+//931 202 76 04 natalya
+
+
+
+const COND * ha_myisam::cond_push(const COND *cond)
+{
+ fprintf(stderr, "table %s: set min-max bounds { \n", table->alias);
+ Condition_analyzer analyzer(table);
+ analyzer.analyze((Item*)cond, do_min_max_for_index, (void*)0x123456);
+ uint fieldno;
+ while (analyzer.start_intervals_walk_for_field(&fieldno))
+ {
+ KEY_MULTI_RANGE mrange;
+ while (analyzer.get_next_interval(&mrange))
+ {
+ // print the range;
+ print_segment_range(table->field[fieldno], &mrange);
+ }
+ }
+ fprintf(stderr, "}\n");
+ analyzer.dispose();
+ return cond;
+}
+
+void ha_myisam::cond_pop()
+{
+ fprintf(stderr, "table %s: Remove min-max bounds\n", table->alias);
+}
+
=== modified file 'storage/myisam/ha_myisam.h'
--- a/storage/myisam/ha_myisam.h 2009-09-07 20:50:10 +0000
+++ b/storage/myisam/ha_myisam.h 2010-04-21 14:19:33 +0000
@@ -148,4 +148,10 @@
{
return file;
}
+//psergey-minmax:
+ /*
+ Condition pushdown
+ */
+ const COND *cond_push(const COND *cond);
+ void cond_pop();
};
1
0
![](https://secure.gravatar.com/avatar/5d9bbb8d6bea01d0dc103f3dcab041d6.jpg?s=120&d=mm&r=g)
[Maria-developers] [Branch ~maria-captains/maria/5.1] Rev 2848: Fix a bunch of Windows warnings
by noreply@launchpad.net 21 Apr '10
by noreply@launchpad.net 21 Apr '10
21 Apr '10
------------------------------------------------------------
revno: 2848
committer: Bo Thorsen <bo(a)askmonty.org>
branch nick: trunk-winfix
timestamp: Wed 2010-04-21 02:25:59 +0200
message:
Fix a bunch of Windows warnings
modified:
extra/yassl/taocrypt/src/algebra.cpp
sql/hash_filo.cc
sql/mf_iocache.cc
sql/repl_failsafe.cc
sql/sql_repl.cc
storage/pbxt/src/locklist_xt.cc
storage/pbxt/src/pbms_enabled.cc
storage/xtradb/include/univ.i
storage/xtradb/sync/sync0sync.c
--
lp:maria
https://code.launchpad.net/~maria-captains/maria/5.1
Your team Maria developers is subscribed to branch lp:maria.
To unsubscribe from this branch go to https://code.launchpad.net/~maria-captains/maria/5.1/+edit-subscription
1
0