Commit 1ea2bc38 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/mydev/mysql-5.0

into mysql.com:/home/mydev/mysql-5.0-5000


sql/set_var.cc:
  Auto merged
parents 2362d921 70e47994
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -172,6 +172,7 @@ nick@nick.leippe.com
papa@gbichot.local
patg@krsna.patg.net
patg@patrick-galbraiths-computer.local
patg@pc248.lfp.kcls.org
paul@central.snake.net
paul@frost.snake.net
paul@ice.local
+1 −1
Original line number Diff line number Diff line
-- require r/have_federated_db.require
disable_query_log;
show variables like "have_federated_db";
show variables like "have_federated_engine";
enable_query_log;
+114 −5
Original line number Diff line number Diff line
@@ -130,9 +130,9 @@ 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`) ) 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 ( `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);
@@ -162,7 +162,7 @@ id name other
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 = 'Secend Name';
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%';
@@ -181,6 +181,85 @@ id name other
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';
id	name	other
2	Second Name	2222
select * from federated.t1 where other = '2222';
id	name	other
2	Second Name	2222
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';
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;
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';
id	name	bincol	floatval	other
2	second	f	22.22	2222
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;
id	name	bincol	floatval	other
2	second	f	22.22	2222
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';
id	name	bincol	floatval	other
3	third	g	22.22	2222
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';
id	name	bincol	floatval	other
3	third	g	22.22	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;
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';
@@ -550,16 +629,46 @@ 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, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code)) DEFAULT CHARSET=latin1;
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, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/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;
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';
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;
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;
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;
+1 −1
Original line number Diff line number Diff line
Variable_name	Value
have_federated_db	YES
have_federated_engine	YES
+96 −8
Original line number Diff line number Diff line
@@ -68,12 +68,14 @@ select * from federated.t1 where id = 5;
delete from federated.t1;
select * from federated.t1 where id = 5;

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';

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`) );

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';

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);
@@ -90,19 +92,78 @@ 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 = 'Secend Name';
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, name varchar(32), floatval float, other int) DEFAULT CHARSET=latin1;
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';

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));

# 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';

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;

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';
# these both should be the same
@@ -452,15 +513,17 @@ 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, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code)) DEFAULT CHARSET=latin1;
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, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', primary key(id), index(code)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 COMMENT='mysql://root@127.0.0.1:9308/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;
select * from federated.t1 where fileguts = 'jimbob';
# test blob indexes

# TODO
# 
@@ -490,11 +553,36 @@ 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));

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');

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;

connection master;
--disable_warnings
drop table if exists federated.t1;
drop database if exists federated;
--enable_warnings

Loading