-
Notifications
You must be signed in to change notification settings - Fork 0
/
row_cache_for_mysql.5.1.48_2011_09_27.diff
3499 lines (3392 loc) · 127 KB
/
row_cache_for_mysql.5.1.48_2011_09_27.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Index: storage/innodb_plugin/Makefile.in
===================================================================
--- storage/innodb_plugin/Makefile.in (revision 118)
+++ storage/innodb_plugin/Makefile.in (revision 198)
@@ -162,7 +162,12 @@
libinnobase_a-ut0list.$(OBJEXT) libinnobase_a-ut0mem.$(OBJEXT) \
libinnobase_a-ut0rbt.$(OBJEXT) libinnobase_a-ut0rnd.$(OBJEXT) \
libinnobase_a-ut0ut.$(OBJEXT) libinnobase_a-ut0vec.$(OBJEXT) \
- libinnobase_a-ut0wqueue.$(OBJEXT)
+ libinnobase_a-ut0wqueue.$(OBJEXT) \
+ libinnobase_a-row0cache.$(OBJEXT) \
+ libinnobase_a-row0cache0hash.$(OBJEXT) \
+ libinnobase_a-row0cache0lru.$(OBJEXT) \
+ libinnobase_a-row0cache0mempool.$(OBJEXT) \
+ libinnobase_a-row0cache0filter.$(OBJEXT)
libinnobase_a_OBJECTS = $(am_libinnobase_a_OBJECTS)
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@@ -237,7 +242,12 @@
ha_innodb_plugin_la-ut0dbg.lo ha_innodb_plugin_la-ut0list.lo \
ha_innodb_plugin_la-ut0mem.lo ha_innodb_plugin_la-ut0rbt.lo \
ha_innodb_plugin_la-ut0rnd.lo ha_innodb_plugin_la-ut0ut.lo \
- ha_innodb_plugin_la-ut0vec.lo ha_innodb_plugin_la-ut0wqueue.lo
+ ha_innodb_plugin_la-ut0vec.lo ha_innodb_plugin_la-ut0wqueue.lo \
+ ha_innodb_plugin_la-row0cache.lo \
+ ha_innodb_plugin_la-row0cache0hash.lo \
+ ha_innodb_plugin_la-row0cache0lru.lo \
+ ha_innodb_plugin_la-row0cache0mempool.lo \
+ ha_innodb_plugin_la-row0cache0filter.lo
am_ha_innodb_plugin_la_OBJECTS = $(am__objects_1)
ha_innodb_plugin_la_OBJECTS = $(am_ha_innodb_plugin_la_OBJECTS)
ha_innodb_plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
@@ -516,14 +526,10 @@
plugin_blackhole_static_target = @plugin_blackhole_static_target@
plugin_csv_shared_target = @plugin_csv_shared_target@
plugin_csv_static_target = @plugin_csv_static_target@
-plugin_daemon_example_shared_target = @plugin_daemon_example_shared_target@
-plugin_daemon_example_static_target = @plugin_daemon_example_static_target@
plugin_example_shared_target = @plugin_example_shared_target@
plugin_example_static_target = @plugin_example_static_target@
plugin_federated_shared_target = @plugin_federated_shared_target@
plugin_federated_static_target = @plugin_federated_static_target@
-plugin_ftexample_shared_target = @plugin_ftexample_shared_target@
-plugin_ftexample_static_target = @plugin_ftexample_static_target@
plugin_heap_shared_target = @plugin_heap_shared_target@
plugin_heap_static_target = @plugin_heap_static_target@
plugin_ibmdb2i_shared_target = @plugin_ibmdb2i_shared_target@
@@ -565,7 +571,6 @@
target_os = @target_os@
target_vendor = @target_vendor@
tools_dirs = @tools_dirs@
-top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
uname_prog = @uname_prog@
@@ -782,6 +787,11 @@
include/ut0vec.h \
include/ut0vec.ic \
include/ut0wqueue.h \
+ include/row0cache.h \
+ include/row0cache0hash.h \
+ include/row0cache0lru.h \
+ include/row0cache0mempool.h \
+ include/row0cache0filter.h \
mem/mem0dbg.c
EXTRA_LIBRARIES = libinnobase.a
@@ -879,7 +889,12 @@
ut/ut0rnd.c \
ut/ut0ut.c \
ut/ut0vec.c \
- ut/ut0wqueue.c
+ ut/ut0wqueue.c \
+ cache/row0cache.c \
+ cache/row0cache0hash.c \
+ cache/row0cache0lru.c \
+ cache/row0cache0mempool.c \
+ cache/row0cache0filter.c
libinnobase_a_CXXFLAGS = $(AM_CFLAGS)
libinnobase_a_CFLAGS = $(AM_CFLAGS)
@@ -1025,6 +1040,11 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-read0read.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-rem0cmp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-rem0rec.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-row0cache.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-row0cache0filter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-row0cache0hash.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-row0cache0lru.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-row0cache0mempool.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-row0ext.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-row0ins.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ha_innodb_plugin_la-row0merge.Plo@am__quote@
@@ -1118,6 +1138,11 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-read0read.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-rem0cmp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-rem0rec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-row0cache.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-row0cache0filter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-row0cache0hash.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-row0cache0lru.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-row0cache0mempool.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-row0ext.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-row0ins.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libinnobase_a-row0merge.Po@am__quote@
@@ -2423,6 +2448,76 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-ut0wqueue.obj `if test -f 'ut/ut0wqueue.c'; then $(CYGPATH_W) 'ut/ut0wqueue.c'; else $(CYGPATH_W) '$(srcdir)/ut/ut0wqueue.c'; fi`
+libinnobase_a-row0cache.o: cache/row0cache.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -MT libinnobase_a-row0cache.o -MD -MP -MF $(DEPDIR)/libinnobase_a-row0cache.Tpo -c -o libinnobase_a-row0cache.o `test -f 'cache/row0cache.c' || echo '$(srcdir)/'`cache/row0cache.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libinnobase_a-row0cache.Tpo $(DEPDIR)/libinnobase_a-row0cache.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache.c' object='libinnobase_a-row0cache.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-row0cache.o `test -f 'cache/row0cache.c' || echo '$(srcdir)/'`cache/row0cache.c
+
+libinnobase_a-row0cache.obj: cache/row0cache.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -MT libinnobase_a-row0cache.obj -MD -MP -MF $(DEPDIR)/libinnobase_a-row0cache.Tpo -c -o libinnobase_a-row0cache.obj `if test -f 'cache/row0cache.c'; then $(CYGPATH_W) 'cache/row0cache.c'; else $(CYGPATH_W) '$(srcdir)/cache/row0cache.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libinnobase_a-row0cache.Tpo $(DEPDIR)/libinnobase_a-row0cache.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache.c' object='libinnobase_a-row0cache.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-row0cache.obj `if test -f 'cache/row0cache.c'; then $(CYGPATH_W) 'cache/row0cache.c'; else $(CYGPATH_W) '$(srcdir)/cache/row0cache.c'; fi`
+
+libinnobase_a-row0cache0hash.o: cache/row0cache0hash.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -MT libinnobase_a-row0cache0hash.o -MD -MP -MF $(DEPDIR)/libinnobase_a-row0cache0hash.Tpo -c -o libinnobase_a-row0cache0hash.o `test -f 'cache/row0cache0hash.c' || echo '$(srcdir)/'`cache/row0cache0hash.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libinnobase_a-row0cache0hash.Tpo $(DEPDIR)/libinnobase_a-row0cache0hash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0hash.c' object='libinnobase_a-row0cache0hash.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-row0cache0hash.o `test -f 'cache/row0cache0hash.c' || echo '$(srcdir)/'`cache/row0cache0hash.c
+
+libinnobase_a-row0cache0hash.obj: cache/row0cache0hash.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -MT libinnobase_a-row0cache0hash.obj -MD -MP -MF $(DEPDIR)/libinnobase_a-row0cache0hash.Tpo -c -o libinnobase_a-row0cache0hash.obj `if test -f 'cache/row0cache0hash.c'; then $(CYGPATH_W) 'cache/row0cache0hash.c'; else $(CYGPATH_W) '$(srcdir)/cache/row0cache0hash.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libinnobase_a-row0cache0hash.Tpo $(DEPDIR)/libinnobase_a-row0cache0hash.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0hash.c' object='libinnobase_a-row0cache0hash.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-row0cache0hash.obj `if test -f 'cache/row0cache0hash.c'; then $(CYGPATH_W) 'cache/row0cache0hash.c'; else $(CYGPATH_W) '$(srcdir)/cache/row0cache0hash.c'; fi`
+
+libinnobase_a-row0cache0lru.o: cache/row0cache0lru.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -MT libinnobase_a-row0cache0lru.o -MD -MP -MF $(DEPDIR)/libinnobase_a-row0cache0lru.Tpo -c -o libinnobase_a-row0cache0lru.o `test -f 'cache/row0cache0lru.c' || echo '$(srcdir)/'`cache/row0cache0lru.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libinnobase_a-row0cache0lru.Tpo $(DEPDIR)/libinnobase_a-row0cache0lru.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0lru.c' object='libinnobase_a-row0cache0lru.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-row0cache0lru.o `test -f 'cache/row0cache0lru.c' || echo '$(srcdir)/'`cache/row0cache0lru.c
+
+libinnobase_a-row0cache0lru.obj: cache/row0cache0lru.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -MT libinnobase_a-row0cache0lru.obj -MD -MP -MF $(DEPDIR)/libinnobase_a-row0cache0lru.Tpo -c -o libinnobase_a-row0cache0lru.obj `if test -f 'cache/row0cache0lru.c'; then $(CYGPATH_W) 'cache/row0cache0lru.c'; else $(CYGPATH_W) '$(srcdir)/cache/row0cache0lru.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libinnobase_a-row0cache0lru.Tpo $(DEPDIR)/libinnobase_a-row0cache0lru.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0lru.c' object='libinnobase_a-row0cache0lru.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-row0cache0lru.obj `if test -f 'cache/row0cache0lru.c'; then $(CYGPATH_W) 'cache/row0cache0lru.c'; else $(CYGPATH_W) '$(srcdir)/cache/row0cache0lru.c'; fi`
+
+libinnobase_a-row0cache0mempool.o: cache/row0cache0mempool.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -MT libinnobase_a-row0cache0mempool.o -MD -MP -MF $(DEPDIR)/libinnobase_a-row0cache0mempool.Tpo -c -o libinnobase_a-row0cache0mempool.o `test -f 'cache/row0cache0mempool.c' || echo '$(srcdir)/'`cache/row0cache0mempool.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libinnobase_a-row0cache0mempool.Tpo $(DEPDIR)/libinnobase_a-row0cache0mempool.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0mempool.c' object='libinnobase_a-row0cache0mempool.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-row0cache0mempool.o `test -f 'cache/row0cache0mempool.c' || echo '$(srcdir)/'`cache/row0cache0mempool.c
+
+libinnobase_a-row0cache0mempool.obj: cache/row0cache0mempool.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -MT libinnobase_a-row0cache0mempool.obj -MD -MP -MF $(DEPDIR)/libinnobase_a-row0cache0mempool.Tpo -c -o libinnobase_a-row0cache0mempool.obj `if test -f 'cache/row0cache0mempool.c'; then $(CYGPATH_W) 'cache/row0cache0mempool.c'; else $(CYGPATH_W) '$(srcdir)/cache/row0cache0mempool.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libinnobase_a-row0cache0mempool.Tpo $(DEPDIR)/libinnobase_a-row0cache0mempool.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0mempool.c' object='libinnobase_a-row0cache0mempool.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-row0cache0mempool.obj `if test -f 'cache/row0cache0mempool.c'; then $(CYGPATH_W) 'cache/row0cache0mempool.c'; else $(CYGPATH_W) '$(srcdir)/cache/row0cache0mempool.c'; fi`
+
+libinnobase_a-row0cache0filter.o: cache/row0cache0filter.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -MT libinnobase_a-row0cache0filter.o -MD -MP -MF $(DEPDIR)/libinnobase_a-row0cache0filter.Tpo -c -o libinnobase_a-row0cache0filter.o `test -f 'cache/row0cache0filter.c' || echo '$(srcdir)/'`cache/row0cache0filter.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libinnobase_a-row0cache0filter.Tpo $(DEPDIR)/libinnobase_a-row0cache0filter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0filter.c' object='libinnobase_a-row0cache0filter.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-row0cache0filter.o `test -f 'cache/row0cache0filter.c' || echo '$(srcdir)/'`cache/row0cache0filter.c
+
+libinnobase_a-row0cache0filter.obj: cache/row0cache0filter.c
+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -MT libinnobase_a-row0cache0filter.obj -MD -MP -MF $(DEPDIR)/libinnobase_a-row0cache0filter.Tpo -c -o libinnobase_a-row0cache0filter.obj `if test -f 'cache/row0cache0filter.c'; then $(CYGPATH_W) 'cache/row0cache0filter.c'; else $(CYGPATH_W) '$(srcdir)/cache/row0cache0filter.c'; fi`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libinnobase_a-row0cache0filter.Tpo $(DEPDIR)/libinnobase_a-row0cache0filter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0filter.c' object='libinnobase_a-row0cache0filter.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinnobase_a_CFLAGS) $(CFLAGS) -c -o libinnobase_a-row0cache0filter.obj `if test -f 'cache/row0cache0filter.c'; then $(CYGPATH_W) 'cache/row0cache0filter.c'; else $(CYGPATH_W) '$(srcdir)/cache/row0cache0filter.c'; fi`
+
ha_innodb_plugin_la-btr0btr.lo: btr/btr0btr.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -MT ha_innodb_plugin_la-btr0btr.lo -MD -MP -MF $(DEPDIR)/ha_innodb_plugin_la-btr0btr.Tpo -c -o ha_innodb_plugin_la-btr0btr.lo `test -f 'btr/btr0btr.c' || echo '$(srcdir)/'`btr/btr0btr.c
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ha_innodb_plugin_la-btr0btr.Tpo $(DEPDIR)/ha_innodb_plugin_la-btr0btr.Plo
@@ -3046,6 +3141,41 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -c -o ha_innodb_plugin_la-ut0wqueue.lo `test -f 'ut/ut0wqueue.c' || echo '$(srcdir)/'`ut/ut0wqueue.c
+ha_innodb_plugin_la-row0cache.lo: cache/row0cache.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -MT ha_innodb_plugin_la-row0cache.lo -MD -MP -MF $(DEPDIR)/ha_innodb_plugin_la-row0cache.Tpo -c -o ha_innodb_plugin_la-row0cache.lo `test -f 'cache/row0cache.c' || echo '$(srcdir)/'`cache/row0cache.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ha_innodb_plugin_la-row0cache.Tpo $(DEPDIR)/ha_innodb_plugin_la-row0cache.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache.c' object='ha_innodb_plugin_la-row0cache.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -c -o ha_innodb_plugin_la-row0cache.lo `test -f 'cache/row0cache.c' || echo '$(srcdir)/'`cache/row0cache.c
+
+ha_innodb_plugin_la-row0cache0hash.lo: cache/row0cache0hash.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -MT ha_innodb_plugin_la-row0cache0hash.lo -MD -MP -MF $(DEPDIR)/ha_innodb_plugin_la-row0cache0hash.Tpo -c -o ha_innodb_plugin_la-row0cache0hash.lo `test -f 'cache/row0cache0hash.c' || echo '$(srcdir)/'`cache/row0cache0hash.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ha_innodb_plugin_la-row0cache0hash.Tpo $(DEPDIR)/ha_innodb_plugin_la-row0cache0hash.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0hash.c' object='ha_innodb_plugin_la-row0cache0hash.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -c -o ha_innodb_plugin_la-row0cache0hash.lo `test -f 'cache/row0cache0hash.c' || echo '$(srcdir)/'`cache/row0cache0hash.c
+
+ha_innodb_plugin_la-row0cache0lru.lo: cache/row0cache0lru.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -MT ha_innodb_plugin_la-row0cache0lru.lo -MD -MP -MF $(DEPDIR)/ha_innodb_plugin_la-row0cache0lru.Tpo -c -o ha_innodb_plugin_la-row0cache0lru.lo `test -f 'cache/row0cache0lru.c' || echo '$(srcdir)/'`cache/row0cache0lru.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ha_innodb_plugin_la-row0cache0lru.Tpo $(DEPDIR)/ha_innodb_plugin_la-row0cache0lru.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0lru.c' object='ha_innodb_plugin_la-row0cache0lru.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -c -o ha_innodb_plugin_la-row0cache0lru.lo `test -f 'cache/row0cache0lru.c' || echo '$(srcdir)/'`cache/row0cache0lru.c
+
+ha_innodb_plugin_la-row0cache0mempool.lo: cache/row0cache0mempool.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -MT ha_innodb_plugin_la-row0cache0mempool.lo -MD -MP -MF $(DEPDIR)/ha_innodb_plugin_la-row0cache0mempool.Tpo -c -o ha_innodb_plugin_la-row0cache0mempool.lo `test -f 'cache/row0cache0mempool.c' || echo '$(srcdir)/'`cache/row0cache0mempool.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ha_innodb_plugin_la-row0cache0mempool.Tpo $(DEPDIR)/ha_innodb_plugin_la-row0cache0mempool.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0mempool.c' object='ha_innodb_plugin_la-row0cache0mempool.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -c -o ha_innodb_plugin_la-row0cache0mempool.lo `test -f 'cache/row0cache0mempool.c' || echo '$(srcdir)/'`cache/row0cache0mempool.c
+
+ha_innodb_plugin_la-row0cache0filter.lo: cache/row0cache0filter.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -MT ha_innodb_plugin_la-row0cache0filter.lo -MD -MP -MF $(DEPDIR)/ha_innodb_plugin_la-row0cache0filter.Tpo -c -o ha_innodb_plugin_la-row0cache0filter.lo `test -f 'cache/row0cache0filter.c' || echo '$(srcdir)/'`cache/row0cache0filter.c
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ha_innodb_plugin_la-row0cache0filter.Tpo $(DEPDIR)/ha_innodb_plugin_la-row0cache0filter.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cache/row0cache0filter.c' object='ha_innodb_plugin_la-row0cache0filter.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ha_innodb_plugin_la_CFLAGS) $(CFLAGS) -c -o ha_innodb_plugin_la-row0cache0filter.lo `test -f 'cache/row0cache0filter.c' || echo '$(srcdir)/'`cache/row0cache0filter.c
+
.cc.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
Index: storage/innodb_plugin/mtr/mtr0mtr.c
===================================================================
--- storage/innodb_plugin/mtr/mtr0mtr.c (revision 118)
+++ storage/innodb_plugin/mtr/mtr0mtr.c (revision 198)
@@ -208,6 +208,12 @@
ut_d(mtr->state = MTR_COMMITTED);
dyn_array_free(&(mtr->memo));
dyn_array_free(&(mtr->log));
+
+
+ if(mtr->row_cache_value_queue_base.count>0){
+ //release row cache value
+ release_row_cache_value_in_mtr(mtr);
+ }
}
#ifndef UNIV_HOTBACKUP
Index: storage/innodb_plugin/cache/row0cache0lru.c
===================================================================
--- storage/innodb_plugin/cache/row0cache0lru.c (revision 0)
+++ storage/innodb_plugin/cache/row0cache0lru.c (revision 198)
@@ -0,0 +1,157 @@
+/********************************************************************
+created: 2011/03/23
+created: 23:3:2011 15:15
+filename: D:\Work\Project\VisualStudio\TAoBao-MySQL-Trunk\5.1.48\storage\innodb_plugin\plugin\row0cache0lru.c
+file path: D:\Work\Project\VisualStudio\TAoBao-MySQL-Trunk\5.1.48\storage\innodb_plugin\plugin
+file base: row0cache0lru
+file ext: c
+author: wentong@taobao.com
+
+purpose:
+*********************************************************************/
+#include "row0cache0lru.h"
+#include "row0cache0hash.h"
+#include "row0cache0mempool.h"
+#include "ut0rbt.h"
+#include "ut0lst.h"
+
+#define ROW_CACHE_FREE_DISANCE 100
+
+static ROW_CACHE_VALUE_LIST_BASE *innodb_row_cache_lru;
+
+static row_cache_lru_stat_t _row_cache_lru_stat;
+
+UNIV_INTERN row_cache_lru_stat_t* row_cache_lru_stat = &_row_cache_lru_stat;
+
+UNIV_INTERN my_bool innodb_row_cache_clean_cache = FALSE;
+
+void init_innodb_row_cache_lru(){
+ if (innodb_row_cache_mutex_num > 0){
+ ulint i;
+ innodb_row_cache_lru = (ROW_CACHE_VALUE_LIST_BASE*) ut_malloc(innodb_row_cache_mutex_num * sizeof(ROW_CACHE_VALUE_LIST_BASE));
+ for (i = 0 ; i < innodb_row_cache_mutex_num ; i++)
+ {
+ UT_LIST_INIT(*(innodb_row_cache_lru+i));
+ }
+ }
+ memset(row_cache_lru_stat , 0 , sizeof(row_cache_lru_stat_t));
+}
+
+void deinit_innodb_row_cache_lru(){
+ if (innodb_row_cache_mutex_num > 0){
+ ulint i;
+ for (i = 0 ; i < innodb_row_cache_mutex_num ; i++)
+ {
+ row_cache_value_t* value;
+ ROW_CACHE_VALUE_LIST_BASE* free_lru = innodb_row_cache_lru + i;
+ row_cache_enter_mutex_by_no(i);
+ for (value = UT_LIST_GET_LAST(*free_lru);
+ value!=NULL;){
+ row_cache_value_t* free_value;
+ ulint fold;
+ free_value = value;
+ fold = free_value->fold;
+ value=UT_LIST_GET_PREV(list,value);
+ UT_LIST_REMOVE(list,*free_lru,free_value);
+ delete_row_cache_value(free_value);
+ ca_free(free_value->buf ,free_value->buf_size ,fold);
+ ca_free_for_value(free_value , fold);
+ }
+ row_cache_exit_mutex_by_no(i);
+ }
+ ut_free(innodb_row_cache_lru);
+ }
+}
+
+void clean_row_cache(){
+ if (innodb_row_cache_mutex_num > 0){
+ ulint i;
+ for (i = 0 ; i < innodb_row_cache_mutex_num ; i++)
+ {
+ row_cache_value_t* value;
+ ROW_CACHE_VALUE_LIST_BASE* free_lru = innodb_row_cache_lru + i;
+ row_cache_enter_mutex_by_no(i);
+ for (value = UT_LIST_GET_LAST(*free_lru);
+ value!=NULL;){
+ row_cache_value_t* free_value;
+ ulint fold;
+ free_value = value;
+ fold = free_value->fold;
+ value=UT_LIST_GET_PREV(list,value);
+ if(free_value->ref_num==0){
+ UT_LIST_REMOVE(list,*free_lru,free_value);
+ delete_row_cache_value(free_value);
+ ca_free(free_value->buf ,free_value->buf_size, fold);
+ ca_free_for_value(free_value , fold);
+ }
+ }
+ row_cache_exit_mutex_by_no(i);
+ }
+ }
+}
+
+static ROW_CACHE_VALUE_LIST_BASE* get_current_lru_base(const ulint fold){
+ return innodb_row_cache_lru + row_cache_get_mutex_no(fold);
+}
+
+void add_row_cache_value_to_lru( row_cache_value_t* value ) {
+ UT_LIST_ADD_FIRST(list,*get_current_lru_base(value->fold),value);
+ row_cache_lru_stat->n_add++;
+}
+
+void make_row_cache_value_first_from_lru( row_cache_value_t* value )
+{
+ ROW_CACHE_VALUE_LIST_BASE* lru_base = get_current_lru_base(value->fold);
+ UT_LIST_REMOVE(list,*lru_base,value);
+ UT_LIST_ADD_FIRST(list,*lru_base,value);
+ row_cache_lru_stat->n_make_first++;
+}
+
+ulint free_from_lru(const ulint size , const ulint used_fold)
+{
+ ulint iteration_size = 0;
+ int free_distance = 0;
+ ulint free_size = 0;
+ row_cache_value_t* value;
+ ROW_CACHE_VALUE_LIST_BASE* lru_base = get_current_lru_base(used_fold);
+ for (value = UT_LIST_GET_LAST(*lru_base);
+ free_distance < ROW_CACHE_FREE_DISANCE && value!=NULL;)
+ {
+ row_cache_value_t* free_value;
+ free_value = value;
+ value=UT_LIST_GET_PREV(list,value);
+ iteration_size += free_value->buf_size;
+ if(free_value->ref_num==0 && free_value->fold!=used_fold){
+ //the value can't be used or can't be locked by the upper function
+ UT_LIST_REMOVE(list,*lru_base,free_value);
+ row_cache_lru_stat->n_evict++;
+ free_size+=free_value->buf_size;
+ delete_row_cache_value(free_value);
+ ca_free(free_value->buf ,free_value->buf_size , used_fold);
+ ca_free_for_value(free_value , used_fold);
+ }
+ if(iteration_size > size){
+ //when may free enough mem and calc free distance
+ free_distance++;
+ }
+ }
+ return free_size;
+}
+
+void remove_row_cache_value_from_lru( row_cache_value_t* value )
+{
+ UT_LIST_REMOVE(list,*get_current_lru_base(value->fold),value);
+ row_cache_lru_stat->n_evict++;
+}
+
+ulint get_row_cache_lru_count()
+{
+ ulint i;
+ ulint ret = 0;
+ for (i = 0 ; i < innodb_row_cache_mutex_num ; i++)
+ {
+ ret += UT_LIST_GET_LEN(*(innodb_row_cache_lru+i));
+ }
+ return ret;
+}
+
Index: storage/innodb_plugin/cache/row0cache0hash.c
===================================================================
--- storage/innodb_plugin/cache/row0cache0hash.c (revision 0)
+++ storage/innodb_plugin/cache/row0cache0hash.c (revision 198)
@@ -0,0 +1,198 @@
+/********************************************************************
+created: 2011/03/24
+created: 24:3:2011 8:49
+filename: D:\Work\Project\VisualStudio\TAoBao-MySQL-Trunk\5.1.48\storage\innodb_plugin\plugin\row0cache0hash.c
+file path: D:\Work\Project\VisualStudio\TAoBao-MySQL-Trunk\5.1.48\storage\innodb_plugin\plugin
+file base: row0cache0hash
+file ext: c
+author: wentong@taobao.com
+
+purpose:
+*********************************************************************/
+
+#include "row0cache0hash.h"
+#include "ha0ha.h"
+#include "hash0hash.h"
+#include "rem0rec.h"
+#include "rem0cmp.h"
+#include "ut0byte.h"
+
+
+
+UNIV_INTERN unsigned long innodb_row_cache_cell_num = 10000L;
+
+UNIV_INTERN unsigned int innodb_row_cache_mutex_num_shift = 6;
+
+UNIV_INTERN ulint innodb_row_cache_mutex_num = 0;
+
+static row_cache_t _innodb_row_cache;
+
+UNIV_INTERN row_cache_t* innodb_row_cache = &_innodb_row_cache;
+
+int init_row_cache_hash(my_bool innodb_row_cache_on)
+{
+ memset(innodb_row_cache, 0 , sizeof(row_cache_t));
+ if (innodb_row_cache_on)
+ {
+ innodb_row_cache_mutex_num = (1<<innodb_row_cache_mutex_num_shift);
+ innodb_row_cache->row_cache = ha_create(innodb_row_cache_cell_num,innodb_row_cache_mutex_num,0);
+
+ }else{
+ innodb_row_cache->row_cache = NULL;
+ }
+ return 0;
+}
+
+static void free_hash_table_mutex(hash_table_t* table){
+ //mutex was freed by sync_close();
+ /* ulint i;
+ for (i = 0; i < table->n_mutexes; i++) {
+ mutex_free(table->mutexes + i);
+ }*/
+ mem_free(table->mutexes);
+ table->mutexes = NULL;
+ table->n_mutexes = 0;
+ mem_free(table->heaps);
+ table->heaps = NULL;
+}
+
+void deinit_row_cache_hash(my_bool innodb_row_cache_on){
+ if (innodb_row_cache_on)
+ {
+ ha_clear(innodb_row_cache->row_cache);
+ free_hash_table_mutex(innodb_row_cache->row_cache);
+ hash_table_free(innodb_row_cache->row_cache);
+ }
+}
+
+row_cache_value_t* search_row_cache_value(const dtuple_t* tuple, const dict_index_t* index, const ulint fold)
+{
+ ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ ulint* offsets = offsets_;
+ mem_heap_t* heap = NULL;
+ row_cache_chain_t* chain = NULL;
+ rec_offs_init(offsets_);
+
+ HASH_SEARCH(
+ /* hash_chain->"next" */
+ next,
+ /* the hash table */
+ innodb_row_cache->row_cache,
+ /* fold */
+ fold,
+ /* the type of the next variable */
+ row_cache_chain_t*,
+ /* auxiliary variable */
+ chain,
+ /* assertion on every traversed item */
+ ,
+ /* this determines if we have found the lock */
+ (chain->value!=NULL && ut_dulint_cmp(chain->value->tree_id , index->id)==0 &&
+ cmp_dtuple_rec(tuple,chain->value->rec,rec_get_offsets(chain->value->rec, index, offsets, ULINT_UNDEFINED, &heap)) == 0));
+ if (UNIV_LIKELY_NULL(heap)) {
+ mem_heap_free(heap);
+ }
+ if (chain == NULL) {
+ return(NULL);
+ }
+ /* else */
+ return(chain->value);
+}
+
+
+row_cache_value_t* search_row_cache_value_with_rec( const rec_t* rec, const ulint* rec_offsets, dict_index_t* index, const ulint fold )
+{
+ ulint offsets_[REC_OFFS_NORMAL_SIZE];
+ ulint* offsets = offsets_;
+ mem_heap_t* heap = NULL;
+ row_cache_chain_t* chain = NULL;
+ rec_offs_init(offsets_);
+
+ HASH_SEARCH(
+ /* hash_chain->"next" */
+ next,
+ /* the hash table */
+ innodb_row_cache->row_cache,
+ /* fold */
+ fold,
+ /* the type of the next variable */
+ row_cache_chain_t*,
+ /* auxiliary variable */
+ chain,
+ /* assertion on every traversed item */
+ ,
+ /* this determines if we have found the lock */
+ (chain->value!=NULL && ut_dulint_cmp(chain->value->tree_id , index->id)==0 &&
+ cmp_rec_rec(rec,chain->value->rec,rec_offsets,rec_get_offsets(chain->value->rec, index, offsets, ULINT_UNDEFINED, &heap),index)==0));
+
+ if (UNIV_LIKELY_NULL(heap)) {
+ mem_heap_free(heap);
+ }
+ if (chain == NULL) {
+ return(NULL);
+ }
+ /* else */
+ return(chain->value);
+
+}
+
+
+
+
+row_cache_value_t* insert_row_cache_value(const ulint fold , row_cache_value_t* value){
+ HASH_INSERT(
+ /* the type used in the hash chain */
+ row_cache_chain_t,
+ /* hash_chain->"next" */
+ next,
+ /* the hash table */
+ innodb_row_cache->row_cache,
+ /* fold */
+ fold,
+ /* add this data to the hash */
+ &value->chain);
+ return value;
+}
+
+
+void delete_row_cache_value(row_cache_value_t* value){
+ HASH_DELETE(
+ row_cache_chain_t,
+ next,
+ innodb_row_cache->row_cache,
+ value->fold,
+ (&value->chain));
+}
+
+void row_cache_enter_mutex_by_no(const ulint no){
+ mutex_enter(hash_get_nth_mutex(innodb_row_cache->row_cache, no));
+}
+
+void row_cache_exit_mutex_by_no(const ulint no){
+ mutex_exit(hash_get_nth_mutex(innodb_row_cache->row_cache, no));
+}
+
+void row_cache_enter_mutex( const ulint fold )
+{
+ hash_mutex_enter(innodb_row_cache->row_cache , fold);
+}
+
+ulint row_cache_enter_mutex_nowait( const ulint fold )
+{
+ //hash_mutex_enter(innodb_row_cache->row_cache , fold);
+ return mutex_enter_nowait(hash_get_mutex(innodb_row_cache->row_cache, fold));
+}
+
+void row_cache_exit_mutex( const ulint fold )
+{
+ hash_mutex_exit(innodb_row_cache->row_cache , fold);
+}
+
+int row_cache_own_mutex(const ulint fold1 , const ulint fold2){
+ return hash_get_mutex_no(innodb_row_cache->row_cache , fold1) == hash_get_mutex_no(innodb_row_cache->row_cache , fold2);
+}
+
+ulint row_cache_get_mutex_no( const ulint fold )
+{
+ return hash_get_mutex_no(innodb_row_cache->row_cache , fold);
+}
Index: storage/innodb_plugin/cache/row0cache0filter.c
===================================================================
--- storage/innodb_plugin/cache/row0cache0filter.c (revision 0)
+++ storage/innodb_plugin/cache/row0cache0filter.c (revision 198)
@@ -0,0 +1,279 @@
+/********************************************************************
+created: 2011/05/31
+created: 31:5:2011 11:40
+filename: E:\Work\Project\VS\taobao-mysql\row_cache\storage\innodb_plugin\cache\row0cache0filter.c
+file path: E:\Work\Project\VS\taobao-mysql\row_cache\storage\innodb_plugin\cache
+file base: row0cache0filter
+file ext: c
+author: wentong@taobao.com
+
+purpose:
+*********************************************************************/
+
+#include "row0cache0filter.h"
+#include "ut0rbt.h"
+#include "sync0rw.h"
+#include "ut0lst.h"
+#include "hash0hash.h"
+#include "ut0rnd.h"
+#include "dict0mem.h"
+
+#define FILTER_HASH_CELL_NUM 1000
+
+typedef struct row_cache_filter_index_chain row_cache_filter_index_chain_t;
+typedef struct row_cache_filter_index_value row_cache_filter_index_value_t;
+
+struct row_cache_filter_index_chain{
+ row_cache_filter_index_value_t* value;
+ row_cache_filter_index_chain_t* next;
+};
+
+struct row_cache_filter_index_value{
+ dulint tree_id;
+ row_cache_filter_index_chain_t chain;
+};
+
+UNIV_INTERN char* innodb_row_cache_index = NULL;
+
+static char innodb_row_cache_index_r[INDEX_CONFIG_LEN + 1];
+
+static ibool has_filter = FALSE;
+
+static hash_table_t* filtered_in_index;
+
+static hash_table_t* filtered_out_index;
+
+static rw_lock_t filter_lock;
+
+void reset_filter();
+static int wild_case_compare_wl(const char *str,const char *wildstr,const size_t length);
+static void free_hash_table_elem(hash_table_t* table);
+
+void init_row_cache_filter(my_bool innodb_row_cache_on){
+ if(innodb_row_cache_on){
+ rw_lock_create(&filter_lock,SYNC_MEM_HASH);
+ filtered_in_index = hash_create(FILTER_HASH_CELL_NUM);
+ filtered_out_index = hash_create(FILTER_HASH_CELL_NUM);
+ reset_filter();
+ }
+}
+
+void deinit_row_cache_filter(my_bool innodb_row_cache_on){
+ if(innodb_row_cache_on){
+ reset_filter();
+ hash_table_free(filtered_in_index);
+ hash_table_free(filtered_out_index);
+ rw_lock_free(&filter_lock);
+ }
+}
+
+void reset_filter(){
+ size_t len = 0;
+ if(innodb_row_cache_index){
+ len = strlen(innodb_row_cache_index);
+ }
+ len = len>INDEX_CONFIG_LEN ? INDEX_CONFIG_LEN : len;
+ rw_lock_x_lock(&filter_lock);
+ memset(innodb_row_cache_index_r,0,INDEX_CONFIG_LEN+1);
+ if(len){
+ ut_memcpy(innodb_row_cache_index_r,innodb_row_cache_index,len);
+ }
+ innodb_row_cache_index_r[len] = '\0';
+ innodb_row_cache_index = innodb_row_cache_index_r;
+
+ free_hash_table_elem(filtered_in_index);
+ free_hash_table_elem(filtered_out_index);
+ if(!len){
+ has_filter = FALSE;
+ }else{
+ has_filter = TRUE;
+ }
+ rw_lock_x_unlock(&filter_lock);
+}
+
+static void add_result_to_index_hash(ulint fold, dulint tree_id, my_bool is_in_filter){
+ hash_table_t* table;
+ row_cache_filter_index_value_t* value;
+ rw_lock_x_lock(&filter_lock);
+ if(is_in_filter){
+ table = filtered_in_index;
+ }else{
+ table = filtered_out_index;
+ }
+ value = (row_cache_filter_index_value_t*) mem_alloc(sizeof(row_cache_filter_index_value_t));
+ if(value){
+ value->tree_id = tree_id;
+ value->chain.value = value;
+ HASH_INSERT(
+ /* the type used in the hash chain */
+ row_cache_filter_index_chain_t,
+ /* hash_chain->"next" */
+ next,
+ /* the hash table */
+ table,
+ /* fold */
+ fold,
+ /* add this data to the hash */
+ &value->chain);
+ }
+ rw_lock_x_unlock(&filter_lock);
+}
+
+static my_bool is_in_filter_index_hash(ulint fold, dulint tree_id, my_bool is_in_filter){
+ hash_table_t* table;
+ row_cache_filter_index_chain_t* chain = NULL;
+ if(is_in_filter){
+ table = filtered_in_index;
+ }else{
+ table = filtered_out_index;
+ }
+ HASH_SEARCH(
+ /* hash_chain->"next" */
+ next,
+ /* the hash table */
+ table,
+ /* fold */
+ fold,
+ /* the type of the next variable */
+ row_cache_filter_index_chain_t*,
+ /* auxiliary variable */
+ chain,
+ /* assertion on every traversed item */
+ ,
+ /* this determines if we have found the lock */
+ (chain->value!=NULL && ut_dulint_cmp(chain->value->tree_id , tree_id)==0));
+ if (chain == NULL) {
+ return(FALSE);
+ }
+ return(TRUE);
+}
+
+static int wild_case_compare_wl(const char *str,const char *wildstr,const size_t length)
+{
+ const char* start = wildstr;
+ char wild_many='*';
+ char wild_one='?';
+ char wild_prefix=0; /* QQ this can potentially cause a SIGSEGV */
+ int flag;
+ while ((size_t)(wildstr-start)<length)
+ {
+ while ((size_t)(wildstr-start)<length && *wildstr != wild_many && *wildstr != wild_one)
+ {
+ if (*wildstr == wild_prefix && (size_t)(wildstr+1-start)<length)
+ wildstr++;
+ if (toupper(*wildstr++) !=
+ toupper(*str++)) return (1);
+ }
+ if ((size_t)(wildstr-start)>=length)
+ return (*str != 0);
+ if (*wildstr++ == wild_one)
+ {
+ if (! *str++) return (1); /* One char; skip */
+ }
+ else
+ { /* Found '*' */
+ if ((size_t)(wildstr-start)>=length) return (0); /* '*' as last char: OK */
+ flag=(*wildstr != wild_many && *wildstr != wild_one);
+ do
+ {
+ if (flag)
+ {
+ char cmp;
+ if ((cmp= *wildstr) == wild_prefix && (size_t)(wildstr+1-start)<length)
+ cmp=wildstr[1];
+ cmp=toupper(cmp);
+ while (*str && toupper(*str) != cmp)
+ str++;
+ if (!*str) return (1);
+ }
+ if (wild_case_compare_wl(str,wildstr,length-(wildstr-start)) == 0) return (0);
+ } while (*str++);
+ return(1);
+ }
+ }
+ return (*str != '\0');
+}
+
+
+static my_bool compare_index_config(const char* table_name,const char* index_name,const char* config){
+ char index_sp=';';
+ char table_sp=':';
+ my_bool is_index_now = FALSE;
+ my_bool is_table_matching = FALSE;
+ my_bool is_index_matching = FALSE;
+ while(*config){
+ const char* o_config = config;
+ size_t length = 0;
+ while(*config && *config != index_sp && *config != table_sp){
+ config++;
+ length++;
+ }
+ if(*config == table_sp){
+ if(!is_index_now){
+ is_table_matching = !wild_case_compare_wl(table_name , o_config , length);
+ is_index_now = TRUE;
+ }else if(is_table_matching){
+ is_index_matching = !wild_case_compare_wl(index_name , o_config , length);
+ if(is_index_matching){
+ return TRUE;
+ }
+ }
+ }else if(!*config || *config == index_sp){
+ if(is_index_now && is_table_matching){
+ is_index_matching = !wild_case_compare_wl(index_name , o_config , length);
+ if(is_index_matching){
+ return TRUE;
+ }
+ }
+ is_index_now = FALSE;
+ is_table_matching = FALSE;
+ is_index_matching = FALSE;
+ }
+ if(*config){
+ config++;
+ }
+ }
+ return FALSE;
+}
+
+static void free_hash_table_elem( hash_table_t* table )
+{
+ ulint i;
+ for(i = 0 ; i< table->n_cells ; i++){
+ row_cache_filter_index_chain_t* chain = (row_cache_filter_index_chain_t*) HASH_GET_FIRST(table,i);
+ while(chain!=NULL){
+ row_cache_filter_index_value_t* value = chain->value;
+ chain = chain->next;
+ mem_free(value);
+ }
+ }
+ hash_table_clear(table);
+}
+
+my_bool is_index_need_cache(const dict_index_t* index){
+ const char* table_name = index->table_name;
+ dulint index_id = index->id;
+ const char* index_name = index->name;
+ ulint fold = ut_fold_dulint(index_id);
+ my_bool is_in_hash = FALSE;
+ my_bool ret;
+ rw_lock_s_lock(&filter_lock);
+ if(!has_filter){
+ is_in_hash = TRUE; //didn't need to be cache the result
+ ret = TRUE;
+ }else if(is_in_filter_index_hash(fold,index_id,TRUE)){
+ is_in_hash = TRUE;
+ ret = TRUE;
+ }else if(is_in_filter_index_hash(fold,index_id,FALSE)){
+ is_in_hash = TRUE;
+ ret = FALSE;
+ }else{
+ ret = compare_index_config(table_name, index_name, innodb_row_cache_index_r);
+ }
+ rw_lock_s_unlock(&filter_lock);
+ if(!is_in_hash){
+ add_result_to_index_hash(fold,index_id,ret);
+ }
+ return ret;
+}
+
Index: storage/innodb_plugin/cache/row0cache0mempool.c
===================================================================
--- storage/innodb_plugin/cache/row0cache0mempool.c (revision 0)
+++ storage/innodb_plugin/cache/row0cache0mempool.c (revision 198)
@@ -0,0 +1,806 @@
+/********************************************************************
+ created: 2011/03/23
+ created: 23:3:2011 15:15
+ filename: D:\Work\Project\VisualStudio\TAoBao-MySQL-Trunk\5.1.48\storage\innodb_plugin\plugin\row0cache0mempool.c
+ file path: D:\Work\Project\VisualStudio\TAoBao-MySQL-Trunk\5.1.48\storage\innodb_plugin\plugin
+ file base: row0cache0mempool
+ file ext: c
+ author: wentong@taobao.com
+
+ purpose:
+*********************************************************************/
+#include "row0cache0mempool.h"
+#include "mem0mem.h"
+#include "sync0sync.h"
+#include "row0cache0lru.h"
+#include "mem0pool.h"
+#include "row0cache.h"
+#include "ut0lst.h"
+#include "os0proc.h"
+#include "srv0srv.h"
+
+//copy from mem0pool.c
+
+/** A dummy pointer for generating a null pointer exception in
+ut_malloc_low() */
+static ulint* ut_mem_null_ptr = NULL;
+
+/** The smallest memory area total size */
+#define MEM_AREA_MIN_SIZE (2 * MEM_AREA_EXTRA_SIZE)
+
+/** Mask used to extract the free bit from area->size */
+#define MEM_AREA_FREE 1
+
+/** Data structure for a memory pool. The space is allocated using the buddy
+algorithm, where free list i contains areas of size 2 to power i. */
+struct mem_pool_struct{
+ byte* buf; /*!< memory pool */
+ ulint size; /*!< memory common pool size */
+ ulint reserved; /*!< amount of currently allocated
+ memory */
+ mutex_t mutex; /*!< mutex protecting this struct */
+ UT_LIST_BASE_NODE_T(mem_area_t)
+ free_list[64]; /*!< lists of free memory areas: an
+ area is put to the list whose number
+ is the 2-logarithm of the area size */
+};
+
+/********************************************************************//**
+Sets memory area size. */
+static
+void
+mem_area_set_size_out(
+/*==============*/
+ mem_area_t* area, /*!< in: area */
+ ulint size) /*!< in: size */
+{
+ area->size_and_free = (area->size_and_free & MEM_AREA_FREE)
+ | size;
+}
+
+/********************************************************************//**
+Sets memory area free bit. */
+static
+void
+mem_area_set_free_out(
+/*==============*/
+mem_area_t* area, /*!< in: area */
+ibool free) /*!< in: free bit value */
+{
+#if TRUE != MEM_AREA_FREE
+# error "TRUE != MEM_AREA_FREE"
+#endif
+ area->size_and_free = (area->size_and_free & ~MEM_AREA_FREE)
+ | free;
+}
+
+/********************************************************************//**
+Returns memory area free bit.
+ @return TRUE if free */
+static
+ibool
+mem_area_get_free_out(
+/*==============*/
+mem_area_t* area) /*!< in: area */
+{
+#if TRUE != MEM_AREA_FREE
+# error "TRUE != MEM_AREA_FREE"
+#endif
+ return(area->size_and_free & MEM_AREA_FREE);
+}
+
+/********************************************************************//**
+Returns memory area size.
+@return size */
+static
+ulint
+mem_area_get_size_out(
+/*==============*/
+mem_area_t* area) /*!< in: area */
+{
+ return(area->size_and_free & ~MEM_AREA_FREE);
+}
+
+
+/********************************************************************//**