1SET DEFAULT_STORAGE_ENGINE = 'tokudb';
2DROP TABLE IF EXISTS foo;
3create table foo (a int, b int, c blob, primary key (a))engine=tokudb;
4insert into foo values (1,10,"100");
5select * from foo;
6a	b	c
71	10	100
8replace into foo values (1,100,"aaaaa");
9select * from foo;
10a	b	c
111	100	aaaaa
12drop table foo;
13create table foo (a int, b blob, c int, d blob, primary key (a));
14insert into foo values (1,"10",100,"1000"),(4,"40",400,"4000"),(6,"60",600,"6000"),(2,"20",200,"2000"),(5,"50",500,"5000"),(3,"30",300,"3000");
15select * from foo;
16a	b	c	d
171	10	100	1000
182	20	200	2000
193	30	300	3000
204	40	400	4000
215	50	500	5000
226	60	600	6000
23update foo set b="alpha" where a=4;
24select * From foo;
25a	b	c	d
261	10	100	1000
272	20	200	2000
283	30	300	3000
294	alpha	400	4000
305	50	500	5000
316	60	600	6000
32update foo set b="beta", d="gamma" where a=2;
33select * From foo;
34a	b	c	d
351	10	100	1000
362	beta	200	gamma
373	30	300	3000
384	alpha	400	4000
395	50	500	5000
406	60	600	6000
41update foo set b=d where a>4;
42select * from foo;
43a	b	c	d
441	10	100	1000
452	beta	200	gamma
463	30	300	3000
474	alpha	400	4000
485	5000	500	5000
496	6000	600	6000
50update foo set b="holy" where c > 100;
51select * from foo;
52a	b	c	d
531	10	100	1000
542	holy	200	gamma
553	holy	300	3000
564	holy	400	4000
575	holy	500	5000
586	holy	600	6000
59delete from foo;
60insert into foo values (1,"10",100,"1000"),(4,"40",400,"4000"),(6,"60",600,"6000"),(2,"20",200,"2000"),(5,"50",500,"5000"),(3,"30",300,"3000");
61select * from foo;
62a	b	c	d
631	10	100	1000
642	20	200	2000
653	30	300	3000
664	40	400	4000
675	50	500	5000
686	60	600	6000
69replace into foo values (2,"twenty",200,"two thousand"),(3,"thirty",300,"three grand");
70select * from foo;
71a	b	c	d
721	10	100	1000
732	twenty	200	two thousand
743	thirty	300	three grand
754	40	400	4000
765	50	500	5000
776	60	600	6000
78delete from foo;
79insert into foo values (1,"10",100,"1000"),(4,"40",400,"4000"),(6,"60",600,"6000"),(2,"20",200,"2000"),(5,"50",500,"5000"),(3,"30",300,"3000");
80select * from foo;
81a	b	c	d
821	10	100	1000
832	20	200	2000
843	30	300	3000
854	40	400	4000
865	50	500	5000
876	60	600	6000
88insert into foo values (2,"twenty",200,"two thousand"),(3,"thirty",300,"three grand") on duplicate key update a = a*1000, b = "updated", d = "column";
89select * from foo;
90a	b	c	d
911	10	100	1000
924	40	400	4000
935	50	500	5000
946	60	600	6000
952000	updated	200	column
963000	updated	300	column
97DROP TABLE foo;
98