mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
This commit is contained in:
commit
f0005562e1
39 changed files with 1642 additions and 1116 deletions
|
@ -52,7 +52,7 @@ extern ulint* srv_data_file_is_raw_partition;
|
|||
|
||||
extern ibool srv_auto_extend_last_data_file;
|
||||
extern ulint srv_last_file_size_max;
|
||||
extern ulint srv_auto_extend_increment;
|
||||
extern ulong srv_auto_extend_increment;
|
||||
|
||||
extern ibool srv_created_new_raw;
|
||||
|
||||
|
@ -112,11 +112,9 @@ extern ibool srv_use_checksums;
|
|||
extern ibool srv_set_thread_priorities;
|
||||
extern int srv_query_thread_priority;
|
||||
|
||||
extern ulint srv_max_purge_lag;
|
||||
extern ulong srv_max_purge_lag;
|
||||
extern ibool srv_use_awe;
|
||||
extern ibool srv_use_adaptive_hash_indexes;
|
||||
|
||||
extern ulint srv_max_purge_lag;
|
||||
/*-------------------------------------------*/
|
||||
|
||||
extern ulint srv_n_rows_inserted;
|
||||
|
|
|
@ -24,6 +24,32 @@ Created 12/9/1995 Heikki Tuuri
|
|||
#include "trx0sys.h"
|
||||
#include "trx0trx.h"
|
||||
|
||||
/*
|
||||
General philosophy of InnoDB redo-logs:
|
||||
|
||||
1) Every change to a contents of a data page must be done
|
||||
through mtr, which in mtr_commit() writes log records
|
||||
to the InnoDB redo log.
|
||||
|
||||
2) Normally these changes are performed using a mlog_write_ulint()
|
||||
or similar function.
|
||||
|
||||
3) In some page level operations only a code number of a
|
||||
c-function and its parameters are written to the log to
|
||||
reduce the size of the log.
|
||||
|
||||
3a) You should not add parameters to these kind of functions
|
||||
(e.g. trx_undo_header_create(), trx_undo_insert_header_reuse())
|
||||
|
||||
3b) You should not add such functionality which either change
|
||||
working when compared with the old or are dependent on data
|
||||
outside of the page. These kind of functions should implement
|
||||
self-contained page transformation and it should be unchanged
|
||||
if you don't have very essential reasons to change log
|
||||
semantics or format.
|
||||
|
||||
*/
|
||||
|
||||
/* Current free limit of space 0; protected by the log sys mutex; 0 means
|
||||
uninitialized */
|
||||
ulint log_fsp_current_free_limit = 0;
|
||||
|
|
|
@ -2501,7 +2501,7 @@ row_sel_store_mysql_rec(
|
|||
}
|
||||
|
||||
/* Handle UCS2 strings differently. */
|
||||
if (templ->mbminlen == 2) {
|
||||
if (pad_char != '\0' && templ->mbminlen == 2) {
|
||||
/* There are two bytes per char, so the length
|
||||
has to be an even number. */
|
||||
ut_a(!(templ->mysql_col_len & 1));
|
||||
|
|
|
@ -97,7 +97,7 @@ ulint srv_last_file_size_max = 0; /* if != 0, this tells
|
|||
the max size auto-extending
|
||||
may increase the last data
|
||||
file size */
|
||||
ulint srv_auto_extend_increment = 8; /* If the last data file is
|
||||
ulong srv_auto_extend_increment = 8; /* If the last data file is
|
||||
auto-extended, we add this
|
||||
many pages to it at a time */
|
||||
ulint* srv_data_file_is_raw_partition = NULL;
|
||||
|
@ -323,9 +323,6 @@ disable adaptive hash indexes */
|
|||
ibool srv_use_awe = FALSE;
|
||||
ibool srv_use_adaptive_hash_indexes = TRUE;
|
||||
|
||||
/* Maximum allowable purge history length. <=0 means 'infinite'. */
|
||||
ulint srv_max_purge_lag = 0;
|
||||
|
||||
/*-------------------------------------------*/
|
||||
ulint srv_n_spin_wait_rounds = 20;
|
||||
ulint srv_n_free_tickets_to_enter = 500;
|
||||
|
@ -972,6 +969,8 @@ srv_general_init(void)
|
|||
|
||||
/*======================= InnoDB Server FIFO queue =======================*/
|
||||
|
||||
/* Maximum allowable purge history length. <=0 means 'infinite'. */
|
||||
ulong srv_max_purge_lag = 0;
|
||||
|
||||
/*************************************************************************
|
||||
Puts an OS thread to wait if there are too many concurrent threads
|
||||
|
|
|
@ -440,7 +440,17 @@ loop:
|
|||
if ((trx->sess || (trx->conc_state == TRX_NOT_STARTED))) {
|
||||
trx = UT_LIST_GET_NEXT(trx_list, trx);
|
||||
} else if (trx->conc_state == TRX_PREPARED) {
|
||||
trx->sess = trx_dummy_sess;
|
||||
|
||||
/* Roll back all prepared transactions if
|
||||
innobase_force_recovery > 0 in my.cnf */
|
||||
|
||||
if (srv_force_recovery > 0) {
|
||||
trx->conc_state = TRX_ACTIVE;
|
||||
break;
|
||||
} else {
|
||||
trx->sess = trx_dummy_sess;
|
||||
trx = UT_LIST_GET_NEXT(trx_list, trx);
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -435,14 +435,14 @@ trx_lists_init_at_db_start(void)
|
|||
|
||||
if (undo->state == TRX_UNDO_PREPARED) {
|
||||
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"InnoDB: Transaction %lu %lu was in the XA prepared state.\n",
|
||||
ut_dulint_get_high(trx->id),
|
||||
ut_dulint_get_low(trx->id));
|
||||
|
||||
/* trx->conc_state = TRX_PREPARED; */
|
||||
trx->conc_state =
|
||||
TRX_ACTIVE;
|
||||
trx->conc_state = TRX_ACTIVE;
|
||||
|
||||
/* trx->conc_state = TRX_PREPARED;*/
|
||||
} else {
|
||||
trx->conc_state =
|
||||
TRX_COMMITTED_IN_MEMORY;
|
||||
|
@ -498,16 +498,15 @@ trx_lists_init_at_db_start(void)
|
|||
commit or abort decision from MySQL */
|
||||
|
||||
if (undo->state == TRX_UNDO_PREPARED) {
|
||||
|
||||
fprintf(stderr,
|
||||
fprintf(stderr,
|
||||
"InnoDB: Transaction %lu %lu was in the XA prepared state.\n",
|
||||
ut_dulint_get_high(trx->id),
|
||||
ut_dulint_get_low(trx->id));
|
||||
ut_dulint_get_high(trx->id),
|
||||
ut_dulint_get_low(trx->id));
|
||||
|
||||
/* trx->conc_state = TRX_PREPARED; */
|
||||
trx->conc_state =
|
||||
TRX_ACTIVE;
|
||||
trx->conc_state = TRX_ACTIVE;
|
||||
|
||||
/* trx->conc_state =
|
||||
TRX_PREPARED; */
|
||||
} else {
|
||||
trx->conc_state =
|
||||
TRX_COMMITTED_IN_MEMORY;
|
||||
|
@ -1638,10 +1637,13 @@ trx_print(
|
|||
fputs(", not started", f);
|
||||
break;
|
||||
case TRX_ACTIVE:
|
||||
case TRX_PREPARED:
|
||||
fprintf(f, ", ACTIVE %lu sec",
|
||||
(ulong)difftime(time(NULL), trx->start_time));
|
||||
break;
|
||||
case TRX_PREPARED:
|
||||
fprintf(f, ", ACTIVE (PREPARED) %lu sec",
|
||||
(ulong)difftime(time(NULL), trx->start_time));
|
||||
break;
|
||||
case TRX_COMMITTED_IN_MEMORY:
|
||||
fputs(", COMMITTED IN MEMORY", f);
|
||||
break;
|
||||
|
@ -1938,7 +1940,7 @@ trx_get_trx_by_xid(
|
|||
|
||||
if (xid->gtrid_length == trx->xid.gtrid_length &&
|
||||
xid->bqual_length == trx->xid.bqual_length &&
|
||||
memcmp(xid, &trx->xid,
|
||||
memcmp(xid->data, trx->xid.data,
|
||||
xid->gtrid_length +
|
||||
xid->bqual_length) == 0) {
|
||||
break;
|
||||
|
|
|
@ -599,11 +599,10 @@ trx_undo_read_xid(
|
|||
Adds the XA XID after an undo log old-style header. */
|
||||
static
|
||||
void
|
||||
trx_undo_header_add_xid(
|
||||
/*====================*/
|
||||
trx_undo_header_add_space_for_xid(
|
||||
/*==============================*/
|
||||
page_t* undo_page,/* in: undo log segment header page */
|
||||
trx_ulogf_t* log_hdr,/* in: undo log header */
|
||||
XID* xid, /* in: X/Open XA transaction identification */
|
||||
mtr_t* mtr) /* in: mtr */
|
||||
{
|
||||
trx_upagef_t* page_hdr;
|
||||
|
@ -620,9 +619,8 @@ trx_undo_header_add_xid(
|
|||
|
||||
new_free = free + (TRX_UNDO_LOG_XA_HDR_SIZE
|
||||
- TRX_UNDO_LOG_OLD_HDR_SIZE);
|
||||
trx_undo_write_xid(log_hdr, xid, mtr);
|
||||
|
||||
/* Now that we added the XID after the header, update the free offset
|
||||
/* Add space for a XID after the header, update the free offset
|
||||
fields on the undo log page and in the undo log header */
|
||||
|
||||
mlog_write_ulint(page_hdr + TRX_UNDO_PAGE_START, new_free,
|
||||
|
@ -1532,7 +1530,7 @@ trx_undo_create(
|
|||
|
||||
offset = trx_undo_header_create(undo_page, trx_id, mtr);
|
||||
|
||||
trx_undo_header_add_xid(undo_page, undo_page + offset, xid, mtr);
|
||||
trx_undo_header_add_space_for_xid(undo_page, undo_page + offset, mtr);
|
||||
|
||||
undo = trx_undo_mem_create(rseg, id, type, trx_id, xid,
|
||||
page_no, offset);
|
||||
|
@ -1599,7 +1597,7 @@ trx_undo_reuse_cached(
|
|||
|
||||
if (type == TRX_UNDO_INSERT) {
|
||||
offset = trx_undo_insert_header_reuse(undo_page, trx_id, mtr);
|
||||
trx_undo_header_add_xid(undo_page, undo_page + offset, xid,
|
||||
trx_undo_header_add_space_for_xid(undo_page, undo_page + offset,
|
||||
mtr);
|
||||
} else {
|
||||
ut_a(mach_read_from_2(undo_page + TRX_UNDO_PAGE_HDR
|
||||
|
@ -1607,7 +1605,7 @@ trx_undo_reuse_cached(
|
|||
== TRX_UNDO_UPDATE);
|
||||
|
||||
offset = trx_undo_header_create(undo_page, trx_id, mtr);
|
||||
trx_undo_header_add_xid(undo_page, undo_page + offset, xid,
|
||||
trx_undo_header_add_space_for_xid(undo_page, undo_page + offset,
|
||||
mtr);
|
||||
}
|
||||
|
||||
|
|
|
@ -1115,25 +1115,6 @@ mysql_fetch_field(MYSQL_RES *result)
|
|||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Get column lengths of the current row
|
||||
If one uses mysql_use_result, res->lengths contains the length information,
|
||||
else the lengths are calculated from the offset between pointers.
|
||||
**************************************************************************/
|
||||
|
||||
ulong * STDCALL
|
||||
mysql_fetch_lengths(MYSQL_RES *res)
|
||||
{
|
||||
MYSQL_ROW column;
|
||||
|
||||
if (!(column=res->current_row))
|
||||
return 0; /* Something is wrong */
|
||||
if (res->data)
|
||||
(*res->methods->fetch_lengths)(res->lengths, column, res->field_count);
|
||||
return res->lengths;
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Move to a specific row and column
|
||||
**************************************************************************/
|
||||
|
|
|
@ -558,6 +558,21 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
|||
create_flag=MY_DELETE_OLD;
|
||||
}
|
||||
|
||||
/*
|
||||
If a MRG_MyISAM table is in use, the mapped MyISAM tables are open,
|
||||
but no entry is made in the table cache for them.
|
||||
A TRUNCATE command checks for the table in the cache only and could
|
||||
be fooled to believe, the table is not open.
|
||||
Pull the emergency brake in this situation. (Bug #8306)
|
||||
*/
|
||||
if (test_if_reopen(filename))
|
||||
{
|
||||
my_printf_error(0, "MyISAM table '%s' is in use "
|
||||
"(most likely by a MERGE table). Try FLUSH TABLES.",
|
||||
MYF(0), name + dirname_length(name));
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((file= my_create_with_symlink(linkname_ptr,
|
||||
filename,
|
||||
0, O_RDWR | O_TRUNC,
|
||||
|
|
|
@ -50,7 +50,7 @@ if (pos > end_pos) \
|
|||
** In MySQL the server will handle version issues.
|
||||
******************************************************************************/
|
||||
|
||||
static MI_INFO *test_if_reopen(char *filename)
|
||||
MI_INFO *test_if_reopen(char *filename)
|
||||
{
|
||||
LIST *pos;
|
||||
|
||||
|
|
|
@ -708,6 +708,7 @@ void mi_copy_status(void* to,void *from);
|
|||
my_bool mi_check_status(void* param);
|
||||
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows);
|
||||
|
||||
extern MI_INFO *test_if_reopen(char *filename);
|
||||
my_bool check_table_is_closed(const char *name, const char *where);
|
||||
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup);
|
||||
int mi_open_keyfile(MYISAM_SHARE *share);
|
||||
|
|
|
@ -5,23 +5,40 @@ reset slave;
|
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
stop slave;
|
||||
drop database if exists federated;
|
||||
create database federated;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32) NOT NULL default '', `other` int(20) NOT NULL default '0', created datetime default '2004-04-04 04:04:04', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `other_key` (`other`)) DEFAULT CHARSET=latin1;
|
||||
drop database if exists federated;
|
||||
create database federated;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32) NOT NULL default '', `other` int(20) NOT NULL default '0', created datetime default '2004-04-04 04:04:04', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `other_key` (`other`)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 (name, other) values ('First Name', 11111);
|
||||
insert into federated.t1 (name, other) values ('Second Name', 22222);
|
||||
insert into federated.t1 (name, other) values ('Third Name', 33333);
|
||||
insert into federated.t1 (name, other) values ('Fourth Name', 44444);
|
||||
insert into federated.t1 (name, other) values ('Fifth Name', 55555);
|
||||
insert into federated.t1 (name, other) values ('Sixth Name', 66666);
|
||||
insert into federated.t1 (name, other) values ('Seventh Name', 77777);
|
||||
insert into federated.t1 (name, other) values ('Eigth Name', 88888);
|
||||
insert into federated.t1 (name, other) values ('Ninth Name', 99999);
|
||||
insert into federated.t1 (name, other) values ('Tenth Name', 101010);
|
||||
select * from federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32) NOT NULL default '',
|
||||
`other` int(20) NOT NULL default '0',
|
||||
`created` datetime default '2004-04-04 04:04:04',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `name` (`name`),
|
||||
KEY `other_key` (`other`))
|
||||
DEFAULT CHARSET=latin1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
CREATE DATABASE federated;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32) NOT NULL default '',
|
||||
`other` int(20) NOT NULL default '0',
|
||||
`created` datetime default '2004-04-04 04:04:04',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `name` (`name`),
|
||||
KEY `other_key` (`other`))
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('First Name', 11111);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Second Name', 22222);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Third Name', 33333);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Fourth Name', 44444);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Fifth Name', 55555);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Sixth Name', 66666);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Seventh Name', 77777);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Eigth Name', 88888);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Ninth Name', 99999);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Tenth Name', 101010);
|
||||
SELECT * FROM federated.t1;
|
||||
id name other created
|
||||
1 First Name 11111 2004-04-04 04:04:04
|
||||
2 Second Name 22222 2004-04-04 04:04:04
|
||||
|
@ -33,19 +50,19 @@ id name other created
|
|||
8 Eigth Name 88888 2004-04-04 04:04:04
|
||||
9 Ninth Name 99999 2004-04-04 04:04:04
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
select * from federated.t1 where id = 5;
|
||||
SELECT * FROM federated.t1 WHERE id = 5;
|
||||
id name other created
|
||||
5 Fifth Name 55555 2004-04-04 04:04:04
|
||||
select * from federated.t1 where name = 'Sixth Name';
|
||||
SELECT * FROM federated.t1 WHERE name = 'Sixth Name';
|
||||
id name other created
|
||||
6 Sixth Name 66666 2004-04-04 04:04:04
|
||||
select * from federated.t1 where id = 6 and name = 'Sixth Name';
|
||||
SELECT * FROM federated.t1 WHERE id = 6 and name = 'Sixth Name';
|
||||
id name other created
|
||||
6 Sixth Name 66666 2004-04-04 04:04:04
|
||||
select * from federated.t1 where other = 44444;
|
||||
SELECT * FROM federated.t1 WHERE other = 44444;
|
||||
id name other created
|
||||
4 Fourth Name 44444 2004-04-04 04:04:04
|
||||
select * from federated.t1 where name like '%th%';
|
||||
SELECT * FROM federated.t1 WHERE name like '%th%';
|
||||
id name other created
|
||||
3 Third Name 33333 2004-04-04 04:04:04
|
||||
4 Fourth Name 44444 2004-04-04 04:04:04
|
||||
|
@ -55,15 +72,15 @@ id name other created
|
|||
8 Eigth Name 88888 2004-04-04 04:04:04
|
||||
9 Ninth Name 99999 2004-04-04 04:04:04
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
update federated.t1 set name = '3rd name' where id = 3;
|
||||
select * from federated.t1 where name = '3rd name';
|
||||
UPDATE federated.t1 SET name = '3rd name' WHERE id = 3;
|
||||
SELECT * FROM federated.t1 WHERE name = '3rd name';
|
||||
id name other created
|
||||
3 3rd name 33333 2004-04-04 04:04:04
|
||||
update federated.t1 set name = 'Third name' where name = '3rd name';
|
||||
select * from federated.t1 where name = 'Third name';
|
||||
UPDATE federated.t1 SET name = 'Third name' WHERE name = '3rd name';
|
||||
SELECT * FROM federated.t1 WHERE name = 'Third name';
|
||||
id name other created
|
||||
3 Third name 33333 2004-04-04 04:04:04
|
||||
select * from federated.t1 order by id DESC;
|
||||
SELECT * FROM federated.t1 ORDER BY id DESC;
|
||||
id name other created
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
9 Ninth Name 99999 2004-04-04 04:04:04
|
||||
|
@ -75,7 +92,7 @@ id name other created
|
|||
3 Third name 33333 2004-04-04 04:04:04
|
||||
2 Second Name 22222 2004-04-04 04:04:04
|
||||
1 First Name 11111 2004-04-04 04:04:04
|
||||
select * from federated.t1 order by name;
|
||||
SELECT * FROM federated.t1 ORDER BY name;
|
||||
id name other created
|
||||
8 Eigth Name 88888 2004-04-04 04:04:04
|
||||
5 Fifth Name 55555 2004-04-04 04:04:04
|
||||
|
@ -87,7 +104,7 @@ id name other created
|
|||
6 Sixth Name 66666 2004-04-04 04:04:04
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
3 Third name 33333 2004-04-04 04:04:04
|
||||
select * from federated.t1 order by name DESC;
|
||||
SELECT * FROM federated.t1 ORDER BY name DESC;
|
||||
id name other created
|
||||
3 Third name 33333 2004-04-04 04:04:04
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
|
@ -99,7 +116,7 @@ id name other created
|
|||
1 First Name 11111 2004-04-04 04:04:04
|
||||
5 Fifth Name 55555 2004-04-04 04:04:04
|
||||
8 Eigth Name 88888 2004-04-04 04:04:04
|
||||
select * from federated.t1 order by name ASC;
|
||||
SELECT * FROM federated.t1 ORDER BY name ASC;
|
||||
id name other created
|
||||
8 Eigth Name 88888 2004-04-04 04:04:04
|
||||
5 Fifth Name 55555 2004-04-04 04:04:04
|
||||
|
@ -111,7 +128,7 @@ id name other created
|
|||
6 Sixth Name 66666 2004-04-04 04:04:04
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
3 Third name 33333 2004-04-04 04:04:04
|
||||
select * from federated.t1 group by other;
|
||||
SELECT * FROM federated.t1 GROUP BY other;
|
||||
id name other created
|
||||
1 First Name 11111 2004-04-04 04:04:04
|
||||
2 Second Name 22222 2004-04-04 04:04:04
|
||||
|
@ -123,52 +140,65 @@ id name other created
|
|||
8 Eigth Name 88888 2004-04-04 04:04:04
|
||||
9 Ninth Name 99999 2004-04-04 04:04:04
|
||||
10 Tenth Name 101010 2004-04-04 04:04:04
|
||||
delete from federated.t1 where id = 5;
|
||||
select * from federated.t1 where id = 5;
|
||||
DELETE FROM federated.t1 WHERE id = 5;
|
||||
SELECT * FROM federated.t1 WHERE id = 5;
|
||||
id name other created
|
||||
delete from federated.t1;
|
||||
select * from federated.t1 where id = 5;
|
||||
DELETE FROM federated.t1;
|
||||
SELECT * FROM federated.t1 WHERE id = 5;
|
||||
id name other created
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) );
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 (name, other) values ('First Name', 11111);
|
||||
insert into federated.t1 (name, other) values ('Second Name', NULL);
|
||||
insert into federated.t1 (name, other) values ('Third Name', 33333);
|
||||
insert into federated.t1 (name, other) values (NULL, NULL);
|
||||
insert into federated.t1 (name, other) values ('Fifth Name', 55555);
|
||||
insert into federated.t1 (name, other) values ('Sixth Name', 66666);
|
||||
insert into federated.t1 (name) values ('Seventh Name');
|
||||
insert into federated.t1 (name, other) values ('Eigth Name', 88888);
|
||||
insert into federated.t1 (name, other) values ('Ninth Name', 99999);
|
||||
insert into federated.t1 (other) values ('fee fie foe fum');
|
||||
select * from federated.t1 where other IS NULL;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32),
|
||||
`other` varchar(20),
|
||||
PRIMARY KEY (`id`) );
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32),
|
||||
`other` varchar(20),
|
||||
PRIMARY KEY (`id`) )
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('First Name', 11111);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Second Name', NULL);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Third Name', 33333);
|
||||
INSERT INTO federated.t1 (name, other) VALUES (NULL, NULL);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Fifth Name', 55555);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Sixth Name', 66666);
|
||||
INSERT INTO federated.t1 (name) VALUES ('Seventh Name');
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Eigth Name', 88888);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Ninth Name', 99999);
|
||||
INSERT INTO federated.t1 (other) VALUES ('fee fie foe fum');
|
||||
SELECT * FROM federated.t1 WHERE other IS NULL;
|
||||
id name other
|
||||
2 Second Name NULL
|
||||
4 NULL NULL
|
||||
7 Seventh Name NULL
|
||||
select * from federated.t1 where name IS NULL;
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL;
|
||||
id name other
|
||||
4 NULL NULL
|
||||
10 NULL fee fie foe fum
|
||||
select * from federated.t1 where name IS NULL and other IS NULL;
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL and other IS NULL;
|
||||
id name other
|
||||
4 NULL NULL
|
||||
select * from federated.t1 where name IS NULL or other IS NULL;
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL or other IS NULL;
|
||||
id name other
|
||||
2 Second Name NULL
|
||||
4 NULL NULL
|
||||
7 Seventh Name NULL
|
||||
10 NULL fee fie foe fum
|
||||
update federated.t1 set name = 'Fourth Name', other = 'four four four' where name IS NULL and other IS NULL;
|
||||
update federated.t1 set other = 'two two two two' where name = 'Second Name';
|
||||
update federated.t1 set other = 'seven seven' where name like 'Sec%';
|
||||
update federated.t1 set other = 'seven seven' where name = 'Seventh Name';
|
||||
update federated.t1 set name = 'Tenth Name' where other like 'fee fie%';
|
||||
select * from federated.t1 where name IS NULL or other IS NULL ;
|
||||
UPDATE federated.t1
|
||||
SET name = 'Fourth Name', other = 'four four four'
|
||||
WHERE name IS NULL AND other IS NULL;
|
||||
UPDATE federated.t1 SET other = 'two two two two' WHERE name = 'Second Name';
|
||||
UPDATE federated.t1 SET other = 'seven seven' WHERE name like 'Sec%';
|
||||
UPDATE federated.t1 SET other = 'seven seven' WHERE name = 'Seventh Name';
|
||||
UPDATE federated.t1 SET name = 'Tenth Name' WHERE other like 'fee fie%';
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL OR other IS NULL ;
|
||||
id name other
|
||||
select * from federated.t1;
|
||||
SELECT * FROM federated.t1;
|
||||
id name other
|
||||
1 First Name 11111
|
||||
2 Second Name seven seven
|
||||
|
@ -180,149 +210,206 @@ id name other
|
|||
8 Eigth Name 88888
|
||||
9 Ninth Name 99999
|
||||
10 Tenth Name fee fie foe fum
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name`
|
||||
varchar(32) NOT NULL DEFAULT '', `other` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`id`), key nameoth (name, other) );
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32) NOT NULL DEFAULT '', `other` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`id`), key nameoth (name, other)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 (name, other) values ('First Name', '1111');
|
||||
insert into federated.t1 (name, other) values ('Second Name', '2222');
|
||||
insert into federated.t1 (name, other) values ('Third Name', '3333');
|
||||
select * from federated.t1 where name = 'Second Name';
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32) NOT NULL DEFAULT '',
|
||||
`other` varchar(20) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY nameoth (name, other) );
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32) NOT NULL DEFAULT '',
|
||||
`other` varchar(20) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY nameoth (name, other))
|
||||
ENGINE="FEDERATED" DEFAULT
|
||||
CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('First Name', '1111');
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Second Name', '2222');
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Third Name', '3333');
|
||||
SELECT * FROM federated.t1 WHERE name = 'Second Name';
|
||||
id name other
|
||||
2 Second Name 2222
|
||||
select * from federated.t1 where other = '2222';
|
||||
SELECT * FROM federated.t1 WHERE other = '2222';
|
||||
id name other
|
||||
2 Second Name 2222
|
||||
select * from federated.t1 where name = 'Third Name';
|
||||
SELECT * FROM federated.t1 WHERE name = 'Third Name';
|
||||
id name other
|
||||
3 Third Name 3333
|
||||
select * from federated.t1 where name = 'Third Name' and other = '3333';
|
||||
SELECT * FROM federated.t1 WHERE name = 'Third Name' AND other = '3333';
|
||||
id name other
|
||||
3 Third Name 3333
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1
|
||||
(id int NOT NULL auto_increment,
|
||||
name char(32) NOT NULL DEFAULT '',
|
||||
bincol binary(4) NOT NULL,
|
||||
floatval decimal(5,2) NOT NULL DEFAULT 0.0,
|
||||
other int NOT NULL DEFAULT 0,
|
||||
primary key(id),
|
||||
key nameoth(name, other),
|
||||
key bincol(bincol),
|
||||
key floatval(floatval));
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1
|
||||
(id int NOT NULL auto_increment,
|
||||
name char(32) NOT NULL DEFAULT '',
|
||||
bincol binary(4) NOT NULL,
|
||||
floatval decimal(5,2) NOT NULL DEFAULT 0.0,
|
||||
other int NOT NULL DEFAULT 0,
|
||||
primary key(id),
|
||||
key nameoth(name,other),
|
||||
key bincol(bincol),
|
||||
key floatval(floatval))
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 (name, bincol, floatval, other) values ('first', 0x65, 11.11, 1111);
|
||||
insert into federated.t1 (name, bincol, floatval, other) values ('second', 0x66, 22.22, 2222);
|
||||
insert into federated.t1 (name, bincol, floatval, other) values ('third', 'g', 22.22, 2222);
|
||||
select * from federated.t1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int NOT NULL auto_increment,
|
||||
`name` char(32) NOT NULL DEFAULT '',
|
||||
`bincol` binary(4) NOT NULL,
|
||||
`floatval` decimal(5,2) NOT NULL DEFAULT 0.0,
|
||||
`other` int NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (id),
|
||||
KEY nameoth(name, other),
|
||||
KEY bincol(bincol),
|
||||
KEY floatval(floatval));
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int NOT NULL auto_increment,
|
||||
`name` char(32) NOT NULL DEFAULT '',
|
||||
`bincol` binary(4) NOT NULL,
|
||||
`floatval` decimal(5,2) NOT NULL DEFAULT 0.0,
|
||||
`other` int NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (id),
|
||||
KEY nameoth(name,other),
|
||||
KEY bincol(bincol),
|
||||
KEY floatval(floatval))
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1 (name, bincol, floatval, other)
|
||||
VALUES ('first', 0x65, 11.11, 1111);
|
||||
INSERT INTO federated.t1 (name, bincol, floatval, other)
|
||||
VALUES ('second', 0x66, 22.22, 2222);
|
||||
INSERT INTO federated.t1 (name, bincol, floatval, other)
|
||||
VALUES ('third', 'g', 22.22, 2222);
|
||||
SELECT * FROM federated.t1;
|
||||
id name bincol floatval other
|
||||
1 first e 11.11 1111
|
||||
2 second f 22.22 2222
|
||||
3 third g 22.22 2222
|
||||
select * from federated.t1 where name = 'second';
|
||||
SELECT * FROM federated.t1 WHERE name = 'second';
|
||||
id name bincol floatval other
|
||||
2 second f 22.22 2222
|
||||
select * from federated.t1 where bincol= 'f';
|
||||
SELECT * FROM federated.t1 WHERE bincol= 'f';
|
||||
id name bincol floatval other
|
||||
2 second f 22.22 2222
|
||||
select * from federated.t1 where bincol= 0x66;
|
||||
SELECT * FROM federated.t1 WHERE bincol= 0x66;
|
||||
id name bincol floatval other
|
||||
2 second f 22.22 2222
|
||||
select * from federated.t1 where bincol= 0x67;
|
||||
SELECT * FROM federated.t1 WHERE bincol= 0x67;
|
||||
id name bincol floatval other
|
||||
3 third g 22.22 2222
|
||||
select * from federated.t1 where bincol= 'g';
|
||||
SELECT * FROM federated.t1 WHERE bincol= 'g';
|
||||
id name bincol floatval other
|
||||
3 third g 22.22 2222
|
||||
select * from federated.t1 where floatval=11.11;
|
||||
SELECT * FROM federated.t1 WHERE floatval=11.11;
|
||||
id name bincol floatval other
|
||||
1 first e 11.11 1111
|
||||
select * from federated.t1 where name='third';
|
||||
SELECT * FROM federated.t1 WHERE name='third';
|
||||
id name bincol floatval other
|
||||
3 third g 22.22 2222
|
||||
select * from federated.t1 where other=2222;
|
||||
SELECT * FROM federated.t1 WHERE other=2222;
|
||||
id name bincol floatval other
|
||||
2 second f 22.22 2222
|
||||
3 third g 22.22 2222
|
||||
select * from federated.t1 where name='third' and other=2222;
|
||||
SELECT * FROM federated.t1 WHERE name='third' and other=2222;
|
||||
id name bincol floatval other
|
||||
3 third g 22.22 2222
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) DEFAULT CHARSET=latin1;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 values (NULL, NULL, NULL, NULL);
|
||||
insert into federated.t1 values ();
|
||||
insert into federated.t1 (id) values (1);
|
||||
insert into federated.t1 (name, floatval, other) values ('foo', 33.33333332, NULL);
|
||||
insert into federated.t1 (name, floatval, other) values (0, 00.3333, NULL);
|
||||
select * from federated.t1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int,
|
||||
`name` varchar(32),
|
||||
`floatval` float,
|
||||
`other` int)
|
||||
DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int,
|
||||
`name` varchar(32),
|
||||
`floatval` float,
|
||||
`other` int)
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1 values (NULL, NULL, NULL, NULL);
|
||||
INSERT INTO federated.t1 values ();
|
||||
INSERT INTO federated.t1 (id) VALUES (1);
|
||||
INSERT INTO federated.t1 (name, floatval, other)
|
||||
VALUES ('foo', 33.33333332, NULL);
|
||||
INSERT INTO federated.t1 (name, floatval, other)
|
||||
VALUES (0, 00.3333, NULL);
|
||||
SELECT * FROM federated.t1;
|
||||
id name floatval other
|
||||
NULL NULL NULL NULL
|
||||
NULL NULL NULL NULL
|
||||
1 NULL NULL NULL
|
||||
NULL foo 33.3333 NULL
|
||||
NULL 0 0.3333 NULL
|
||||
select count(*) from federated.t1 where id IS NULL and name IS NULL and floatval IS NULL and other IS NULL;
|
||||
SELECT count(*) FROM federated.t1
|
||||
WHERE id IS NULL
|
||||
AND name IS NULL
|
||||
AND floatval IS NULL
|
||||
AND other IS NULL;
|
||||
count(*)
|
||||
2
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( blurb_id int NOT NULL DEFAULT 0, blurb text default '', primary key(blurb_id)) DEFAULT CHARSET=latin1;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( blurb_id int NOT NULL DEFAULT 0, blurb text default '', primary key(blurb_id)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`blurb_id` int NOT NULL DEFAULT 0,
|
||||
`blurb` text default '',
|
||||
PRIMARY KEY (blurb_id))
|
||||
DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`blurb_id` int NOT NULL DEFAULT 0,
|
||||
`blurb` text default '',
|
||||
PRIMARY KEY (blurb_id))
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.");
|
||||
INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.");
|
||||
INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. ");
|
||||
INSERT INTO federated.t1 VALUES(4, "Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt:");
|
||||
select * from federated.t1;
|
||||
SELECT * FROM federated.t1;
|
||||
blurb_id blurb
|
||||
1 MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.
|
||||
2 All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.
|
||||
3 A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined.
|
||||
4 Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt:
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (a int not null, b int not null, c int not null, primary key (a),key(b));
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
|
||||
explain select * from federated.t1 order by a;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`a` int NOT NULL,
|
||||
`b` int NOT NULL,
|
||||
`c` int NOT NULL,
|
||||
PRIMARY KEY (a),key(b));
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`a` int NOT NULL,
|
||||
`b` int NOT NULL,
|
||||
`c` int NOT NULL,
|
||||
PRIMARY KEY (a),
|
||||
KEY (b))
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1 VALUES (3,3,3),(1,1,1),(2,2,2),(4,4,4);
|
||||
EXPLAIN SELECT * FROM federated.t1 ORDER BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 Using filesort
|
||||
explain select * from federated.t1 order by b;
|
||||
EXPLAIN SELECT * FROM federated.t1 ORDER BY b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 Using filesort
|
||||
explain select * from federated.t1 order by c;
|
||||
EXPLAIN SELECT * FROM federated.t1 ORDER BY c;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 Using filesort
|
||||
explain select a from federated.t1 order by a;
|
||||
EXPLAIN SELECT a FROM federated.t1 ORDER BY a;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 Using filesort
|
||||
explain select b from federated.t1 order by b;
|
||||
EXPLAIN SELECT b FROM federated.t1 ORDER BY b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 Using filesort
|
||||
explain select a,b from federated.t1 order by b;
|
||||
EXPLAIN SELECT a,b FROM federated.t1 ORDER BY b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 10000 Using filesort
|
||||
explain select a,b from federated.t1;
|
||||
EXPLAIN SELECT a,b FROM federated.t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 10000
|
||||
explain select a,b,c from federated.t1;
|
||||
EXPLAIN SELECT a,b,c FROM federated.t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 10000
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
|
||||
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
|
||||
i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
|
||||
|
@ -447,10 +534,11 @@ int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
|
|||
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
|
||||
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
||||
int, i999 int, i1000 int, b blob) row_format=dynamic;
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
|
||||
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1
|
||||
(i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int,
|
||||
i17 int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
|
||||
i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
|
||||
int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int,
|
||||
i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51
|
||||
|
@ -572,8 +660,13 @@ int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
|
|||
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
|
||||
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
|
||||
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
||||
int, i999 int, i1000 int, b blob) row_format=dynamic ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
int, i999 int, i1000 int, b blob)
|
||||
row_format=dynamic
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1
|
||||
values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
|
@ -612,64 +705,108 @@ insert into federated.t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "PatrickG");
|
||||
update federated.t1 set b=repeat('a',256);
|
||||
update federated.t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0, i10=0;
|
||||
select * from federated.t1 where i9=0 and i10=0;
|
||||
UPDATE federated.t1 SET b=repeat('a',256);
|
||||
UPDATE federated.t1 SET i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0, i10=0;
|
||||
SELECT * FROM federated.t1 WHERE i9=0 and i10=0;
|
||||
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b
|
||||
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 PatrickG
|
||||
update federated.t1 set i50=20;
|
||||
select * from federated.t1;
|
||||
UPDATE federated.t1 SET i50=20;
|
||||
SELECT * FROM federated.t1;
|
||||
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b
|
||||
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 PatrickG
|
||||
delete from federated.t1 where i51=20;
|
||||
select * from federated.t1;
|
||||
DELETE FROM federated.t1 WHERE i51=20;
|
||||
SELECT * FROM federated.t1;
|
||||
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b
|
||||
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 PatrickG
|
||||
delete from federated.t1 where i50=20;
|
||||
select * from federated.t1;
|
||||
DELETE FROM federated.t1 WHERE i50=20;
|
||||
SELECT * FROM federated.t1;
|
||||
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code), index(fileguts(10))) DEFAULT CHARSET=latin1;
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code), index(fileguts(10))) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 (code, fileguts, creation_date) values ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03');
|
||||
insert into federated.t1 (code, fileguts, creation_date) values ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04');
|
||||
insert into federated.t1 (code, fileguts, creation_date) values ('DEUEUEUEUEUEUEUEUEU', 'jimbob', '2004-04-04 04:04:04');
|
||||
select * from federated.t1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', PRIMARY KEY(id), index(code), index(fileguts(10))) DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
id int NOT NULL auto_increment,
|
||||
code char(20) NOT NULL,
|
||||
fileguts blob NOT NULL,
|
||||
creation_date datetime,
|
||||
entered_time datetime default '2004-04-04 04:04:04',
|
||||
PRIMARY KEY(id),
|
||||
index(code),
|
||||
index(fileguts(10)))
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03');
|
||||
INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04');
|
||||
INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('DEUEUEUEUEUEUEUEUEU', 'jimbob', '2004-04-04 04:04:04');
|
||||
SELECT * FROM federated.t1;
|
||||
id code fileguts creation_date entered_time
|
||||
1 ASDFWERQWETWETAWETA *()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[ 2003-03-03 03:03:03 2004-04-04 04:04:04
|
||||
2 DEUEUEUEUEUEUEUEUEU *()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[ 2004-04-04 04:04:04 2004-04-04 04:04:04
|
||||
3 DEUEUEUEUEUEUEUEUEU jimbob 2004-04-04 04:04:04 2004-04-04 04:04:04
|
||||
select * from federated.t1 where fileguts = 'jimbob';
|
||||
SELECT * FROM federated.t1 WHERE fileguts = 'jimbob';
|
||||
id code fileguts creation_date entered_time
|
||||
3 DEUEUEUEUEUEUEUEUEU jimbob 2004-04-04 04:04:04 2004-04-04 04:04:04
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `country_id` int(20) NOT NULL DEFAULT 0, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`), key (country_id));
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `country_id` int(20) NOT NULL DEFAULT 0, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`), key (country_id) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 (name, country_id, other) values ('Kumar', 1, 11111);
|
||||
insert into federated.t1 (name, country_id, other) values ('Lenz', 2, 22222);
|
||||
insert into federated.t1 (name, country_id, other) values ('Marizio', 3, 33333);
|
||||
insert into federated.t1 (name, country_id, other) values ('Monty', 4, 33333);
|
||||
insert into federated.t1 (name, country_id, other) values ('Sanja', 5, 33333);
|
||||
drop table if exists federated.countries;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (`a` BLOB);
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`a` BLOB)
|
||||
ENGINE="FEDERATED"
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1 VALUES (0x00);
|
||||
INSERT INTO federated.t1 VALUES (0x0001);
|
||||
INSERT INTO federated.t1 VALUES (0x0100);
|
||||
SELECT HEX(a) FROM federated.t1;
|
||||
HEX(a)
|
||||
00
|
||||
0001
|
||||
0100
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`country_id` int(20) NOT NULL DEFAULT 0,
|
||||
`name` varchar(32),
|
||||
`other` varchar(20),
|
||||
PRIMARY KEY (`id`),
|
||||
key (country_id));
|
||||
DROP TABLE IF EXISTS federated.countries;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'countries'
|
||||
CREATE TABLE federated.countries ( `id` int(20) NOT NULL auto_increment, `country` varchar(32), primary key (id));
|
||||
insert into federated.countries (country) values ('India');
|
||||
insert into federated.countries (country) values ('Germany');
|
||||
insert into federated.countries (country) values ('Italy');
|
||||
insert into federated.countries (country) values ('Finland');
|
||||
insert into federated.countries (country) values ('Ukraine');
|
||||
select federated.t1.*, federated.countries.country from federated.t1 left join federated.countries on federated.t1.country_id = federated.countries.id;
|
||||
CREATE TABLE federated.countries (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`country` varchar(32),
|
||||
PRIMARY KEY (id));
|
||||
INSERT INTO federated.countries (country) VALUES ('India');
|
||||
INSERT INTO federated.countries (country) VALUES ('Germany');
|
||||
INSERT INTO federated.countries (country) VALUES ('Italy');
|
||||
INSERT INTO federated.countries (country) VALUES ('Finland');
|
||||
INSERT INTO federated.countries (country) VALUES ('Ukraine');
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`country_id` int(20) NOT NULL DEFAULT 0,
|
||||
`name` varchar(32),
|
||||
`other` varchar(20),
|
||||
PRIMARY KEY (`id`),
|
||||
KEY (country_id) )
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
||||
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Kumar', 1, 11111);
|
||||
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Lenz', 2, 22222);
|
||||
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Marizio', 3, 33333);
|
||||
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Monty', 4, 33333);
|
||||
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Sanja', 5, 33333);
|
||||
SELECT federated.t1.*, federated.countries.country
|
||||
FROM federated.t1 left join federated.countries
|
||||
ON federated.t1.country_id = federated.countries.id;
|
||||
id country_id name other country
|
||||
1 1 Kumar 11111 India
|
||||
2 2 Lenz 22222 Germany
|
||||
3 3 Marizio 33333 Italy
|
||||
4 4 Monty 33333 Finland
|
||||
5 5 Sanja 33333 Ukraine
|
||||
drop table federated.countries;
|
||||
drop table if exists federated.t1;
|
||||
drop database if exists federated;
|
||||
drop table if exists federated.t1;
|
||||
drop database if exists federated;
|
||||
DROP TABLE federated.countries;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
|
|
|
@ -906,6 +906,7 @@ truncate table t1;
|
|||
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
|
||||
commit;
|
||||
truncate table t1;
|
||||
truncate table t1;
|
||||
select * from t1;
|
||||
a
|
||||
insert into t1 values(1),(2);
|
||||
|
@ -924,6 +925,7 @@ a
|
|||
1
|
||||
2
|
||||
truncate table t1;
|
||||
truncate table t1;
|
||||
insert into t1 values(1),(2);
|
||||
delete from t1;
|
||||
select * from t1;
|
||||
|
@ -1637,14 +1639,14 @@ t2 CREATE TABLE `t2` (
|
|||
drop table t2, t1;
|
||||
show status like "binlog_cache_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_use 152
|
||||
Binlog_cache_use 154
|
||||
show status like "binlog_cache_disk_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_disk_use 0
|
||||
create table t1 (a int) engine=innodb;
|
||||
show status like "binlog_cache_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_use 153
|
||||
Binlog_cache_use 155
|
||||
show status like "binlog_cache_disk_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_disk_use 1
|
||||
|
@ -1653,7 +1655,7 @@ delete from t1;
|
|||
commit;
|
||||
show status like "binlog_cache_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_use 154
|
||||
Binlog_cache_use 156
|
||||
show status like "binlog_cache_disk_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_disk_use 1
|
||||
|
|
|
@ -568,6 +568,24 @@ select count(*) from t1 where a is null;
|
|||
count(*)
|
||||
2
|
||||
drop table t1;
|
||||
create table t1 (c1 int, index(c1));
|
||||
create table t2 (c1 int, index(c1)) engine=merge union=(t1);
|
||||
insert into t1 values (1);
|
||||
flush tables;
|
||||
select * from t2;
|
||||
c1
|
||||
1
|
||||
flush tables;
|
||||
truncate table t1;
|
||||
insert into t1 values (1);
|
||||
flush tables;
|
||||
select * from t2;
|
||||
c1
|
||||
1
|
||||
truncate table t1;
|
||||
ERROR HY000: MyISAM table 't1' is in use (most likely by a MERGE table). Try FLUSH TABLES.
|
||||
insert into t1 values (1);
|
||||
drop table t1,t2;
|
||||
set storage_engine=MyISAM;
|
||||
drop table if exists t1,t2,t3;
|
||||
--- Testing varchar ---
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Patrick Galbraith should fix this
|
|
@ -10,206 +10,304 @@ stop slave;
|
|||
|
||||
--disable_warnings
|
||||
# at this point, we are connected to master
|
||||
drop database if exists federated;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
--enable_warnings
|
||||
create database federated;
|
||||
CREATE DATABASE federated;
|
||||
|
||||
# I wanted to use timestamp, but results will fail if so!!!
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32) NOT NULL default '', `other` int(20) NOT NULL default '0', created datetime default '2004-04-04 04:04:04', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `other_key` (`other`)) DEFAULT CHARSET=latin1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32) NOT NULL default '',
|
||||
`other` int(20) NOT NULL default '0',
|
||||
`created` datetime default '2004-04-04 04:04:04',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `name` (`name`),
|
||||
KEY `other_key` (`other`))
|
||||
DEFAULT CHARSET=latin1;
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
drop database if exists federated;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
--enable_warnings
|
||||
create database federated;
|
||||
CREATE DATABASE federated;
|
||||
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32) NOT NULL default '', `other` int(20) NOT NULL default '0', created datetime default '2004-04-04 04:04:04', PRIMARY KEY (`id`), KEY `name` (`name`), KEY `other_key` (`other`)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32) NOT NULL default '',
|
||||
`other` int(20) NOT NULL default '0',
|
||||
`created` datetime default '2004-04-04 04:04:04',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `name` (`name`),
|
||||
KEY `other_key` (`other`))
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
insert into federated.t1 (name, other) values ('First Name', 11111);
|
||||
insert into federated.t1 (name, other) values ('Second Name', 22222);
|
||||
insert into federated.t1 (name, other) values ('Third Name', 33333);
|
||||
insert into federated.t1 (name, other) values ('Fourth Name', 44444);
|
||||
insert into federated.t1 (name, other) values ('Fifth Name', 55555);
|
||||
insert into federated.t1 (name, other) values ('Sixth Name', 66666);
|
||||
insert into federated.t1 (name, other) values ('Seventh Name', 77777);
|
||||
insert into federated.t1 (name, other) values ('Eigth Name', 88888);
|
||||
insert into federated.t1 (name, other) values ('Ninth Name', 99999);
|
||||
insert into federated.t1 (name, other) values ('Tenth Name', 101010);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('First Name', 11111);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Second Name', 22222);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Third Name', 33333);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Fourth Name', 44444);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Fifth Name', 55555);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Sixth Name', 66666);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Seventh Name', 77777);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Eigth Name', 88888);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Ninth Name', 99999);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Tenth Name', 101010);
|
||||
|
||||
# basic select
|
||||
select * from federated.t1;
|
||||
# with primary key index_read_idx
|
||||
select * from federated.t1 where id = 5;
|
||||
SELECT * FROM federated.t1;
|
||||
# with PRIMARY KEY index_read_idx
|
||||
SELECT * FROM federated.t1 WHERE id = 5;
|
||||
# with regular key index_read -> index_read_idx
|
||||
select * from federated.t1 where name = 'Sixth Name';
|
||||
# regular and primary key index_read_idx
|
||||
select * from federated.t1 where id = 6 and name = 'Sixth Name';
|
||||
SELECT * FROM federated.t1 WHERE name = 'Sixth Name';
|
||||
# regular and PRIMARY KEY index_read_idx
|
||||
SELECT * FROM federated.t1 WHERE id = 6 and name = 'Sixth Name';
|
||||
# with regular key index_read -> index_read_idx
|
||||
select * from federated.t1 where other = 44444;
|
||||
select * from federated.t1 where name like '%th%';
|
||||
SELECT * FROM federated.t1 WHERE other = 44444;
|
||||
SELECT * FROM federated.t1 WHERE name like '%th%';
|
||||
# update - update_row, index_read_idx
|
||||
update federated.t1 set name = '3rd name' where id = 3;
|
||||
select * from federated.t1 where name = '3rd name';
|
||||
UPDATE federated.t1 SET name = '3rd name' WHERE id = 3;
|
||||
SELECT * FROM federated.t1 WHERE name = '3rd name';
|
||||
# update - update_row, index_read -> index_read_idx
|
||||
update federated.t1 set name = 'Third name' where name = '3rd name';
|
||||
select * from federated.t1 where name = 'Third name';
|
||||
UPDATE federated.t1 SET name = 'Third name' WHERE name = '3rd name';
|
||||
SELECT * FROM federated.t1 WHERE name = 'Third name';
|
||||
# rnd_post, ::position
|
||||
select * from federated.t1 order by id DESC;
|
||||
select * from federated.t1 order by name;
|
||||
select * from federated.t1 order by name DESC;
|
||||
select * from federated.t1 order by name ASC;
|
||||
select * from federated.t1 group by other;
|
||||
SELECT * FROM federated.t1 ORDER BY id DESC;
|
||||
SELECT * FROM federated.t1 ORDER BY name;
|
||||
SELECT * FROM federated.t1 ORDER BY name DESC;
|
||||
SELECT * FROM federated.t1 ORDER BY name ASC;
|
||||
SELECT * FROM federated.t1 GROUP BY other;
|
||||
|
||||
# ::delete_row
|
||||
delete from federated.t1 where id = 5;
|
||||
select * from federated.t1 where id = 5;
|
||||
DELETE FROM federated.t1 WHERE id = 5;
|
||||
SELECT * FROM federated.t1 WHERE id = 5;
|
||||
|
||||
# ::delete_all_rows
|
||||
delete from federated.t1;
|
||||
select * from federated.t1 where id = 5;
|
||||
DELETE FROM federated.t1;
|
||||
SELECT * FROM federated.t1 WHERE id = 5;
|
||||
|
||||
connection slave;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) );
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32),
|
||||
`other` varchar(20),
|
||||
PRIMARY KEY (`id`) );
|
||||
|
||||
connection master;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32),
|
||||
`other` varchar(20),
|
||||
PRIMARY KEY (`id`) )
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
insert into federated.t1 (name, other) values ('First Name', 11111);
|
||||
insert into federated.t1 (name, other) values ('Second Name', NULL);
|
||||
insert into federated.t1 (name, other) values ('Third Name', 33333);
|
||||
insert into federated.t1 (name, other) values (NULL, NULL);
|
||||
insert into federated.t1 (name, other) values ('Fifth Name', 55555);
|
||||
insert into federated.t1 (name, other) values ('Sixth Name', 66666);
|
||||
insert into federated.t1 (name) values ('Seventh Name');
|
||||
insert into federated.t1 (name, other) values ('Eigth Name', 88888);
|
||||
insert into federated.t1 (name, other) values ('Ninth Name', 99999);
|
||||
insert into federated.t1 (other) values ('fee fie foe fum');
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('First Name', 11111);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Second Name', NULL);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Third Name', 33333);
|
||||
INSERT INTO federated.t1 (name, other) VALUES (NULL, NULL);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Fifth Name', 55555);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Sixth Name', 66666);
|
||||
INSERT INTO federated.t1 (name) VALUES ('Seventh Name');
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Eigth Name', 88888);
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Ninth Name', 99999);
|
||||
INSERT INTO federated.t1 (other) VALUES ('fee fie foe fum');
|
||||
|
||||
select * from federated.t1 where other IS NULL;
|
||||
select * from federated.t1 where name IS NULL;
|
||||
select * from federated.t1 where name IS NULL and other IS NULL;
|
||||
select * from federated.t1 where name IS NULL or other IS NULL;
|
||||
update federated.t1 set name = 'Fourth Name', other = 'four four four' where name IS NULL and other IS NULL;
|
||||
update federated.t1 set other = 'two two two two' where name = 'Second Name';
|
||||
update federated.t1 set other = 'seven seven' where name like 'Sec%';
|
||||
update federated.t1 set other = 'seven seven' where name = 'Seventh Name';
|
||||
update federated.t1 set name = 'Tenth Name' where other like 'fee fie%';
|
||||
select * from federated.t1 where name IS NULL or other IS NULL ;
|
||||
select * from federated.t1;
|
||||
SELECT * FROM federated.t1 WHERE other IS NULL;
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL;
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL and other IS NULL;
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL or other IS NULL;
|
||||
|
||||
UPDATE federated.t1
|
||||
SET name = 'Fourth Name', other = 'four four four'
|
||||
WHERE name IS NULL AND other IS NULL;
|
||||
|
||||
UPDATE federated.t1 SET other = 'two two two two' WHERE name = 'Second Name';
|
||||
UPDATE federated.t1 SET other = 'seven seven' WHERE name like 'Sec%';
|
||||
UPDATE federated.t1 SET other = 'seven seven' WHERE name = 'Seventh Name';
|
||||
UPDATE federated.t1 SET name = 'Tenth Name' WHERE other like 'fee fie%';
|
||||
SELECT * FROM federated.t1 WHERE name IS NULL OR other IS NULL ;
|
||||
SELECT * FROM federated.t1;
|
||||
|
||||
# test multi-keys
|
||||
connection slave;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name`
|
||||
varchar(32) NOT NULL DEFAULT '', `other` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`id`), key nameoth (name, other) );
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32) NOT NULL DEFAULT '',
|
||||
`other` varchar(20) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY nameoth (name, other) );
|
||||
|
||||
connection master;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `name` varchar(32) NOT NULL DEFAULT '', `other` varchar(20) NOT NULL DEFAULT '', PRIMARY KEY (`id`), key nameoth (name, other)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 (name, other) values ('First Name', '1111');
|
||||
insert into federated.t1 (name, other) values ('Second Name', '2222');
|
||||
insert into federated.t1 (name, other) values ('Third Name', '3333');
|
||||
select * from federated.t1 where name = 'Second Name';
|
||||
select * from federated.t1 where other = '2222';
|
||||
select * from federated.t1 where name = 'Third Name';
|
||||
select * from federated.t1 where name = 'Third Name' and other = '3333';
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`name` varchar(32) NOT NULL DEFAULT '',
|
||||
`other` varchar(20) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY nameoth (name, other))
|
||||
ENGINE="FEDERATED" DEFAULT
|
||||
CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('First Name', '1111');
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Second Name', '2222');
|
||||
INSERT INTO federated.t1 (name, other) VALUES ('Third Name', '3333');
|
||||
SELECT * FROM federated.t1 WHERE name = 'Second Name';
|
||||
SELECT * FROM federated.t1 WHERE other = '2222';
|
||||
SELECT * FROM federated.t1 WHERE name = 'Third Name';
|
||||
SELECT * FROM federated.t1 WHERE name = 'Third Name' AND other = '3333';
|
||||
|
||||
connection slave;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1
|
||||
(id int NOT NULL auto_increment,
|
||||
name char(32) NOT NULL DEFAULT '',
|
||||
bincol binary(4) NOT NULL,
|
||||
floatval decimal(5,2) NOT NULL DEFAULT 0.0,
|
||||
other int NOT NULL DEFAULT 0,
|
||||
primary key(id),
|
||||
key nameoth(name, other),
|
||||
key bincol(bincol),
|
||||
key floatval(floatval));
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int NOT NULL auto_increment,
|
||||
`name` char(32) NOT NULL DEFAULT '',
|
||||
`bincol` binary(4) NOT NULL,
|
||||
`floatval` decimal(5,2) NOT NULL DEFAULT 0.0,
|
||||
`other` int NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (id),
|
||||
KEY nameoth(name, other),
|
||||
KEY bincol(bincol),
|
||||
KEY floatval(floatval));
|
||||
|
||||
# test other types of indexes
|
||||
connection master;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1
|
||||
(id int NOT NULL auto_increment,
|
||||
name char(32) NOT NULL DEFAULT '',
|
||||
bincol binary(4) NOT NULL,
|
||||
floatval decimal(5,2) NOT NULL DEFAULT 0.0,
|
||||
other int NOT NULL DEFAULT 0,
|
||||
primary key(id),
|
||||
key nameoth(name,other),
|
||||
key bincol(bincol),
|
||||
key floatval(floatval))
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`id` int NOT NULL auto_increment,
|
||||
`name` char(32) NOT NULL DEFAULT '',
|
||||
`bincol` binary(4) NOT NULL,
|
||||
`floatval` decimal(5,2) NOT NULL DEFAULT 0.0,
|
||||
`other` int NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (id),
|
||||
KEY nameoth(name,other),
|
||||
KEY bincol(bincol),
|
||||
KEY floatval(floatval))
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
insert into federated.t1 (name, bincol, floatval, other) values ('first', 0x65, 11.11, 1111);
|
||||
insert into federated.t1 (name, bincol, floatval, other) values ('second', 0x66, 22.22, 2222);
|
||||
insert into federated.t1 (name, bincol, floatval, other) values ('third', 'g', 22.22, 2222);
|
||||
select * from federated.t1;
|
||||
select * from federated.t1 where name = 'second';
|
||||
select * from federated.t1 where bincol= 'f';
|
||||
select * from federated.t1 where bincol= 0x66;
|
||||
select * from federated.t1 where bincol= 0x67;
|
||||
select * from federated.t1 where bincol= 'g';
|
||||
select * from federated.t1 where floatval=11.11;
|
||||
select * from federated.t1 where name='third';
|
||||
select * from federated.t1 where other=2222;
|
||||
select * from federated.t1 where name='third' and other=2222;
|
||||
INSERT INTO federated.t1 (name, bincol, floatval, other)
|
||||
VALUES ('first', 0x65, 11.11, 1111);
|
||||
INSERT INTO federated.t1 (name, bincol, floatval, other)
|
||||
VALUES ('second', 0x66, 22.22, 2222);
|
||||
INSERT INTO federated.t1 (name, bincol, floatval, other)
|
||||
VALUES ('third', 'g', 22.22, 2222);
|
||||
SELECT * FROM federated.t1;
|
||||
SELECT * FROM federated.t1 WHERE name = 'second';
|
||||
SELECT * FROM federated.t1 WHERE bincol= 'f';
|
||||
SELECT * FROM federated.t1 WHERE bincol= 0x66;
|
||||
SELECT * FROM federated.t1 WHERE bincol= 0x67;
|
||||
SELECT * FROM federated.t1 WHERE bincol= 'g';
|
||||
SELECT * FROM federated.t1 WHERE floatval=11.11;
|
||||
SELECT * FROM federated.t1 WHERE name='third';
|
||||
SELECT * FROM federated.t1 WHERE other=2222;
|
||||
SELECT * FROM federated.t1 WHERE name='third' and other=2222;
|
||||
|
||||
# test NULLs
|
||||
connection slave;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int,
|
||||
`name` varchar(32),
|
||||
`floatval` float,
|
||||
`other` int)
|
||||
DEFAULT CHARSET=latin1;
|
||||
|
||||
connection master;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 (id int, name varchar(32), floatval float, other int) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`id` int,
|
||||
`name` varchar(32),
|
||||
`floatval` float,
|
||||
`other` int)
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
# these both should be the same
|
||||
insert into federated.t1 values (NULL, NULL, NULL, NULL);
|
||||
insert into federated.t1 values ();
|
||||
insert into federated.t1 (id) values (1);
|
||||
insert into federated.t1 (name, floatval, other) values ('foo', 33.33333332, NULL);
|
||||
insert into federated.t1 (name, floatval, other) values (0, 00.3333, NULL);
|
||||
select * from federated.t1;
|
||||
select count(*) from federated.t1 where id IS NULL and name IS NULL and floatval IS NULL and other IS NULL;
|
||||
INSERT INTO federated.t1 values (NULL, NULL, NULL, NULL);
|
||||
INSERT INTO federated.t1 values ();
|
||||
INSERT INTO federated.t1 (id) VALUES (1);
|
||||
INSERT INTO federated.t1 (name, floatval, other)
|
||||
VALUES ('foo', 33.33333332, NULL);
|
||||
INSERT INTO federated.t1 (name, floatval, other)
|
||||
VALUES (0, 00.3333, NULL);
|
||||
SELECT * FROM federated.t1;
|
||||
SELECT count(*) FROM federated.t1
|
||||
WHERE id IS NULL
|
||||
AND name IS NULL
|
||||
AND floatval IS NULL
|
||||
AND other IS NULL;
|
||||
|
||||
connection slave;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( blurb_id int NOT NULL DEFAULT 0, blurb text default '', primary key(blurb_id)) DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`blurb_id` int NOT NULL DEFAULT 0,
|
||||
`blurb` text default '',
|
||||
PRIMARY KEY (blurb_id))
|
||||
DEFAULT CHARSET=latin1;
|
||||
|
||||
connection master;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( blurb_id int NOT NULL DEFAULT 0, blurb text default '', primary key(blurb_id)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`blurb_id` int NOT NULL DEFAULT 0,
|
||||
`blurb` text default '',
|
||||
PRIMARY KEY (blurb_id))
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.");
|
||||
INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.");
|
||||
INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. ");
|
||||
INSERT INTO federated.t1 VALUES(4, "Die Übersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest für jemanden, der seine Zielsprache ernst nimmt:");
|
||||
select * from federated.t1;
|
||||
SELECT * FROM federated.t1;
|
||||
|
||||
connection slave;
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (a int not null, b int not null, c int not null, primary key (a),key(b));
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`a` int NOT NULL,
|
||||
`b` int NOT NULL,
|
||||
`c` int NOT NULL,
|
||||
PRIMARY KEY (a),key(b));
|
||||
|
||||
connection master;
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`a` int NOT NULL,
|
||||
`b` int NOT NULL,
|
||||
`c` int NOT NULL,
|
||||
PRIMARY KEY (a),
|
||||
KEY (b))
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
insert into federated.t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
|
||||
explain select * from federated.t1 order by a;
|
||||
explain select * from federated.t1 order by b;
|
||||
explain select * from federated.t1 order by c;
|
||||
explain select a from federated.t1 order by a;
|
||||
explain select b from federated.t1 order by b;
|
||||
explain select a,b from federated.t1 order by b;
|
||||
explain select a,b from federated.t1;
|
||||
explain select a,b,c from federated.t1;
|
||||
INSERT INTO federated.t1 VALUES (3,3,3),(1,1,1),(2,2,2),(4,4,4);
|
||||
EXPLAIN SELECT * FROM federated.t1 ORDER BY a;
|
||||
EXPLAIN SELECT * FROM federated.t1 ORDER BY b;
|
||||
EXPLAIN SELECT * FROM federated.t1 ORDER BY c;
|
||||
EXPLAIN SELECT a FROM federated.t1 ORDER BY a;
|
||||
EXPLAIN SELECT b FROM federated.t1 ORDER BY b;
|
||||
EXPLAIN SELECT a,b FROM federated.t1 ORDER BY b;
|
||||
EXPLAIN SELECT a,b FROM federated.t1;
|
||||
EXPLAIN SELECT a,b,c FROM federated.t1;
|
||||
|
||||
connection slave;
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
|
||||
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
|
||||
i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
|
||||
|
@ -336,10 +434,12 @@ int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
|||
int, i999 int, i1000 int, b blob) row_format=dynamic;
|
||||
|
||||
connection master;
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
|
||||
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1
|
||||
(i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
||||
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int,
|
||||
i17 int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
|
||||
i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
|
||||
int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int,
|
||||
i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51
|
||||
|
@ -461,8 +561,14 @@ int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
|
|||
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
|
||||
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
|
||||
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
||||
int, i999 int, i1000 int, b blob) row_format=dynamic ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
int, i999 int, i1000 int, b blob)
|
||||
row_format=dynamic
|
||||
ENGINE="FEDERATED"
|
||||
DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
INSERT INTO federated.t1
|
||||
values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
|
@ -501,93 +607,145 @@ insert into federated.t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "PatrickG");
|
||||
update federated.t1 set b=repeat('a',256);
|
||||
update federated.t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0, i10=0;
|
||||
select * from federated.t1 where i9=0 and i10=0;
|
||||
update federated.t1 set i50=20;
|
||||
select * from federated.t1;
|
||||
delete from federated.t1 where i51=20;
|
||||
select * from federated.t1;
|
||||
delete from federated.t1 where i50=20;
|
||||
select * from federated.t1;
|
||||
UPDATE federated.t1 SET b=repeat('a',256);
|
||||
UPDATE federated.t1 SET i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0, i10=0;
|
||||
SELECT * FROM federated.t1 WHERE i9=0 and i10=0;
|
||||
UPDATE federated.t1 SET i50=20;
|
||||
SELECT * FROM federated.t1;
|
||||
DELETE FROM federated.t1 WHERE i51=20;
|
||||
SELECT * FROM federated.t1;
|
||||
DELETE FROM federated.t1 WHERE i50=20;
|
||||
SELECT * FROM federated.t1;
|
||||
|
||||
connection slave;
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code), index(fileguts(10))) DEFAULT CHARSET=latin1;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', PRIMARY KEY(id), index(code), index(fileguts(10))) DEFAULT CHARSET=latin1;
|
||||
|
||||
connection master;
|
||||
drop table if exists federated.t1;
|
||||
create table federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code), index(fileguts(10))) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 (code, fileguts, creation_date) values ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03');
|
||||
insert into federated.t1 (code, fileguts, creation_date) values ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04');
|
||||
insert into federated.t1 (code, fileguts, creation_date) values ('DEUEUEUEUEUEUEUEUEU', 'jimbob', '2004-04-04 04:04:04');
|
||||
select * from federated.t1;
|
||||
select * from federated.t1 where fileguts = 'jimbob';
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
id int NOT NULL auto_increment,
|
||||
code char(20) NOT NULL,
|
||||
fileguts blob NOT NULL,
|
||||
creation_date datetime,
|
||||
entered_time datetime default '2004-04-04 04:04:04',
|
||||
PRIMARY KEY(id),
|
||||
index(code),
|
||||
index(fileguts(10)))
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('ASDFWERQWETWETAWETA', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2003-03-03 03:03:03');
|
||||
INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('DEUEUEUEUEUEUEUEUEU', '*()w*09*$()*#)(*09*^90*d)(*s()d8g)(s*ned)(*)(s*d)(*hn(d*)(*sbn)D((#$*(#*%%&#&^$#&#&#&#&^&#*&*#$*&^*(&#(&Q*&&(*!&!(*&*(#&*(%&#<S-F8>*<S-F8><S-F8><S-F8>#<S-F8>#<S-F8>#<S-F8>[[', '2004-04-04 04:04:04');
|
||||
INSERT INTO federated.t1 (code, fileguts, creation_date) VALUES ('DEUEUEUEUEUEUEUEUEU', 'jimbob', '2004-04-04 04:04:04');
|
||||
SELECT * FROM federated.t1;
|
||||
# test blob indexes
|
||||
SELECT * FROM federated.t1 WHERE fileguts = 'jimbob';
|
||||
|
||||
# test blob with binary
|
||||
connection slave;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (`a` BLOB);
|
||||
|
||||
connection master;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`a` BLOB)
|
||||
ENGINE="FEDERATED"
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
INSERT INTO federated.t1 VALUES (0x00);
|
||||
INSERT INTO federated.t1 VALUES (0x0001);
|
||||
INSERT INTO federated.t1 VALUES (0x0100);
|
||||
SELECT HEX(a) FROM federated.t1;
|
||||
|
||||
|
||||
# TODO
|
||||
#
|
||||
# create table federated.t1 (a char(20)) charset=cp1251 ENGINE="FEDERATED" COMMENT="mysql://root@127.0.0.1:9308/federated/t1";
|
||||
# CREATE TABLE federated.t1
|
||||
# (a char(20)) charset=cp1251
|
||||
# ENGINE="FEDERATED" COMMENT="mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1";
|
||||
#
|
||||
# connection slave;
|
||||
# drop table if exists federated.t1;
|
||||
# create table federated.t1 (a char(20)) charset=cp1251;
|
||||
# DROP TABLE IF EXISTS federated.t1;
|
||||
# CREATE TABLE federated.t1 (a char(20)) charset=cp1251;
|
||||
#
|
||||
# connection master;
|
||||
# insert into federated.t1 values (_cp1251'À-ÁÂÃ-1');
|
||||
# insert into federated.t1 values (_cp1251'Á-ÂÃÄ-2');
|
||||
# set names cp1251;
|
||||
# insert into federated.t1 values ('Â-ÃÄÅ-3');
|
||||
# insert into federated.t1 values ('Ã-ŨÆ-4');
|
||||
# select * from federated.t1;
|
||||
# INSERT INTO federated.t1 values (_cp1251'À-ÁÂÃ-1');
|
||||
# INSERT INTO federated.t1 values (_cp1251'Á-ÂÃÄ-2');
|
||||
# SET names cp1251;
|
||||
# INSERT INTO federated.t1 values ('Â-ÃÄÅ-3');
|
||||
# INSERT INTO federated.t1 values ('Ã-ŨÆ-4');
|
||||
# SELECT * FROM federated.t1;
|
||||
# select hex(a) from federated.t1;
|
||||
# select hex(a) from federated.t1 order by a desc;
|
||||
# update federated.t1 set a='À-ÁÂÃ-1íîâûé' where a='À-ÁÂÃ-1';
|
||||
# select * from federated.t1;
|
||||
# delete from federated.t1 where a='Ã-ŨÆ-4';
|
||||
# select * from federated.t1;
|
||||
# delete from federated.t1 where a>'Â-';
|
||||
# select * from federated.t1;
|
||||
# set names default;
|
||||
# select hex(a) from federated.t1 ORDER BY a desc;
|
||||
# update federated.t1 SET a='À-ÁÂÃ-1íîâûé' WHERE a='À-ÁÂÃ-1';
|
||||
# SELECT * FROM federated.t1;
|
||||
# DELETE FROM federated.t1 WHERE a='Ã-ŨÆ-4';
|
||||
# SELECT * FROM federated.t1;
|
||||
# DELETE FROM federated.t1 WHERE a>'Â-';
|
||||
# SELECT * FROM federated.t1;
|
||||
# SET names default;
|
||||
#
|
||||
# drop table if exists federated.t1;
|
||||
# DROP TABLE IF EXISTS federated.t1;
|
||||
#
|
||||
|
||||
# test joins with non-federated table
|
||||
connection slave;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `country_id` int(20) NOT NULL DEFAULT 0, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`), key (country_id));
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`country_id` int(20) NOT NULL DEFAULT 0,
|
||||
`name` varchar(32),
|
||||
`other` varchar(20),
|
||||
PRIMARY KEY (`id`),
|
||||
key (country_id));
|
||||
|
||||
connection master;
|
||||
drop table if exists federated.t1;
|
||||
CREATE TABLE federated.t1 ( `id` int(20) NOT NULL auto_increment, `country_id` int(20) NOT NULL DEFAULT 0, `name` varchar(32), `other` varchar(20), PRIMARY KEY (`id`), key (country_id) ) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/federated/t1';
|
||||
insert into federated.t1 (name, country_id, other) values ('Kumar', 1, 11111);
|
||||
insert into federated.t1 (name, country_id, other) values ('Lenz', 2, 22222);
|
||||
insert into federated.t1 (name, country_id, other) values ('Marizio', 3, 33333);
|
||||
insert into federated.t1 (name, country_id, other) values ('Monty', 4, 33333);
|
||||
insert into federated.t1 (name, country_id, other) values ('Sanja', 5, 33333);
|
||||
DROP TABLE IF EXISTS federated.countries;
|
||||
CREATE TABLE federated.countries (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`country` varchar(32),
|
||||
PRIMARY KEY (id));
|
||||
INSERT INTO federated.countries (country) VALUES ('India');
|
||||
INSERT INTO federated.countries (country) VALUES ('Germany');
|
||||
INSERT INTO federated.countries (country) VALUES ('Italy');
|
||||
INSERT INTO federated.countries (country) VALUES ('Finland');
|
||||
INSERT INTO federated.countries (country) VALUES ('Ukraine');
|
||||
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||
eval CREATE TABLE federated.t1 (
|
||||
`id` int(20) NOT NULL auto_increment,
|
||||
`country_id` int(20) NOT NULL DEFAULT 0,
|
||||
`name` varchar(32),
|
||||
`other` varchar(20),
|
||||
PRIMARY KEY (`id`),
|
||||
KEY (country_id) )
|
||||
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
|
||||
COMMENT='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
|
||||
|
||||
drop table if exists federated.countries;
|
||||
CREATE TABLE federated.countries ( `id` int(20) NOT NULL auto_increment, `country` varchar(32), primary key (id));
|
||||
insert into federated.countries (country) values ('India');
|
||||
insert into federated.countries (country) values ('Germany');
|
||||
insert into federated.countries (country) values ('Italy');
|
||||
insert into federated.countries (country) values ('Finland');
|
||||
insert into federated.countries (country) values ('Ukraine');
|
||||
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Kumar', 1, 11111);
|
||||
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Lenz', 2, 22222);
|
||||
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Marizio', 3, 33333);
|
||||
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Monty', 4, 33333);
|
||||
INSERT INTO federated.t1 (name, country_id, other) VALUES ('Sanja', 5, 33333);
|
||||
|
||||
select federated.t1.*, federated.countries.country from federated.t1 left join federated.countries on federated.t1.country_id = federated.countries.id;
|
||||
SELECT federated.t1.*, federated.countries.country
|
||||
FROM federated.t1 left join federated.countries
|
||||
ON federated.t1.country_id = federated.countries.id;
|
||||
|
||||
drop table federated.countries;
|
||||
DROP TABLE federated.countries;
|
||||
|
||||
connection master;
|
||||
--disable_warnings
|
||||
drop table if exists federated.t1;
|
||||
drop database if exists federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
--enable_warnings
|
||||
|
||||
connection slave;
|
||||
--disable_warnings
|
||||
drop table if exists federated.t1;
|
||||
drop database if exists federated;
|
||||
DROP TABLE IF EXISTS federated.t1;
|
||||
DROP DATABASE IF EXISTS federated;
|
||||
--enable_warnings
|
||||
|
|
|
@ -591,6 +591,7 @@ insert into t1 values(1),(2);
|
|||
truncate table t1;
|
||||
commit;
|
||||
truncate table t1;
|
||||
truncate table t1;
|
||||
select * from t1;
|
||||
insert into t1 values(1),(2);
|
||||
delete from t1;
|
||||
|
@ -605,6 +606,7 @@ truncate table t1;
|
|||
insert into t1 values(1),(2);
|
||||
select * from t1;
|
||||
truncate table t1;
|
||||
truncate table t1;
|
||||
insert into t1 values(1),(2);
|
||||
delete from t1;
|
||||
select * from t1;
|
||||
|
|
|
@ -527,6 +527,32 @@ explain select count(*) from t1 where a is null;
|
|||
select count(*) from t1 where a is null;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #8306: TRUNCATE leads to index corruption
|
||||
#
|
||||
create table t1 (c1 int, index(c1));
|
||||
create table t2 (c1 int, index(c1)) engine=merge union=(t1);
|
||||
insert into t1 values (1);
|
||||
# Close all tables.
|
||||
flush tables;
|
||||
# Open t2 and (implicitly) t1.
|
||||
select * from t2;
|
||||
# Truncate after flush works (unless another threads reopens t2 in between).
|
||||
flush tables;
|
||||
truncate table t1;
|
||||
insert into t1 values (1);
|
||||
# Close all tables.
|
||||
flush tables;
|
||||
# Open t2 and (implicitly) t1.
|
||||
select * from t2;
|
||||
# Truncate t1, wich was not recognized as open without the bugfix.
|
||||
# Now, it should fail with a table-in-use error message.
|
||||
--error 1105
|
||||
truncate table t1;
|
||||
# The insert used to fail on the crashed table.
|
||||
insert into t1 values (1);
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Test varchar
|
||||
#
|
||||
|
|
|
@ -83,7 +83,7 @@ create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, p
|
|||
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path";
|
||||
|
||||
# Should fail becasue the file t9.MYI already exist in 'run'
|
||||
--error 1,1
|
||||
--error 1,1,1105
|
||||
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQL_TEST_DIR/var/run";
|
||||
|
||||
# Should fail becasue the file t9.MYD already exist in 'tmp'
|
||||
|
|
|
@ -28,8 +28,7 @@ int my_msync(int fd, void *addr, size_t len, int flags)
|
|||
return my_sync(fd, MYF(0));
|
||||
}
|
||||
|
||||
#else
|
||||
#ifdef __WIN__
|
||||
#elif defined(__WIN__)
|
||||
|
||||
static SECURITY_ATTRIBUTES mmap_security_attributes=
|
||||
{sizeof(SECURITY_ATTRIBUTES), 0, TRUE};
|
||||
|
@ -83,11 +82,7 @@ int my_msync(int fd, void *addr, size_t len, int flags)
|
|||
return FlushViewOfFile(addr, len) ? 0 : -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __WIN__
|
||||
#else
|
||||
#warning "no mmap!"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -6443,7 +6443,7 @@ Dbdict::createIndex_toCreateTable(Signal* signal, OpCreateIndexPtr opPtr)
|
|||
// write index key attributes
|
||||
AttributeRecordPtr aRecPtr;
|
||||
c_attributeRecordPool.getPtr(aRecPtr, tablePtr.p->firstAttribute);
|
||||
for (unsigned k = 0; k < opPtr.p->m_attrList.sz; k++) {
|
||||
for (k = 0; k < opPtr.p->m_attrList.sz; k++) {
|
||||
// insert the attributes in the order decided above in attrid_map
|
||||
// k is new order, current_id is in previous order
|
||||
// ToDo: make sure "current_id" is stored with the table and
|
||||
|
|
|
@ -74,8 +74,8 @@ testReadPerf_SOURCES = testReadPerf.cpp
|
|||
testLcp_SOURCES = testLcp.cpp
|
||||
testPartitioning_SOURCES = testPartitioning.cpp
|
||||
testBitfield_SOURCES = testBitfield.cpp
|
||||
DbCreate_SOURCES= bench/mainPopulate.cpp bench/dbPopulate.cpp bench/userInterface.cpp
|
||||
DbAsyncGenerator_SOURCES= bench/mainAsyncGenerator.cpp bench/asyncGenerator.cpp bench/ndb_async2.cpp
|
||||
DbCreate_SOURCES = bench/mainPopulate.cpp bench/dbPopulate.cpp bench/userInterface.cpp bench/dbPopulate.h bench/userInterface.h bench/testData.h bench/testDefinitions.h bench/ndb_schema.hpp bench/ndb_error.hpp
|
||||
DbAsyncGenerator_SOURCES = bench/mainAsyncGenerator.cpp bench/asyncGenerator.cpp bench/ndb_async2.cpp bench/dbGenerator.h bench/macros.h bench/userInterface.h bench/testData.h bench/testDefinitions.h bench/ndb_schema.hpp bench/ndb_error.hpp
|
||||
|
||||
INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel
|
||||
|
||||
|
|
|
@ -50,11 +50,11 @@ libnet_a_LIBADD= $(top_builddir)/sql/password.$(OBJEXT) \
|
|||
|
||||
CLEANFILES= net_serv.cc client_settings.h
|
||||
|
||||
net_serv.cc: Makefile
|
||||
net_serv.cc:
|
||||
rm -f $(srcdir)/net_serv.cc
|
||||
@LN_CP_F@ $(top_srcdir)/sql/net_serv.cc $(srcdir)/net_serv.cc
|
||||
|
||||
client_settings.h: Makefile
|
||||
client_settings.h:
|
||||
rm -f $(srcdir)/client_settings.h
|
||||
@LN_CP_F@ $(top_srcdir)/sql/client_settings.h $(srcdir)/client_settings.h
|
||||
|
||||
|
|
|
@ -2628,6 +2628,25 @@ mysql_fetch_row(MYSQL_RES *res)
|
|||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Get column lengths of the current row
|
||||
If one uses mysql_use_result, res->lengths contains the length information,
|
||||
else the lengths are calculated from the offset between pointers.
|
||||
**************************************************************************/
|
||||
|
||||
ulong * STDCALL
|
||||
mysql_fetch_lengths(MYSQL_RES *res)
|
||||
{
|
||||
MYSQL_ROW column;
|
||||
|
||||
if (!(column=res->current_row))
|
||||
return 0; /* Something is wrong */
|
||||
if (res->data)
|
||||
(*res->methods->fetch_lengths)(res->lengths, column, res->field_count);
|
||||
return res->lengths;
|
||||
}
|
||||
|
||||
|
||||
int STDCALL
|
||||
mysql_options(MYSQL *mysql,enum mysql_option option, const char *arg)
|
||||
{
|
||||
|
|
1049
sql/ha_federated.cc
1049
sql/ha_federated.cc
File diff suppressed because it is too large
Load diff
|
@ -32,13 +32,16 @@
|
|||
FEDERATED_SHARE is a structure that will be shared amoung all open handlers
|
||||
The example implements the minimum of what you will probably need.
|
||||
*/
|
||||
//FIX document
|
||||
typedef struct st_federated_share {
|
||||
char *table_name;
|
||||
char *table_base_name;
|
||||
// the primary select query to be used in rnd_init
|
||||
/*
|
||||
the primary select query to be used in rnd_init
|
||||
*/
|
||||
char *select_query;
|
||||
// remote host info, parse_url supplies
|
||||
/*
|
||||
remote host info, parse_url supplies
|
||||
*/
|
||||
char *scheme;
|
||||
char *hostname;
|
||||
char *username;
|
||||
|
@ -62,6 +65,7 @@ class ha_federated: public handler
|
|||
FEDERATED_SHARE *share; /* Shared lock info */
|
||||
MYSQL *mysql;
|
||||
MYSQL_RES *result;
|
||||
bool scan_flag;
|
||||
uint ref_length;
|
||||
uint fetch_num; // stores the fetch num
|
||||
MYSQL_ROW_OFFSET current_position; // Current position used by ::position()
|
||||
|
@ -72,11 +76,12 @@ private:
|
|||
return errorcode otherwise
|
||||
*/
|
||||
uint convert_row_to_internal_format(byte *buf, MYSQL_ROW row);
|
||||
bool create_where_from_key(String *to, KEY *key_info, const byte *key, uint key_length);
|
||||
bool create_where_from_key(String *to, KEY *key_info,
|
||||
const byte *key, uint key_length);
|
||||
|
||||
public:
|
||||
ha_federated(TABLE *table): handler(table),
|
||||
mysql(0),
|
||||
mysql(0), result(0), scan_flag(0),
|
||||
ref_length(sizeof(MYSQL_ROW_OFFSET)), current_position(0)
|
||||
{
|
||||
}
|
||||
|
@ -100,9 +105,9 @@ public:
|
|||
*/
|
||||
ulong table_flags() const
|
||||
{
|
||||
return (HA_TABLE_SCAN_ON_INDEX | HA_NOT_EXACT_COUNT |
|
||||
HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED | HA_AUTO_PART_KEY |
|
||||
HA_TABLE_SCAN_ON_INDEX | HA_CAN_INDEX_BLOBS);
|
||||
return (HA_TABLE_SCAN_ON_INDEX | HA_NOT_EXACT_COUNT |
|
||||
HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED |
|
||||
HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS);
|
||||
}
|
||||
/*
|
||||
This is a bitmap of flags that says how the storage engine
|
||||
|
@ -126,11 +131,16 @@ public:
|
|||
/*
|
||||
Called in test_quick_select to determine if indexes should be used.
|
||||
*/
|
||||
virtual double scan_time() { DBUG_PRINT("ha_federated::scan_time", ("rows %d", records)); return (double)(records*2); }
|
||||
virtual double scan_time()
|
||||
{
|
||||
DBUG_PRINT("ha_federated::scan_time",
|
||||
("rows %d", records)); return (double)(records*2);
|
||||
}
|
||||
/*
|
||||
The next method will never be called if you do not implement indexes.
|
||||
*/
|
||||
virtual double read_time(uint index, uint ranges, ha_rows rows) { return (double) rows / 20.0+1; }
|
||||
virtual double read_time(uint index, uint ranges, ha_rows rows)
|
||||
{ return (double) rows / 20.0+1; }
|
||||
|
||||
/*
|
||||
Everything below are methods that we implment in ha_federated.cc.
|
||||
|
@ -173,3 +183,6 @@ public:
|
|||
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
|
||||
enum thr_lock_type lock_type); //required
|
||||
};
|
||||
|
||||
bool federated_db_init(void);
|
||||
bool federated_db_end(void);
|
||||
|
|
238
sql/ha_innodb.cc
238
sql/ha_innodb.cc
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2000 MySQL AB & Innobase Oy
|
||||
/* Copyright (C) 2000-2005 MySQL AB & Innobase Oy
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -336,14 +336,18 @@ innobase_release_temporary_latches(
|
|||
/*===============================*/
|
||||
THD *thd)
|
||||
{
|
||||
trx_t* trx;
|
||||
|
||||
if (!innodb_inited) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
trx_t *trx= (trx_t*) thd->ha_data[innobase_hton.slot];
|
||||
if (trx)
|
||||
innobase_release_stat_resources(trx);
|
||||
trx = (trx_t*) thd->ha_data[innobase_hton.slot];
|
||||
|
||||
if (trx) {
|
||||
innobase_release_stat_resources(trx);
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
|
@ -743,14 +747,15 @@ transaction internally. */
|
|||
static
|
||||
void
|
||||
register_trans(
|
||||
/*============*/
|
||||
/*===========*/
|
||||
THD* thd) /* in: thd to use the handle */
|
||||
{
|
||||
/* register the start of the statement */
|
||||
/* Register the start of the statement */
|
||||
trans_register_ha(thd, FALSE, &innobase_hton);
|
||||
|
||||
if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) {
|
||||
|
||||
/* no autocommit mode, register for a transaction */
|
||||
/* No autocommit mode, register for a transaction */
|
||||
trans_register_ha(thd, TRUE, &innobase_hton);
|
||||
}
|
||||
}
|
||||
|
@ -1051,7 +1056,7 @@ ha_innobase::init_table_handle_for_HANDLER(void)
|
|||
/*************************************************************************
|
||||
Opens an InnoDB database. */
|
||||
|
||||
handlerton *
|
||||
handlerton*
|
||||
innobase_init(void)
|
||||
/*===============*/
|
||||
/* out: TRUE if error */
|
||||
|
@ -1220,7 +1225,7 @@ innobase_init(void)
|
|||
|
||||
srv_print_verbose_log = mysqld_embedded ? 0 : 1;
|
||||
|
||||
/* Store the default charset-collation number of this MySQL
|
||||
/* Store the default charset-collation number of this MySQL
|
||||
installation */
|
||||
|
||||
data_mysql_default_charset_coll = (ulint)default_charset_info->number;
|
||||
|
@ -1346,14 +1351,16 @@ innobase_commit_low(
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef DISABLE_HAVE_REPLICATION
|
||||
if (current_thd->slave_thread) {
|
||||
#ifdef HAVE_REPLICATION
|
||||
THD *thd=current_thd;
|
||||
|
||||
if (thd && thd->slave_thread) {
|
||||
/* Update the replication position info inside InnoDB */
|
||||
|
||||
trx->mysql_master_log_file_name
|
||||
= active_mi->rli.group_master_log_name;
|
||||
trx->mysql_master_log_pos= ((ib_longlong)
|
||||
active_mi->rli.future_group_master_log_pos);
|
||||
trx->mysql_master_log_pos = ((ib_longlong)
|
||||
active_mi->rli.future_group_master_log_pos);
|
||||
}
|
||||
#endif /* HAVE_REPLICATION */
|
||||
|
||||
|
@ -1456,7 +1463,8 @@ innobase_commit(
|
|||
"InnoDB: but trx->conc_state != TRX_NOT_STARTED\n");
|
||||
}
|
||||
|
||||
if (all || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
||||
if (all
|
||||
|| (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
||||
|
||||
/* We were instructed to commit the whole transaction, or
|
||||
this is an SQL statement end and autocommit is on */
|
||||
|
@ -1489,10 +1497,9 @@ innobase_commit(
|
|||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
/*
|
||||
don't delete it - it may be re-enabled later
|
||||
as an optimization for the most common case InnoDB+binlog
|
||||
*/
|
||||
/* The following defined-out code will be enabled later when we put the
|
||||
MySQL-4.1 functionality back to 5.0. This is needed to get InnoDB Hot Backup
|
||||
to work. */
|
||||
#if 0
|
||||
/*********************************************************************
|
||||
This is called when MySQL writes the binlog entry for the current
|
||||
|
@ -1627,7 +1634,8 @@ innobase_rollback(
|
|||
row_unlock_table_autoinc_for_mysql(trx);
|
||||
}
|
||||
|
||||
if (all || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
||||
if (all
|
||||
|| (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
||||
|
||||
error = trx_rollback_for_mysql(trx);
|
||||
trx->active_trans = 0;
|
||||
|
@ -1686,6 +1694,7 @@ innobase_rollback_to_savepoint(
|
|||
ib_longlong mysql_binlog_cache_pos;
|
||||
int error = 0;
|
||||
trx_t* trx;
|
||||
char name[64];
|
||||
|
||||
DBUG_ENTER("innobase_rollback_to_savepoint");
|
||||
|
||||
|
@ -1698,8 +1707,8 @@ innobase_rollback_to_savepoint(
|
|||
innobase_release_stat_resources(trx);
|
||||
|
||||
/* TODO: use provided savepoint data area to store savepoint data */
|
||||
char name[64];
|
||||
longlong2str((ulonglong)savepoint,name,36);
|
||||
|
||||
longlong2str((ulonglong)savepoint, name, 36);
|
||||
|
||||
error = trx_rollback_to_savepoint_for_mysql(trx, name,
|
||||
&mysql_binlog_cache_pos);
|
||||
|
@ -1708,26 +1717,27 @@ innobase_rollback_to_savepoint(
|
|||
|
||||
/*********************************************************************
|
||||
Release transaction savepoint name. */
|
||||
|
||||
static int
|
||||
static
|
||||
int
|
||||
innobase_release_savepoint(
|
||||
/*===========================*/
|
||||
/*=======================*/
|
||||
/* out: 0 if success, HA_ERR_NO_SAVEPOINT if
|
||||
no savepoint with the given name */
|
||||
THD* thd, /* in: handle to the MySQL thread of the user
|
||||
whose transaction should be rolled back */
|
||||
void *savepoint) /* in: savepoint data */
|
||||
void* savepoint) /* in: savepoint data */
|
||||
{
|
||||
int error = 0;
|
||||
trx_t* trx;
|
||||
char name[64];
|
||||
|
||||
DBUG_ENTER("innobase_release_savepoint");
|
||||
|
||||
trx = check_trx_exists(thd);
|
||||
|
||||
/* TODO: use provided savepoint data area to store savepoint data */
|
||||
char name[64];
|
||||
longlong2str((ulonglong)savepoint,name,36);
|
||||
|
||||
longlong2str((ulonglong)savepoint, name, 36);
|
||||
|
||||
error = trx_release_savepoint_for_mysql(trx, name);
|
||||
|
||||
|
@ -1736,13 +1746,13 @@ innobase_release_savepoint(
|
|||
|
||||
/*********************************************************************
|
||||
Sets a transaction savepoint. */
|
||||
|
||||
static int
|
||||
static
|
||||
int
|
||||
innobase_savepoint(
|
||||
/*===============*/
|
||||
/* out: always 0, that is, always succeeds */
|
||||
THD* thd, /* in: handle to the MySQL thread */
|
||||
void *savepoint) /* in: savepoint data */
|
||||
void* savepoint) /* in: savepoint data */
|
||||
{
|
||||
int error = 0;
|
||||
trx_t* trx;
|
||||
|
@ -1911,7 +1921,8 @@ ha_innobase::open(
|
|||
fields when packed actually became 1 byte longer, when we also
|
||||
stored the string length as the first byte. */
|
||||
|
||||
upd_and_key_val_buff_len = table->s->reclength + table->s->max_key_length
|
||||
upd_and_key_val_buff_len =
|
||||
table->s->reclength + table->s->max_key_length
|
||||
+ MAX_REF_PARTS * 3;
|
||||
if (!(mysql_byte*) my_multi_malloc(MYF(MY_WME),
|
||||
&upd_buff, upd_and_key_val_buff_len,
|
||||
|
@ -1963,7 +1974,8 @@ ha_innobase::open(
|
|||
|
||||
innobase_prebuilt = row_create_prebuilt(ib_table);
|
||||
|
||||
((row_prebuilt_t*)innobase_prebuilt)->mysql_row_len = table->s->reclength;
|
||||
((row_prebuilt_t*)innobase_prebuilt)->mysql_row_len =
|
||||
table->s->reclength;
|
||||
|
||||
/* Looks like MySQL-3.23 sometimes has primary key number != 0 */
|
||||
|
||||
|
@ -1985,13 +1997,11 @@ ha_innobase::open(
|
|||
|
||||
((row_prebuilt_t*)innobase_prebuilt)
|
||||
->clust_index_was_generated = FALSE;
|
||||
/*
|
||||
MySQL allocates the buffer for ref. key_info->key_length
|
||||
includes space for all key columns + one byte for each column
|
||||
that may be NULL. ref_length must be as exact as possible to
|
||||
save space, because all row reference buffers are allocated
|
||||
based on ref_length.
|
||||
*/
|
||||
/* MySQL allocates the buffer for ref. key_info->key_length
|
||||
includes space for all key columns + one byte for each column
|
||||
that may be NULL. ref_length must be as exact as possible to
|
||||
save space, because all row reference buffers are allocated
|
||||
based on ref_length. */
|
||||
|
||||
ref_length = table->key_info[primary_key].key_length;
|
||||
} else {
|
||||
|
@ -2013,15 +2023,13 @@ ha_innobase::open(
|
|||
|
||||
ref_length = DATA_ROW_ID_LEN;
|
||||
|
||||
/*
|
||||
If we automatically created the clustered index, then
|
||||
MySQL does not know about it, and MySQL must NOT be aware
|
||||
of the index used on scan, to make it avoid checking if we
|
||||
update the column of the index. That is why we assert below
|
||||
that key_used_on_scan is the undefined value MAX_KEY.
|
||||
The column is the row id in the automatical generation case,
|
||||
and it will never be updated anyway.
|
||||
*/
|
||||
/* If we automatically created the clustered index, then
|
||||
MySQL does not know about it, and MySQL must NOT be aware
|
||||
of the index used on scan, to make it avoid checking if we
|
||||
update the column of the index. That is why we assert below
|
||||
that key_used_on_scan is the undefined value MAX_KEY.
|
||||
The column is the row id in the automatical generation case,
|
||||
and it will never be updated anyway. */
|
||||
|
||||
if (key_used_on_scan != MAX_KEY) {
|
||||
fprintf(stderr,
|
||||
|
@ -2611,7 +2619,8 @@ ha_innobase::write_row(
|
|||
"InnoDB: Dump of 200 bytes around transaction.all: ",
|
||||
stderr);
|
||||
ut_print_buf(stderr,
|
||||
((byte*)(&(current_thd->ha_data[innobase_hton.slot]))) - 100, 200);
|
||||
((byte*)(&(current_thd->ha_data[innobase_hton.slot]))) - 100,
|
||||
200);
|
||||
putc('\n', stderr);
|
||||
ut_error;
|
||||
}
|
||||
|
@ -2622,7 +2631,9 @@ ha_innobase::write_row(
|
|||
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
|
||||
table->timestamp_field->set_time();
|
||||
|
||||
if (user_thd->lex->sql_command == SQLCOM_ALTER_TABLE
|
||||
if ((user_thd->lex->sql_command == SQLCOM_ALTER_TABLE
|
||||
|| user_thd->lex->sql_command == SQLCOM_CREATE_INDEX
|
||||
|| user_thd->lex->sql_command == SQLCOM_DROP_INDEX)
|
||||
&& num_write_row >= 10000) {
|
||||
/* ALTER TABLE is COMMITted at every 10000 copied rows.
|
||||
The IX table lock for the original table has to be re-issued.
|
||||
|
@ -2646,7 +2657,7 @@ ha_innobase::write_row(
|
|||
src_table = lock_get_src_table(
|
||||
prebuilt->trx, prebuilt->table, &mode);
|
||||
if (!src_table) {
|
||||
no_commit:
|
||||
no_commit:
|
||||
/* Unknown situation: do not commit */
|
||||
/*
|
||||
ut_print_timestamp(stderr);
|
||||
|
@ -2669,6 +2680,7 @@ ha_innobase::write_row(
|
|||
} else {
|
||||
/* Ensure that there are no other table locks than
|
||||
LOCK_IX and LOCK_AUTO_INC on the destination table. */
|
||||
|
||||
if (!lock_is_table_exclusive(prebuilt->table,
|
||||
prebuilt->trx)) {
|
||||
goto no_commit;
|
||||
|
@ -2746,11 +2758,11 @@ ha_innobase::write_row(
|
|||
|
||||
if (error == DB_SUCCESS && auto_inc_used) {
|
||||
|
||||
/* Fetch the value that was set in the autoincrement field */
|
||||
/* Fetch the value that was set in the autoincrement field */
|
||||
|
||||
auto_inc = table->next_number_field->val_int();
|
||||
auto_inc = table->next_number_field->val_int();
|
||||
|
||||
if (auto_inc != 0) {
|
||||
if (auto_inc != 0) {
|
||||
/* This call will calculate the max of the current
|
||||
value and the value supplied by the user and
|
||||
update the counter accordingly */
|
||||
|
@ -2762,15 +2774,15 @@ ha_innobase::write_row(
|
|||
The lock is released at each SQL statement's
|
||||
end. */
|
||||
|
||||
error = row_lock_table_autoinc_for_mysql(prebuilt);
|
||||
error = row_lock_table_autoinc_for_mysql(prebuilt);
|
||||
|
||||
if (error != DB_SUCCESS) {
|
||||
|
||||
error = convert_error_code_to_mysql(error, user_thd);
|
||||
goto func_exit;
|
||||
}
|
||||
dict_table_autoinc_update(prebuilt->table, auto_inc);
|
||||
}
|
||||
if (error != DB_SUCCESS) {
|
||||
error = convert_error_code_to_mysql(error,
|
||||
user_thd);
|
||||
goto func_exit;
|
||||
}
|
||||
dict_table_autoinc_update(prebuilt->table, auto_inc);
|
||||
}
|
||||
}
|
||||
|
||||
innodb_srv_conc_exit_innodb(prebuilt->trx);
|
||||
|
@ -2785,7 +2797,6 @@ func_exit:
|
|||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
Converts field data for storage in an InnoDB update vector. */
|
||||
inline
|
||||
|
@ -3071,9 +3082,6 @@ ha_innobase::unlock_row(void)
|
|||
|
||||
DBUG_ENTER("ha_innobase::unlock_row");
|
||||
|
||||
ut_ad(prebuilt->trx ==
|
||||
(trx_t*) current_thd->transaction.all.innobase_tid);
|
||||
|
||||
if (last_query_id != user_thd->query_id) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr,
|
||||
|
@ -4256,8 +4264,6 @@ ha_innobase::delete_all_rows(void)
|
|||
goto fallback;
|
||||
}
|
||||
|
||||
innobase_commit(thd, 1);
|
||||
|
||||
error = convert_error_code_to_mysql(error, NULL);
|
||||
|
||||
DBUG_RETURN(error);
|
||||
|
@ -4514,10 +4520,10 @@ ha_innobase::records_in_range(
|
|||
dict_index_t* index;
|
||||
mysql_byte* key_val_buff2 = (mysql_byte*) my_malloc(
|
||||
table->s->reclength
|
||||
+ table->s->max_key_length + 100,
|
||||
+ table->s->max_key_length + 100,
|
||||
MYF(MY_WME));
|
||||
ulint buff2_len = table->s->reclength
|
||||
+ table->s->max_key_length + 100;
|
||||
+ table->s->max_key_length + 100;
|
||||
dtuple_t* range_start;
|
||||
dtuple_t* range_end;
|
||||
ib_longlong n_rows;
|
||||
|
@ -4674,21 +4680,27 @@ ha_innobase::read_time(
|
|||
ha_rows total_rows;
|
||||
double time_for_scan;
|
||||
|
||||
if (index != table->s->primary_key)
|
||||
return handler::read_time(index, ranges, rows); // Not clustered
|
||||
if (index != table->s->primary_key) {
|
||||
/* Not clustered */
|
||||
return(handler::read_time(index, ranges, rows));
|
||||
}
|
||||
|
||||
if (rows <= 2)
|
||||
return (double) rows;
|
||||
if (rows <= 2) {
|
||||
|
||||
return((double) rows);
|
||||
}
|
||||
|
||||
/* Assume that the read time is proportional to the scan time for all
|
||||
rows + at most one seek per range. */
|
||||
|
||||
time_for_scan = scan_time();
|
||||
|
||||
if ((total_rows = estimate_rows_upper_bound()) < rows)
|
||||
return time_for_scan;
|
||||
if ((total_rows = estimate_rows_upper_bound()) < rows) {
|
||||
|
||||
return (ranges + (double) rows / (double) total_rows * time_for_scan);
|
||||
return(time_for_scan);
|
||||
}
|
||||
|
||||
return(ranges + (double) rows / (double) total_rows * time_for_scan);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -5106,7 +5118,7 @@ ha_innobase::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list)
|
|||
tmp_buff, i, 1);
|
||||
tmp_buff+= i + 1;
|
||||
f_key_info.referenced_table= make_lex_string(thd, 0,
|
||||
tmp_buff, strlen(tmp_buff), 1);
|
||||
tmp_buff, strlen(tmp_buff), 1);
|
||||
|
||||
for (i= 0;;)
|
||||
{
|
||||
|
@ -5624,7 +5636,6 @@ innodb_export_status(void)
|
|||
srv_export_innodb_status();
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
Implements the SHOW INNODB STATUS command. Sends the output of the InnoDB
|
||||
Monitor to the client. */
|
||||
|
@ -5636,6 +5647,8 @@ innodb_show_status(
|
|||
{
|
||||
Protocol *protocol= thd->protocol;
|
||||
trx_t* trx;
|
||||
long flen;
|
||||
char* str;
|
||||
|
||||
DBUG_ENTER("innodb_show_status");
|
||||
|
||||
|
@ -5652,14 +5665,13 @@ innodb_show_status(
|
|||
|
||||
/* We let the InnoDB Monitor to output at most 64000 bytes of text. */
|
||||
|
||||
long flen;
|
||||
char* str;
|
||||
|
||||
mutex_enter_noninline(&srv_monitor_file_mutex);
|
||||
rewind(srv_monitor_file);
|
||||
|
||||
srv_printf_innodb_monitor(srv_monitor_file);
|
||||
flen = ftell(srv_monitor_file);
|
||||
os_file_set_eof(srv_monitor_file);
|
||||
|
||||
if (flen < 0) {
|
||||
flen = 0;
|
||||
} else if (flen > 64000 - 1) {
|
||||
|
@ -5669,10 +5681,10 @@ innodb_show_status(
|
|||
/* allocate buffer for the string, and
|
||||
read the contents of the temporary file */
|
||||
|
||||
if (!(str = my_malloc(flen + 1, MYF(0))))
|
||||
{
|
||||
mutex_exit_noninline(&srv_monitor_file_mutex);
|
||||
DBUG_RETURN(TRUE);
|
||||
if (!(str = my_malloc(flen + 1, MYF(0)))) {
|
||||
mutex_exit_noninline(&srv_monitor_file_mutex);
|
||||
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
rewind(srv_monitor_file);
|
||||
|
@ -5686,7 +5698,6 @@ innodb_show_status(
|
|||
|
||||
if (protocol->send_fields(&field_list, Protocol::SEND_NUM_ROWS |
|
||||
Protocol::SEND_EOF)) {
|
||||
|
||||
my_free(str, MYF(0));
|
||||
|
||||
DBUG_RETURN(TRUE);
|
||||
|
@ -5696,10 +5707,12 @@ innodb_show_status(
|
|||
protocol->store(str, flen, system_charset_info);
|
||||
my_free(str, MYF(0));
|
||||
|
||||
if (protocol->write())
|
||||
DBUG_RETURN(TRUE);
|
||||
if (protocol->write()) {
|
||||
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
send_eof(thd);
|
||||
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
|
@ -6093,7 +6106,7 @@ ha_innobase::get_auto_increment()
|
|||
|
||||
if (error) {
|
||||
|
||||
return(~(ulonglong) 0);
|
||||
return(~(ulonglong) 0);
|
||||
}
|
||||
|
||||
return((ulonglong) nr);
|
||||
|
@ -6115,7 +6128,8 @@ ha_innobase::cmp_ref(
|
|||
|
||||
/* Do type-aware comparison of Primary Key members. PK members
|
||||
are always NOT NULL, so no checks for NULL are performed */
|
||||
KEY_PART_INFO *key_part= table->key_info[table->s->primary_key].key_part;
|
||||
KEY_PART_INFO *key_part=
|
||||
table->key_info[table->s->primary_key].key_part;
|
||||
KEY_PART_INFO *key_part_end=
|
||||
key_part + table->key_info[table->s->primary_key].key_parts;
|
||||
for (; key_part != key_part_end; ++key_part) {
|
||||
|
@ -6260,19 +6274,21 @@ innobase_query_is_update(void)
|
|||
|
||||
thd = (THD *)innobase_current_thd();
|
||||
|
||||
if ( thd->lex->sql_command == SQLCOM_REPLACE ||
|
||||
thd->lex->sql_command == SQLCOM_REPLACE_SELECT ||
|
||||
( thd->lex->sql_command == SQLCOM_LOAD &&
|
||||
thd->lex->duplicates == DUP_REPLACE )) {
|
||||
return true;
|
||||
if (thd->lex->sql_command == SQLCOM_REPLACE ||
|
||||
thd->lex->sql_command == SQLCOM_REPLACE_SELECT ||
|
||||
(thd->lex->sql_command == SQLCOM_LOAD &&
|
||||
thd->lex->duplicates == DUP_REPLACE)) {
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
if ( thd->lex->sql_command == SQLCOM_INSERT &&
|
||||
thd->lex->duplicates == DUP_UPDATE ) {
|
||||
return true;
|
||||
if (thd->lex->sql_command == SQLCOM_INSERT &&
|
||||
thd->lex->duplicates == DUP_UPDATE) {
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
return false;
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6308,18 +6324,13 @@ innobase_xa_prepare(
|
|||
"InnoDB: but trx->conc_state != TRX_NOT_STARTED\n");
|
||||
}
|
||||
|
||||
if (all || (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
||||
if (all
|
||||
|| (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) {
|
||||
|
||||
/* We were instructed to prepare the whole transaction, or
|
||||
this is an SQL statement end and autocommit is on */
|
||||
|
||||
/* If there is no active InnoDB transaction,
|
||||
trx_prepare_for_mysql() will (temporarily) start one */
|
||||
|
||||
if (trx->active_trans == 0) {
|
||||
|
||||
trx->active_trans = 1;
|
||||
}
|
||||
ut_ad(trx->active_trans);
|
||||
|
||||
error = trx_prepare_for_mysql(trx);
|
||||
} else {
|
||||
|
@ -6329,7 +6340,7 @@ innobase_xa_prepare(
|
|||
if (trx->auto_inc_lock) {
|
||||
/* If we had reserved the auto-inc lock for some
|
||||
table in this SQL statement we release it now */
|
||||
|
||||
|
||||
row_unlock_table_autoinc_for_mysql(trx);
|
||||
}
|
||||
/* Store the current undo_no of the transaction so that we
|
||||
|
@ -6359,10 +6370,11 @@ innobase_xa_recover(
|
|||
uint len) /* in: number of slots in xid_list */
|
||||
{
|
||||
if (len == 0 || xid_list == NULL) {
|
||||
return 0;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
return (trx_recover_for_mysql(xid_list, len));
|
||||
return(trx_recover_for_mysql(xid_list, len));
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -6373,7 +6385,7 @@ int
|
|||
innobase_commit_by_xid(
|
||||
/*===================*/
|
||||
/* out: 0 or error number */
|
||||
XID* xid) /* in: X/Open XA Transaction Identification */
|
||||
XID* xid) /* in: X/Open XA transaction identification */
|
||||
{
|
||||
trx_t* trx;
|
||||
|
||||
|
@ -6396,7 +6408,7 @@ int
|
|||
innobase_rollback_by_xid(
|
||||
/*=====================*/
|
||||
/* out: 0 or error number */
|
||||
XID *xid) /* in : X/Open XA Transaction Idenfification */
|
||||
XID *xid) /* in: X/Open XA transaction idenfification */
|
||||
{
|
||||
trx_t* trx;
|
||||
|
||||
|
|
|
@ -239,7 +239,6 @@ extern ulong srv_auto_extend_increment;
|
|||
extern ulong srv_n_spin_wait_rounds;
|
||||
extern ulong srv_n_free_tickets_to_enter;
|
||||
extern ulong srv_thread_sleep_delay;
|
||||
extern ulong srv_max_purge_lag;
|
||||
extern ulong srv_thread_concurrency;
|
||||
}
|
||||
|
||||
|
|
|
@ -395,6 +395,16 @@ int ha_init()
|
|||
ha_was_inited_ok(ht++);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_FEDERATED_DB
|
||||
if (have_federated_db == SHOW_OPTION_YES)
|
||||
{
|
||||
if (federated_db_init())
|
||||
{
|
||||
have_federated_db= SHOW_OPTION_DISABLED;
|
||||
error= 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_ARCHIVE_DB
|
||||
if (have_archive_db == SHOW_OPTION_YES)
|
||||
{
|
||||
|
@ -441,6 +451,10 @@ int ha_panic(enum ha_panic_function flag)
|
|||
if (have_ndbcluster == SHOW_OPTION_YES)
|
||||
error|=ndbcluster_end();
|
||||
#endif
|
||||
#ifdef HAVE_FEDERATED_DB
|
||||
if (have_federated_db == SHOW_OPTION_YES)
|
||||
error|= federated_db_end();
|
||||
#endif
|
||||
#ifdef HAVE_ARCHIVE_DB
|
||||
if (have_archive_db == SHOW_OPTION_YES)
|
||||
error|= archive_db_end();
|
||||
|
@ -1606,7 +1620,12 @@ int handler::rename_table(const char * from, const char * to)
|
|||
}
|
||||
|
||||
/*
|
||||
Tell the handler to turn on or off transaction in the handler
|
||||
Tell the storage engine that it is allowed to "disable transaction" in the
|
||||
handler. It is a hint that ACID is not required - it is used in NDB for
|
||||
ALTER TABLE, for example, when data are copied to temporary table.
|
||||
A storage engine may treat this hint any way it likes. NDB for example
|
||||
starts to commit every now and then automatically.
|
||||
This hint can be safely ignored.
|
||||
*/
|
||||
|
||||
int ha_enable_transaction(THD *thd, bool on)
|
||||
|
@ -1616,7 +1635,15 @@ int ha_enable_transaction(THD *thd, bool on)
|
|||
DBUG_ENTER("ha_enable_transaction");
|
||||
thd->transaction.on= on;
|
||||
if (on)
|
||||
ha_commit(thd);
|
||||
{
|
||||
/*
|
||||
Now all storage engines should have transaction handling enabled.
|
||||
But some may have it enabled all the time - "disabling" transactions
|
||||
is an optimization hint that storage engine is free to ignore.
|
||||
So, let's commit an open transaction (if any) now.
|
||||
*/
|
||||
error= end_trans(thd, COMMIT);
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
|
11
sql/item.h
11
sql/item.h
|
@ -113,7 +113,7 @@ public:
|
|||
typedef bool (Item::*Item_processor)(byte *arg);
|
||||
typedef Item* (Item::*Item_transformer) (byte *arg);
|
||||
|
||||
typedef void (*Item_cond_traverser) (const Item *item, void *arg);
|
||||
typedef void (*Cond_traverser) (const Item *item, void *arg);
|
||||
|
||||
class Item {
|
||||
Item(const Item &); /* Prevent use of these */
|
||||
|
@ -393,18 +393,17 @@ public:
|
|||
return (this->*processor)(arg);
|
||||
}
|
||||
|
||||
virtual Item* transform(Item_transformer transformer, byte *arg)
|
||||
virtual Item* transform(Item_transformer transformer, byte *arg)
|
||||
{
|
||||
return (this->*transformer)(arg);
|
||||
}
|
||||
|
||||
virtual void traverse_cond(Item_cond_traverser traverser,
|
||||
void *arg,
|
||||
traverse_order order = POSTFIX)
|
||||
virtual void traverse_cond(Cond_traverser traverser,
|
||||
void *arg, traverse_order order)
|
||||
{
|
||||
(*traverser)(this, arg);
|
||||
}
|
||||
|
||||
|
||||
virtual bool remove_dependence_processor(byte * arg) { return 0; }
|
||||
virtual bool remove_fixed(byte * arg) { fixed= 0; return 0; }
|
||||
virtual bool cleanup_processor(byte *arg);
|
||||
|
|
|
@ -2369,9 +2369,8 @@ Item *Item_cond::transform(Item_transformer transformer, byte *arg)
|
|||
return Item_func::transform(transformer, arg);
|
||||
}
|
||||
|
||||
void Item_cond::traverse_cond(Item_cond_traverser traverser,
|
||||
void *arg,
|
||||
traverse_order order)
|
||||
void Item_cond::traverse_cond(Cond_traverser traverser,
|
||||
void *arg, traverse_order order)
|
||||
{
|
||||
List_iterator<Item> li(list);
|
||||
Item *item;
|
||||
|
|
|
@ -1028,9 +1028,7 @@ public:
|
|||
void copy_andor_arguments(THD *thd, Item_cond *item);
|
||||
bool walk(Item_processor processor, byte *arg);
|
||||
Item *transform(Item_transformer transformer, byte *arg);
|
||||
void traverse_cond(Item_cond_traverser,
|
||||
void *arg,
|
||||
traverse_order order = POSTFIX);
|
||||
void traverse_cond(Cond_traverser, void *arg, traverse_order order);
|
||||
void neg_arguments(THD *thd);
|
||||
};
|
||||
|
||||
|
@ -1039,8 +1037,8 @@ public:
|
|||
The class Item_equal is used to represent conjunctions of equality
|
||||
predicates of the form field1 = field2, and field=const in where
|
||||
conditions and on expressions.
|
||||
|
||||
All equality predicates of the form field1=field2 contained in a
|
||||
|
||||
All equality predicates of the form field1=field2 contained in a
|
||||
conjunction are substituted for a sequence of items of this class.
|
||||
An item of this class Item_equal(f1,f2,...fk) represents a
|
||||
multiple equality f1=f2=...=fk.
|
||||
|
|
|
@ -360,9 +360,8 @@ bool Item_func::walk (Item_processor processor, byte *argument)
|
|||
return (this->*processor)(argument);
|
||||
}
|
||||
|
||||
void Item_func::traverse_cond(Item_cond_traverser traverser,
|
||||
void *argument,
|
||||
traverse_order order)
|
||||
void Item_func::traverse_cond(Cond_traverser traverser,
|
||||
void *argument, traverse_order order)
|
||||
{
|
||||
if (arg_count)
|
||||
{
|
||||
|
|
|
@ -163,9 +163,8 @@ public:
|
|||
uint flags= 0);
|
||||
bool walk(Item_processor processor, byte *arg);
|
||||
Item *transform(Item_transformer transformer, byte *arg);
|
||||
void traverse_cond(Item_cond_traverser traverser,
|
||||
void * arg,
|
||||
traverse_order order = POSTFIX);
|
||||
void traverse_cond(Cond_traverser traverser,
|
||||
void * arg, traverse_order order);
|
||||
};
|
||||
|
||||
|
||||
|
|
53
sql/log.cc
53
sql/log.cc
|
@ -1296,10 +1296,9 @@ void MYSQL_LOG::new_file(bool need_lock)
|
|||
}
|
||||
|
||||
if (need_lock)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_log);
|
||||
pthread_mutex_lock(&LOCK_index);
|
||||
}
|
||||
pthread_mutex_lock(&LOCK_index);
|
||||
|
||||
safe_mutex_assert_owner(&LOCK_log);
|
||||
safe_mutex_assert_owner(&LOCK_index);
|
||||
|
||||
|
@ -1377,10 +1376,9 @@ void MYSQL_LOG::new_file(bool need_lock)
|
|||
|
||||
end:
|
||||
if (need_lock)
|
||||
{
|
||||
pthread_mutex_unlock(&LOCK_index);
|
||||
pthread_mutex_unlock(&LOCK_log);
|
||||
}
|
||||
pthread_mutex_unlock(&LOCK_index);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
@ -1404,11 +1402,7 @@ bool MYSQL_LOG::append(Log_event* ev)
|
|||
bytes_written+= ev->data_written;
|
||||
DBUG_PRINT("info",("max_size: %lu",max_size));
|
||||
if ((uint) my_b_append_tell(&log_file) > max_size)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_index);
|
||||
new_file(0);
|
||||
pthread_mutex_unlock(&LOCK_index);
|
||||
}
|
||||
|
||||
err:
|
||||
pthread_mutex_unlock(&LOCK_log);
|
||||
|
@ -1423,9 +1417,9 @@ bool MYSQL_LOG::appendv(const char* buf, uint len,...)
|
|||
DBUG_ENTER("MYSQL_LOG::appendv");
|
||||
va_list(args);
|
||||
va_start(args,len);
|
||||
|
||||
|
||||
DBUG_ASSERT(log_file.type == SEQ_READ_APPEND);
|
||||
|
||||
|
||||
pthread_mutex_lock(&LOCK_log);
|
||||
do
|
||||
{
|
||||
|
@ -1438,11 +1432,7 @@ bool MYSQL_LOG::appendv(const char* buf, uint len,...)
|
|||
} while ((buf=va_arg(args,const char*)) && (len=va_arg(args,uint)));
|
||||
DBUG_PRINT("info",("max_size: %lu",max_size));
|
||||
if ((uint) my_b_append_tell(&log_file) > max_size)
|
||||
{
|
||||
pthread_mutex_lock(&LOCK_index);
|
||||
new_file(0);
|
||||
pthread_mutex_unlock(&LOCK_index);
|
||||
}
|
||||
|
||||
err:
|
||||
pthread_mutex_unlock(&LOCK_log);
|
||||
|
@ -1774,15 +1764,10 @@ err:
|
|||
|
||||
void MYSQL_LOG::rotate_and_purge(uint flags)
|
||||
{
|
||||
if (!prepared_xids && // see new_file() for the explanation
|
||||
((flags & RP_FORCE_ROTATE) ||
|
||||
(my_b_tell(&log_file) >= (my_off_t) max_size)))
|
||||
if ((flags & RP_FORCE_ROTATE) ||
|
||||
(my_b_tell(&log_file) >= (my_off_t) max_size))
|
||||
{
|
||||
if (flags & RP_LOCK_LOG_IS_ALREADY_LOCKED)
|
||||
pthread_mutex_lock(&LOCK_index);
|
||||
new_file(!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED));
|
||||
if (flags & RP_LOCK_LOG_IS_ALREADY_LOCKED)
|
||||
pthread_mutex_unlock(&LOCK_index);
|
||||
#ifdef HAVE_REPLICATION
|
||||
// QQ why do we need #ifdef here ???
|
||||
if (expire_logs_days)
|
||||
|
@ -1828,9 +1813,8 @@ uint MYSQL_LOG::next_file_id()
|
|||
|
||||
bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
|
||||
{
|
||||
bool error= 0;
|
||||
VOID(pthread_mutex_lock(&LOCK_log));
|
||||
DBUG_ENTER("MYSQL_LOG::write(THD *, IO_CACHE *, Log_event *)");
|
||||
VOID(pthread_mutex_lock(&LOCK_log));
|
||||
|
||||
if (likely(is_open())) // Should always be true
|
||||
{
|
||||
|
@ -1888,12 +1872,22 @@ DBUG_skip_commit:
|
|||
goto err;
|
||||
}
|
||||
signal_update();
|
||||
DBUG_PRINT("info",("max_size: %lu",max_size));
|
||||
rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
|
||||
/*
|
||||
if commit_event is Xid_log_event, increase the number of
|
||||
prepared_xids (it's decreasd in ::unlog()). Binlog cannot be rotated
|
||||
if there're prepared xids in it - see the comment in new_file() for
|
||||
an explanation.
|
||||
If the commit_event is not Xid_log_event (then it's a Query_log_event)
|
||||
rotate binlog, if necessary.
|
||||
*/
|
||||
if (commit_event->get_type_code() == XID_EVENT)
|
||||
thread_safe_increment(prepared_xids, &LOCK_prep_xids);
|
||||
else
|
||||
rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
|
||||
}
|
||||
VOID(pthread_mutex_unlock(&LOCK_log));
|
||||
|
||||
DBUG_RETURN(error);
|
||||
DBUG_RETURN(0);
|
||||
|
||||
err:
|
||||
if (!write_error)
|
||||
|
@ -2992,7 +2986,6 @@ int TC_LOG_BINLOG::log(THD *thd, my_xid xid)
|
|||
{
|
||||
Xid_log_event xle(thd, xid);
|
||||
IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot];
|
||||
thread_safe_increment(prepared_xids, &LOCK_prep_xids);
|
||||
return !binlog_end_trans(thd, trans_log, &xle); // invert return value
|
||||
}
|
||||
|
||||
|
@ -3000,7 +2993,7 @@ void TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid)
|
|||
{
|
||||
if (thread_safe_dec_and_test(prepared_xids, &LOCK_prep_xids))
|
||||
pthread_cond_signal(&COND_prep_xids);
|
||||
rotate_and_purge(0); // in case ::write() was not able to rotate
|
||||
rotate_and_purge(0); // as ::write() did not rotate
|
||||
}
|
||||
|
||||
int TC_LOG_BINLOG::recover(IO_CACHE *log, Format_description_log_event *fdle)
|
||||
|
|
|
@ -1684,6 +1684,9 @@ void Start_log_event_v3::print(FILE* file, bool short_form, LAST_EVENT_INFO* las
|
|||
if (created)
|
||||
fprintf(file," at startup");
|
||||
fputc('\n', file);
|
||||
if (flags & LOG_EVENT_BINLOG_IN_USE_F)
|
||||
fprintf(file, "# Warning: this binlog was not closed properly. "
|
||||
"Most probably mysqld crashed writing it.\n");
|
||||
}
|
||||
if (!artificial_event && created)
|
||||
{
|
||||
|
|
|
@ -635,14 +635,14 @@ TABLE_LIST *find_table_in_list(TABLE_LIST *table,
|
|||
|
||||
TABLE_LIST* unique_table(TABLE_LIST *table, TABLE_LIST *table_list)
|
||||
{
|
||||
DBUG_ENTER("unique_table");
|
||||
DBUG_PRINT("enter", ("table alias: %s", table->alias));
|
||||
TABLE_LIST *res;
|
||||
const char *d_name= table->db, *t_name= table->table_name;
|
||||
char d_name_buff[MAX_ALIAS_NAME], t_name_buff[MAX_ALIAS_NAME];
|
||||
DBUG_ENTER("unique_table");
|
||||
DBUG_PRINT("enter", ("table alias: %s", table->alias));
|
||||
/* temporary table is always unique */
|
||||
if (table->table && table->table->s->tmp_table != NO_TMP_TABLE)
|
||||
return 0;
|
||||
DBUG_RETURN(0);
|
||||
if (table->view)
|
||||
{
|
||||
/* it is view and table opened */
|
||||
|
|
|
@ -1061,9 +1061,9 @@ public:
|
|||
SAVEPOINT *savepoints;
|
||||
THD_TRANS all; // Trans since BEGIN WORK
|
||||
THD_TRANS stmt; // Trans for current statement
|
||||
bool on;
|
||||
XID xid;
|
||||
enum xa_states xa_state;
|
||||
bool on; // see ha_enable_transaction()
|
||||
XID xid; // transaction identifier
|
||||
enum xa_states xa_state; // used by external XA only
|
||||
/*
|
||||
Tables changed in transaction (that must be invalidated in query cache).
|
||||
List contain only transactional tables, that not invalidated in query
|
||||
|
|
|
@ -1271,7 +1271,7 @@ int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
|
|||
bool mysql_show_binlog_events(THD* thd)
|
||||
{
|
||||
Protocol *protocol= thd->protocol;
|
||||
DBUG_ENTER("show_binlog_events");
|
||||
DBUG_ENTER("mysql_show_binlog_events");
|
||||
List<Item> field_list;
|
||||
const char *errmsg = 0;
|
||||
bool ret = TRUE;
|
||||
|
|
Loading…
Add table
Reference in a new issue