Commit ec55fec9 authored by unknown's avatar unknown
Browse files

Implement MySQL framework to support consistent read views in

cursors. This should fix Bug#11813 when InnoDB part is in 
(tested with a draft patch).
The idea of the patch is that if a storage engine supports
consistent read views, we open one when open a cursor,
set is as the active view when fetch from the cursor, and close
together with cursor close.


sql/examples/ha_archive.cc:
  - extend handlerton with cursors methods; fix coding style
sql/examples/ha_example.cc:
  - extend handlerton with cursors methods; fix coding style
sql/examples/ha_tina.cc:
  - extend handlerton with cursors methods; fix coding style
sql/ha_berkeley.cc:
  - extend handlerton with cursors methods
sql/ha_blackhole.cc:
  - extend handlerton with cursors methods; fix coding style
sql/ha_federated.cc:
  - extend handlerton with cursors methods; fix coding style
sql/ha_heap.cc:
  - extend handlerton with cursors methods; fix coding style
sql/ha_innodb.cc:
  - extend handlerton with cursors methods
sql/ha_myisam.cc:
  - extend handlerton with cursors methods; fix coding style
sql/ha_myisammrg.cc:
  - extend handlerton with cursors methods; fix coding style
sql/ha_ndbcluster.cc:
  - extend handlerton with cursors methods
sql/handler.h:
  - extend handlerton with cursors methods
sql/sql_select.cc:
  - create a consistent read view when we open a cursor,
    set it for a fetch, and free when we closing the cursor.
sql/sql_select.h:
  - add Cursor::ht_info to remember read views used in a cursor.
tests/mysql_client_test.c:
  Disable an assert that will be no longer valid when consistent
  read views in InnoDB are used.
parent b6823b66
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -140,16 +140,19 @@ static handlerton archive_hton = {
  "archive",
  0,       /* slot */
  0,       /* savepoint size. */
  0,       /* close_connection */
  0,       /* savepoint */
  0,       /* rollback to savepoint */
  0,       /* releas savepoint */
  0,       /* commit */
  0,       /* rollback */
  0,       /* prepare */
  0,       /* recover */
  0,       /* commit_by_xid */
  0,       /* rollback_by_xid */
  NULL,    /* close_connection */
  NULL,    /* savepoint */
  NULL,    /* rollback to savepoint */
  NULL,    /* releas savepoint */
  NULL,    /* commit */
  NULL,    /* rollback */
  NULL,    /* prepare */
  NULL,    /* recover */
  NULL,    /* commit_by_xid */
  NULL,    /* rollback_by_xid */
  NULL,    /* create_cursor_read_view */
  NULL,    /* set_cursor_read_view */
  NULL,    /* close_cursor_read_view */
  HTON_NO_FLAGS
};

+13 −10
Original line number Diff line number Diff line
@@ -77,16 +77,19 @@ static handlerton example_hton= {
  "CSV",
  0,       /* slot */
  0,       /* savepoint size. */
  0,       /* close_connection */
  0,       /* savepoint */
  0,       /* rollback to savepoint */
  0,       /* release savepoint */
  0,       /* commit */
  0,       /* rollback */
  0,       /* prepare */
  0,       /* recover */
  0,       /* commit_by_xid */
  0,       /* rollback_by_xid */
  NULL,    /* close_connection */
  NULL,    /* savepoint */
  NULL,    /* rollback to savepoint */
  NULL,    /* release savepoint */
  NULL,    /* commit */
  NULL,    /* rollback */
  NULL,    /* prepare */
  NULL,    /* recover */
  NULL,    /* commit_by_xid */
  NULL,    /* rollback_by_xid */
  NULL,    /* create_cursor_read_view */
  NULL,    /* set_cursor_read_view */
  NULL,    /* close_cursor_read_view */
  HTON_NO_FLAGS
};

+13 −10
Original line number Diff line number Diff line
@@ -58,16 +58,19 @@ static handlerton tina_hton= {
  "CSV",
  0,       /* slot */
  0,       /* savepoint size. */
  0,       /* close_connection */
  0,       /* savepoint */
  0,       /* rollback to savepoint */
  0,       /* release savepoint */
  0,       /* commit */
  0,       /* rollback */
  0,       /* prepare */
  0,       /* recover */
  0,       /* commit_by_xid */
  0,       /* rollback_by_xid */
  NULL,    /* close_connection */
  NULL,    /* savepoint */
  NULL,    /* rollback to savepoint */
  NULL,    /* release savepoint */
  NULL,    /* commit */
  NULL,    /* rollback */
  NULL,    /* prepare */
  NULL,    /* recover */
  NULL,    /* commit_by_xid */
  NULL,    /* rollback_by_xid */
  NULL,    /* create_cursor_read_view */
  NULL,    /* set_cursor_read_view */
  NULL,    /* close_cursor_read_view */
  HTON_NO_FLAGS
};

+3 −0
Original line number Diff line number Diff line
@@ -121,6 +121,9 @@ static handlerton berkeley_hton = {
  NULL, /* recover */
  NULL, /* commit_by_xid */
  NULL, /* rollback_by_xid */
  NULL, /* create_cursor_read_view */
  NULL, /* set_cursor_read_view */
  NULL, /* close_cursor_read_view */
  HTON_CLOSE_CURSORS_AT_COMMIT
};

+13 −10
Original line number Diff line number Diff line
@@ -30,16 +30,19 @@ static handlerton blackhole_hton= {
  "BLACKHOLE",
  0,       /* slot */
  0,       /* savepoint size. */
  0,       /* close_connection */
  0,       /* savepoint */
  0,       /* rollback to savepoint */
  0,       /* release savepoint */
  0,       /* commit */
  0,       /* rollback */
  0,       /* prepare */
  0,       /* recover */
  0,       /* commit_by_xid */
  0,       /* rollback_by_xid */
  NULL,    /* close_connection */
  NULL,    /* savepoint */
  NULL,    /* rollback to savepoint */
  NULL,    /* release savepoint */
  NULL,    /* commit */
  NULL,    /* rollback */
  NULL,    /* prepare */
  NULL,    /* recover */
  NULL,    /* commit_by_xid */
  NULL,    /* rollback_by_xid */
  NULL,    /* create_cursor_read_view */
  NULL,    /* set_cursor_read_view */
  NULL,    /* close_cursor_read_view */
  HTON_NO_FLAGS
};

Loading