mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
6b0853a398
Changed header to GPL version 2 only BUILD/Makefile.am: Changed header to GPL version 2 only Docs/Makefile.am: Changed header to GPL version 2 only Makefile.am: Changed header to GPL version 2 only SSL/Makefile.am: Changed header to GPL version 2 only bdb/Makefile.in: Changed header to GPL version 2 only client/Makefile.am: Changed header to GPL version 2 only client/client_priv.h: Changed header to GPL version 2 only client/completion_hash.cc: Changed header to GPL version 2 only client/completion_hash.h: Changed header to GPL version 2 only client/get_password.c: Changed header to GPL version 2 only client/my_readline.h: Changed header to GPL version 2 only client/mysql.cc: Changed header to GPL version 2 only client/mysql_upgrade.c: Changed header to GPL version 2 only client/mysqladmin.cc: Changed header to GPL version 2 only client/mysqlbinlog.cc: Changed header to GPL version 2 only client/mysqlcheck.c: Changed header to GPL version 2 only client/mysqldump.c: Changed header to GPL version 2 only client/mysqlimport.c: Changed header to GPL version 2 only client/mysqlmanager-pwgen.c: Changed header to GPL version 2 only client/mysqlmanagerc.c: Changed header to GPL version 2 only client/mysqlshow.c: Changed header to GPL version 2 only client/mysqltest.c: Changed header to GPL version 2 only client/readline.cc: Changed header to GPL version 2 only client/sql_string.cc: Changed header to GPL version 2 only client/sql_string.h: Changed header to GPL version 2 only cmd-line-utils/Makefile.am: Changed header to GPL version 2 only dbug/Makefile.am: Changed header to GPL version 2 only extra/Makefile.am: Changed header to GPL version 2 only extra/charset2html.c: Changed header to GPL version 2 only extra/comp_err.c: Changed header to GPL version 2 only extra/innochecksum.c: Changed header to GPL version 2 only extra/my_print_defaults.c: Changed header to GPL version 2 only extra/mysql_waitpid.c: Changed header to GPL version 2 only extra/perror.c: Changed header to GPL version 2 only extra/replace.c: Changed header to GPL version 2 only extra/resolve_stack_dump.c: Changed header to GPL version 2 only extra/resolveip.c: Changed header to GPL version 2 only heap/Makefile.am: Changed header to GPL version 2 only heap/_check.c: Changed header to GPL version 2 only heap/_rectest.c: Changed header to GPL version 2 only heap/heapdef.h: Changed header to GPL version 2 only heap/hp_block.c: Changed header to GPL version 2 only heap/hp_clear.c: Changed header to GPL version 2 only heap/hp_close.c: Changed header to GPL version 2 only heap/hp_create.c: Changed header to GPL version 2 only heap/hp_delete.c: Changed header to GPL version 2 only heap/hp_extra.c: Changed header to GPL version 2 only heap/hp_hash.c: Changed header to GPL version 2 only heap/hp_info.c: Changed header to GPL version 2 only heap/hp_open.c: Changed header to GPL version 2 only heap/hp_panic.c: Changed header to GPL version 2 only heap/hp_rename.c: Changed header to GPL version 2 only heap/hp_rfirst.c: Changed header to GPL version 2 only heap/hp_rkey.c: Changed header to GPL version 2 only heap/hp_rlast.c: Changed header to GPL version 2 only heap/hp_rnext.c: Changed header to GPL version 2 only heap/hp_rprev.c: Changed header to GPL version 2 only heap/hp_rrnd.c: Changed header to GPL version 2 only heap/hp_rsame.c: Changed header to GPL version 2 only heap/hp_scan.c: Changed header to GPL version 2 only heap/hp_static.c: Changed header to GPL version 2 only heap/hp_test1.c: Changed header to GPL version 2 only heap/hp_test2.c: Changed header to GPL version 2 only heap/hp_update.c: Changed header to GPL version 2 only heap/hp_write.c: Changed header to GPL version 2 only include/Makefile.am: Changed header to GPL version 2 only include/base64.h: Changed header to GPL version 2 only include/config-netware.h: Changed header to GPL version 2 only include/config-os2.h: Changed header to GPL version 2 only include/config-win.h: Changed header to GPL version 2 only include/decimal.h: Changed header to GPL version 2 only include/errmsg.h: Changed header to GPL version 2 only include/ft_global.h: Changed header to GPL version 2 only include/hash.h: Changed header to GPL version 2 only include/heap.h: Changed header to GPL version 2 only include/keycache.h: Changed header to GPL version 2 only include/m_ctype.h: Changed header to GPL version 2 only include/m_string.h: Changed header to GPL version 2 only include/md5.h: Changed header to GPL version 2 only include/my_aes.h: Changed header to GPL version 2 only include/my_alarm.h: Changed header to GPL version 2 only include/my_alloc.h: Changed header to GPL version 2 only include/my_base.h: Changed header to GPL version 2 only include/my_bitmap.h: Changed header to GPL version 2 only include/my_dbug.h: Changed header to GPL version 2 only include/my_dir.h: Changed header to GPL version 2 only include/my_getopt.h: Changed header to GPL version 2 only include/my_global.h: Changed header to GPL version 2 only include/my_handler.h: Changed header to GPL version 2 only include/my_libwrap.h: Changed header to GPL version 2 only include/my_list.h: Changed header to GPL version 2 only include/my_net.h: Changed header to GPL version 2 only include/my_no_pthread.h: Changed header to GPL version 2 only include/my_nosys.h: Changed header to GPL version 2 only include/my_pthread.h: Changed header to GPL version 2 only include/my_sys.h: Changed header to GPL version 2 only include/my_time.h: Changed header to GPL version 2 only include/my_tree.h: Changed header to GPL version 2 only include/my_user.h: Changed header to GPL version 2 only include/my_xml.h: Changed header to GPL version 2 only include/myisam.h: Changed header to GPL version 2 only include/myisammrg.h: Changed header to GPL version 2 only include/myisampack.h: Changed header to GPL version 2 only include/mysql.h: Changed header to GPL version 2 only include/mysql_com.h: Changed header to GPL version 2 only include/mysql_embed.h: Changed header to GPL version 2 only include/mysql_time.h: Changed header to GPL version 2 only include/mysys_err.h: Changed header to GPL version 2 only include/queues.h: Changed header to GPL version 2 only include/raid.h: Changed header to GPL version 2 only include/rijndael.h: Changed header to GPL version 2 only include/sha1.h: Changed header to GPL version 2 only include/sql_common.h: Changed header to GPL version 2 only include/sslopt-case.h: Changed header to GPL version 2 only include/sslopt-longopts.h: Changed header to GPL version 2 only include/sslopt-vars.h: Changed header to GPL version 2 only include/t_ctype.h: Changed header to GPL version 2 only include/thr_alarm.h: Changed header to GPL version 2 only include/thr_lock.h: Changed header to GPL version 2 only include/typelib.h: Changed header to GPL version 2 only include/violite.h: Changed header to GPL version 2 only innobase/Makefile.am: Changed header to GPL version 2 only innobase/btr/Makefile.am: Changed header to GPL version 2 only innobase/buf/Makefile.am: Changed header to GPL version 2 only innobase/data/Makefile.am: Changed header to GPL version 2 only innobase/dict/Makefile.am: Changed header to GPL version 2 only innobase/dyn/Makefile.am: Changed header to GPL version 2 only innobase/eval/Makefile.am: Changed header to GPL version 2 only innobase/fil/Makefile.am: Changed header to GPL version 2 only innobase/fsp/Makefile.am: Changed header to GPL version 2 only innobase/fut/Makefile.am: Changed header to GPL version 2 only innobase/ha/Makefile.am: Changed header to GPL version 2 only innobase/ibuf/Makefile.am: Changed header to GPL version 2 only innobase/include/Makefile.am: Changed header to GPL version 2 only innobase/lock/Makefile.am: Changed header to GPL version 2 only innobase/log/Makefile.am: Changed header to GPL version 2 only innobase/mach/Makefile.am: Changed header to GPL version 2 only innobase/mem/Makefile.am: Changed header to GPL version 2 only innobase/mtr/Makefile.am: Changed header to GPL version 2 only innobase/os/Makefile.am: Changed header to GPL version 2 only innobase/page/Makefile.am: Changed header to GPL version 2 only innobase/pars/Makefile.am: Changed header to GPL version 2 only innobase/que/Makefile.am: Changed header to GPL version 2 only innobase/read/Makefile.am: Changed header to GPL version 2 only innobase/rem/Makefile.am: Changed header to GPL version 2 only innobase/row/Makefile.am: Changed header to GPL version 2 only innobase/srv/Makefile.am: Changed header to GPL version 2 only innobase/sync/Makefile.am: Changed header to GPL version 2 only innobase/thr/Makefile.am: Changed header to GPL version 2 only innobase/trx/Makefile.am: Changed header to GPL version 2 only innobase/usr/Makefile.am: Changed header to GPL version 2 only innobase/ut/Makefile.am: Changed header to GPL version 2 only libmysql/client_settings.h: Changed header to GPL version 2 only libmysqld/Makefile.am: Changed header to GPL version 2 only libmysqld/emb_qcache.cc: Changed header to GPL version 2 only libmysqld/emb_qcache.h: Changed header to GPL version 2 only libmysqld/embedded_priv.h: Changed header to GPL version 2 only libmysqld/examples/Makefile.am: Changed header to GPL version 2 only libmysqld/libmysqld.c: Changed header to GPL version 2 only man/Makefile.am: Changed header to GPL version 2 only myisam/Makefile.am: Changed header to GPL version 2 only myisam/ft_boolean_search.c: Changed header to GPL version 2 only myisam/ft_eval.c: Changed header to GPL version 2 only myisam/ft_eval.h: Changed header to GPL version 2 only myisam/ft_nlq_search.c: Changed header to GPL version 2 only myisam/ft_parser.c: Changed header to GPL version 2 only myisam/ft_static.c: Changed header to GPL version 2 only myisam/ft_stem.c: Changed header to GPL version 2 only myisam/ft_stopwords.c: Changed header to GPL version 2 only myisam/ft_test1.c: Changed header to GPL version 2 only myisam/ft_test1.h: Changed header to GPL version 2 only myisam/ft_update.c: Changed header to GPL version 2 only myisam/ftdefs.h: Changed header to GPL version 2 only myisam/fulltext.h: Changed header to GPL version 2 only myisam/mi_cache.c: Changed header to GPL version 2 only myisam/mi_changed.c: Changed header to GPL version 2 only myisam/mi_check.c: Changed header to GPL version 2 only myisam/mi_checksum.c: Changed header to GPL version 2 only myisam/mi_close.c: Changed header to GPL version 2 only myisam/mi_create.c: Changed header to GPL version 2 only myisam/mi_dbug.c: Changed header to GPL version 2 only myisam/mi_delete.c: Changed header to GPL version 2 only myisam/mi_delete_all.c: Changed header to GPL version 2 only myisam/mi_delete_table.c: Changed header to GPL version 2 only myisam/mi_dynrec.c: Changed header to GPL version 2 only myisam/mi_extra.c: Changed header to GPL version 2 only myisam/mi_info.c: Changed header to GPL version 2 only myisam/mi_key.c: Changed header to GPL version 2 only myisam/mi_keycache.c: Changed header to GPL version 2 only myisam/mi_locking.c: Changed header to GPL version 2 only myisam/mi_log.c: Changed header to GPL version 2 only myisam/mi_open.c: Changed header to GPL version 2 only myisam/mi_packrec.c: Changed header to GPL version 2 only myisam/mi_page.c: Changed header to GPL version 2 only myisam/mi_panic.c: Changed header to GPL version 2 only myisam/mi_preload.c: Changed header to GPL version 2 only myisam/mi_range.c: Changed header to GPL version 2 only myisam/mi_rename.c: Changed header to GPL version 2 only myisam/mi_rfirst.c: Changed header to GPL version 2 only myisam/mi_rkey.c: Changed header to GPL version 2 only myisam/mi_rlast.c: Changed header to GPL version 2 only myisam/mi_rnext.c: Changed header to GPL version 2 only myisam/mi_rnext_same.c: Changed header to GPL version 2 only myisam/mi_rprev.c: Changed header to GPL version 2 only myisam/mi_rrnd.c: Changed header to GPL version 2 only myisam/mi_rsame.c: Changed header to GPL version 2 only myisam/mi_rsamepos.c: Changed header to GPL version 2 only myisam/mi_scan.c: Changed header to GPL version 2 only myisam/mi_search.c: Changed header to GPL version 2 only myisam/mi_static.c: Changed header to GPL version 2 only myisam/mi_statrec.c: Changed header to GPL version 2 only myisam/mi_test1.c: Changed header to GPL version 2 only myisam/mi_test2.c: Changed header to GPL version 2 only myisam/mi_test3.c: Changed header to GPL version 2 only myisam/mi_unique.c: Changed header to GPL version 2 only myisam/mi_update.c: Changed header to GPL version 2 only myisam/mi_write.c: Changed header to GPL version 2 only myisam/myisam_ftdump.c: Changed header to GPL version 2 only myisam/myisamchk.c: Changed header to GPL version 2 only myisam/myisamdef.h: Changed header to GPL version 2 only myisam/myisamlog.c: Changed header to GPL version 2 only myisam/myisampack.c: Changed header to GPL version 2 only myisam/rt_index.c: Changed header to GPL version 2 only myisam/rt_index.h: Changed header to GPL version 2 only myisam/rt_key.c: Changed header to GPL version 2 only myisam/rt_key.h: Changed header to GPL version 2 only myisam/rt_mbr.c: Changed header to GPL version 2 only myisam/rt_mbr.h: Changed header to GPL version 2 only myisam/rt_split.c: Changed header to GPL version 2 only myisam/rt_test.c: Changed header to GPL version 2 only myisam/sort.c: Changed header to GPL version 2 only myisam/sp_defs.h: Changed header to GPL version 2 only myisam/sp_key.c: Changed header to GPL version 2 only myisam/sp_test.c: Changed header to GPL version 2 only myisammrg/Makefile.am: Changed header to GPL version 2 only myisammrg/myrg_close.c: Changed header to GPL version 2 only myisammrg/myrg_create.c: Changed header to GPL version 2 only myisammrg/myrg_def.h: Changed header to GPL version 2 only myisammrg/myrg_delete.c: Changed header to GPL version 2 only myisammrg/myrg_extra.c: Changed header to GPL version 2 only myisammrg/myrg_info.c: Changed header to GPL version 2 only myisammrg/myrg_locking.c: Changed header to GPL version 2 only myisammrg/myrg_open.c: Changed header to GPL version 2 only myisammrg/myrg_panic.c: Changed header to GPL version 2 only myisammrg/myrg_queue.c: Changed header to GPL version 2 only myisammrg/myrg_range.c: Changed header to GPL version 2 only myisammrg/myrg_rfirst.c: Changed header to GPL version 2 only myisammrg/myrg_rkey.c: Changed header to GPL version 2 only myisammrg/myrg_rlast.c: Changed header to GPL version 2 only myisammrg/myrg_rnext.c: Changed header to GPL version 2 only myisammrg/myrg_rnext_same.c: Changed header to GPL version 2 only myisammrg/myrg_rprev.c: Changed header to GPL version 2 only myisammrg/myrg_rrnd.c: Changed header to GPL version 2 only myisammrg/myrg_rsame.c: Changed header to GPL version 2 only myisammrg/myrg_static.c: Changed header to GPL version 2 only myisammrg/myrg_update.c: Changed header to GPL version 2 only myisammrg/myrg_write.c: Changed header to GPL version 2 only mysql-test/Makefile.am: Changed header to GPL version 2 only mysys/Makefile.am: Changed header to GPL version 2 only mysys/array.c: Changed header to GPL version 2 only mysys/base64.c: Changed header to GPL version 2 only mysys/charset-def.c: Changed header to GPL version 2 only mysys/charset.c: Changed header to GPL version 2 only mysys/checksum.c: Changed header to GPL version 2 only mysys/default.c: Changed header to GPL version 2 only mysys/default_modify.c: Changed header to GPL version 2 only mysys/errors.c: Changed header to GPL version 2 only mysys/hash.c: Changed header to GPL version 2 only mysys/list.c: Changed header to GPL version 2 only mysys/make-conf.c: Changed header to GPL version 2 only mysys/md5.c: Changed header to GPL version 2 only mysys/mf_brkhant.c: Changed header to GPL version 2 only mysys/mf_cache.c: Changed header to GPL version 2 only mysys/mf_dirname.c: Changed header to GPL version 2 only mysys/mf_fn_ext.c: Changed header to GPL version 2 only mysys/mf_format.c: Changed header to GPL version 2 only mysys/mf_getdate.c: Changed header to GPL version 2 only mysys/mf_iocache.c: Changed header to GPL version 2 only mysys/mf_iocache2.c: Changed header to GPL version 2 only mysys/mf_keycache.c: Changed header to GPL version 2 only mysys/mf_keycaches.c: Changed header to GPL version 2 only mysys/mf_loadpath.c: Changed header to GPL version 2 only mysys/mf_pack.c: Changed header to GPL version 2 only mysys/mf_path.c: Changed header to GPL version 2 only mysys/mf_qsort.c: Changed header to GPL version 2 only mysys/mf_qsort2.c: Changed header to GPL version 2 only mysys/mf_radix.c: Changed header to GPL version 2 only mysys/mf_same.c: Changed header to GPL version 2 only mysys/mf_sort.c: Changed header to GPL version 2 only mysys/mf_soundex.c: Changed header to GPL version 2 only mysys/mf_strip.c: Changed header to GPL version 2 only mysys/mf_tempdir.c: Changed header to GPL version 2 only mysys/mf_tempfile.c: Changed header to GPL version 2 only mysys/mf_unixpath.c: Changed header to GPL version 2 only mysys/mf_util.c: Changed header to GPL version 2 only mysys/mf_wcomp.c: Changed header to GPL version 2 only mysys/mf_wfile.c: Changed header to GPL version 2 only mysys/mulalloc.c: Changed header to GPL version 2 only mysys/my_access.c: Changed header to GPL version 2 only mysys/my_aes.c: Changed header to GPL version 2 only mysys/my_alarm.c: Changed header to GPL version 2 only mysys/my_alloc.c: Changed header to GPL version 2 only mysys/my_append.c: Changed header to GPL version 2 only mysys/my_bit.c: Changed header to GPL version 2 only mysys/my_bitmap.c: Changed header to GPL version 2 only mysys/my_chsize.c: Changed header to GPL version 2 only mysys/my_clock.c: Changed header to GPL version 2 only mysys/my_compress.c: Changed header to GPL version 2 only mysys/my_conio.c: Changed header to GPL version 2 only mysys/my_copy.c: Changed header to GPL version 2 only mysys/my_crc32.c: Changed header to GPL version 2 only mysys/my_create.c: Changed header to GPL version 2 only mysys/my_delete.c: Changed header to GPL version 2 only mysys/my_div.c: Changed header to GPL version 2 only mysys/my_dup.c: Changed header to GPL version 2 only mysys/my_error.c: Changed header to GPL version 2 only mysys/my_file.c: Changed header to GPL version 2 only mysys/my_fopen.c: Changed header to GPL version 2 only mysys/my_fstream.c: Changed header to GPL version 2 only mysys/my_gethostbyname.c: Changed header to GPL version 2 only mysys/my_gethwaddr.c: Changed header to GPL version 2 only mysys/my_getopt.c: Changed header to GPL version 2 only mysys/my_getpagesize.c: Changed header to GPL version 2 only mysys/my_getsystime.c: Changed header to GPL version 2 only mysys/my_getwd.c: Changed header to GPL version 2 only mysys/my_handler.c: Changed header to GPL version 2 only mysys/my_init.c: Changed header to GPL version 2 only mysys/my_largepage.c: Changed header to GPL version 2 only mysys/my_lib.c: Changed header to GPL version 2 only mysys/my_libwrap.c: Changed header to GPL version 2 only mysys/my_lock.c: Changed header to GPL version 2 only mysys/my_lockmem.c: Changed header to GPL version 2 only mysys/my_lread.c: Changed header to GPL version 2 only mysys/my_lwrite.c: Changed header to GPL version 2 only mysys/my_malloc.c: Changed header to GPL version 2 only mysys/my_messnc.c: Changed header to GPL version 2 only mysys/my_mkdir.c: Changed header to GPL version 2 only mysys/my_mmap.c: Changed header to GPL version 2 only mysys/my_net.c: Changed header to GPL version 2 only mysys/my_netware.c: Changed header to GPL version 2 only mysys/my_new.cc: Changed header to GPL version 2 only mysys/my_once.c: Changed header to GPL version 2 only mysys/my_open.c: Changed header to GPL version 2 only mysys/my_os2cond.c: Changed header to GPL version 2 only mysys/my_os2dirsrch.c: Changed header to GPL version 2 only mysys/my_os2dirsrch.h: Changed header to GPL version 2 only mysys/my_os2dlfcn.c: Changed header to GPL version 2 only mysys/my_os2dlfcn.h0: Changed header to GPL version 2 only mysys/my_os2file64.c: Changed header to GPL version 2 only mysys/my_os2thread.c: Changed header to GPL version 2 only mysys/my_os2tls.c: Changed header to GPL version 2 only mysys/my_port.c: Changed header to GPL version 2 only mysys/my_pread.c: Changed header to GPL version 2 only mysys/my_pthread.c: Changed header to GPL version 2 only mysys/my_quick.c: Changed header to GPL version 2 only mysys/my_read.c: Changed header to GPL version 2 only mysys/my_realloc.c: Changed header to GPL version 2 only mysys/my_redel.c: Changed header to GPL version 2 only mysys/my_rename.c: Changed header to GPL version 2 only mysys/my_seek.c: Changed header to GPL version 2 only mysys/my_semaphore.c: Changed header to GPL version 2 only mysys/my_sleep.c: Changed header to GPL version 2 only mysys/my_static.c: Changed header to GPL version 2 only mysys/my_static.h: Changed header to GPL version 2 only mysys/my_symlink.c: Changed header to GPL version 2 only mysys/my_symlink2.c: Changed header to GPL version 2 only mysys/my_sync.c: Changed header to GPL version 2 only mysys/my_thr_init.c: Changed header to GPL version 2 only mysys/my_wincond.c: Changed header to GPL version 2 only mysys/my_windac.c: Changed header to GPL version 2 only mysys/my_winthread.c: Changed header to GPL version 2 only mysys/my_write.c: Changed header to GPL version 2 only mysys/mysys_priv.h: Changed header to GPL version 2 only mysys/ptr_cmp.c: Changed header to GPL version 2 only mysys/queues.c: Changed header to GPL version 2 only mysys/raid.cc: Changed header to GPL version 2 only mysys/raid2.c: Changed header to GPL version 2 only mysys/rijndael.c: Changed header to GPL version 2 only mysys/safemalloc.c: Changed header to GPL version 2 only mysys/sha1.c: Changed header to GPL version 2 only mysys/string.c: Changed header to GPL version 2 only mysys/test_charset.c: Changed header to GPL version 2 only mysys/test_dir.c: Changed header to GPL version 2 only mysys/test_fn.c: Changed header to GPL version 2 only mysys/test_xml.c: Changed header to GPL version 2 only mysys/testhash.c: Changed header to GPL version 2 only mysys/thr_alarm.c: Changed header to GPL version 2 only mysys/thr_lock.c: Changed header to GPL version 2 only mysys/thr_mutex.c: Changed header to GPL version 2 only mysys/thr_rwlock.c: Changed header to GPL version 2 only mysys/tree.c: Changed header to GPL version 2 only mysys/typelib.c: Changed header to GPL version 2 only ndb/include/debugger/DebuggerNames.hpp: Changed header to GPL version 2 only ndb/include/debugger/EventLogger.hpp: Changed header to GPL version 2 only ndb/include/debugger/GrepError.hpp: Changed header to GPL version 2 only ndb/include/debugger/SignalLoggerManager.hpp: Changed header to GPL version 2 only ndb/include/editline/editline.h: Changed header to GPL version 2 only ndb/include/kernel/AttributeDescriptor.hpp: Changed header to GPL version 2 only ndb/include/kernel/AttributeHeader.hpp: Changed header to GPL version 2 only ndb/include/kernel/AttributeList.hpp: Changed header to GPL version 2 only ndb/include/kernel/BlockNumbers.h: Changed header to GPL version 2 only ndb/include/kernel/GlobalSignalNumbers.h: Changed header to GPL version 2 only ndb/include/kernel/GrepEvent.hpp: Changed header to GPL version 2 only ndb/include/kernel/Interpreter.hpp: Changed header to GPL version 2 only ndb/include/kernel/LogLevel.hpp: Changed header to GPL version 2 only ndb/include/kernel/NodeBitmask.hpp: Changed header to GPL version 2 only ndb/include/kernel/NodeInfo.hpp: Changed header to GPL version 2 only ndb/include/kernel/NodeState.hpp: Changed header to GPL version 2 only ndb/include/kernel/RefConvert.hpp: Changed header to GPL version 2 only ndb/include/kernel/kernel_types.h: Changed header to GPL version 2 only ndb/include/kernel/ndb_limits.h: Changed header to GPL version 2 only ndb/include/kernel/signaldata/AbortAll.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/AccFrag.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/AccLock.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/AccScan.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/AccSizeAltReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/AlterIndx.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/AlterTab.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/AlterTable.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/AlterTrig.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ApiBroadcast.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ApiRegSignalData.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ApiVersion.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ArbitSignalData.hpp: Changed header to GPL version 2 only ndb/include/kernel/trigger_definitions.h: Changed header to GPL version 2 only ndb/include/ndb_constants.h: Changed header to GPL version 2 only ndb/include/ndb_global.h.in: Changed header to GPL version 2 only ndb/include/ndb_init.h: Changed header to GPL version 2 only ndb/include/ndb_types.h.in: Changed header to GPL version 2 only ndb/include/ndb_version.h.in: Changed header to GPL version 2 only ndb/include/kernel/signaldata/AttrInfo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/BackupContinueB.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/BackupImpl.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/BackupSignalData.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/BlockCommitOrd.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/BuildIndx.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CheckNodeGroups.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CloseComReqConf.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CmInit.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CmRegSignalData.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CmvmiCfgConf.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CntrMasterConf.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CntrMasterReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ConfigParamId.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ContinueFragmented.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CopyActive.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CopyFrag.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CopyGCIReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CreateEvnt.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CreateFrag.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CreateFragmentation.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CreateIndx.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CreateTab.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CreateTable.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/CreateTrig.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DiAddTab.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DiGetNodes.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DictLock.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DictSchemaInfo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DictSizeAltReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DictStart.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DictTabInfo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DihAddFrag.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DihContinueB.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DihSizeAltReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DihStartTab.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DihSwitchReplica.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DisconnectRep.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DropIndx.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DropTab.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DropTabFile.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DropTable.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DropTrig.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/DumpStateOrd.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/EmptyLcp.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/EndTo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/EventReport.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/EventSubscribeReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ExecFragReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/FailRep.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/FireTrigOrd.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/FsAppendReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/FsCloseReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/FsConf.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/FsOpenReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/FsReadWriteReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/FsRef.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/FsRemoveReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/GCPSave.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/GetTabInfo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/GetTableId.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/GrepImpl.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/HotSpareRep.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/IndxAttrInfo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/IndxKeyInfo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/KeyInfo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/LCP.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ListTables.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/LqhFrag.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/LqhKey.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/LqhSizeAltReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/LqhTransConf.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ManagementServer.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/MasterGCP.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/MasterLCP.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/NFCompleteRep.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/NdbSttor.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/NdbfsContinueB.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/NextScan.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/NodeFailRep.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/NodeStateSignalData.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/PackedSignal.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/PrepDropTab.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/PrepFailReqRef.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ReadNodesConf.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/RelTabMem.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/RepImpl.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ResumeReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ScanFrag.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/ScanTab.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/SetLogLevelOrd.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/SetVarReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/SignalData.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/SignalDataPrint.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/SignalDroppedRep.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/SrFragidConf.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/StartFragReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/StartInfo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/StartMe.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/StartOrd.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/StartPerm.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/StartRec.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/StartTo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/StopMe.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/StopPerm.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/StopReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/SumaImpl.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/SystemError.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TamperOrd.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TcCommit.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TcContinueB.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TcHbRep.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TcIndx.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TcKeyConf.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TcKeyFailConf.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TcKeyRef.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TcKeyReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TcRollbackRep.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TcSizeAltReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TestOrd.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TransIdAI.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TrigAttrInfo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TupCommit.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TupFrag.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TupKey.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TupSizeAltReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TuxBound.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TuxContinueB.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TuxMaint.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/TuxSizeAltReq.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/UpdateTo.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/UtilDelete.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/UtilExecute.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/UtilLock.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/UtilPrepare.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/UtilRelease.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/UtilSequence.hpp: Changed header to GPL version 2 only ndb/include/kernel/signaldata/WaitGCP.hpp: Changed header to GPL version 2 only ndb/include/logger/ConsoleLogHandler.hpp: Changed header to GPL version 2 only ndb/include/logger/FileLogHandler.hpp: Changed header to GPL version 2 only ndb/include/logger/LogHandler.hpp: Changed header to GPL version 2 only ndb/include/logger/Logger.hpp: Changed header to GPL version 2 only ndb/include/logger/SysLogHandler.hpp: Changed header to GPL version 2 only ndb/include/mgmapi/mgmapi.h: Changed header to GPL version 2 only ndb/include/mgmapi/mgmapi_debug.h: Changed header to GPL version 2 only ndb/include/mgmapi/ndb_logevent.h: Changed header to GPL version 2 only ndb/include/mgmapi/ndbd_exit_codes.h: Changed header to GPL version 2 only ndb/include/mgmcommon/ConfigRetriever.hpp: Changed header to GPL version 2 only ndb/include/mgmcommon/IPCConfig.hpp: Changed header to GPL version 2 only ndb/include/mgmcommon/MgmtErrorReporter.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/Ndb.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbApi.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbBlob.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbDictionary.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbError.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbEventOperation.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbIndexOperation.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbIndexScanOperation.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbOperation.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbPool.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbRecAttr.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbReceiver.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbScanFilter.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbScanOperation.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/NdbTransaction.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/ndb_cluster_connection.hpp: Changed header to GPL version 2 only ndb/include/ndbapi/ndb_opt_defaults.h: Changed header to GPL version 2 only ndb/include/ndbapi/ndbapi_limits.h: Changed header to GPL version 2 only ndb/include/ndbapi/ndberror.h: Changed header to GPL version 2 only ndb/include/newtonapi/dba.h: Changed header to GPL version 2 only ndb/include/newtonapi/defs/pcn_types.h: Changed header to GPL version 2 only ndb/include/portlib/NdbCondition.h: Changed header to GPL version 2 only ndb/include/portlib/NdbConfig.h: Changed header to GPL version 2 only ndb/include/portlib/NdbDaemon.h: Changed header to GPL version 2 only ndb/include/portlib/NdbEnv.h: Changed header to GPL version 2 only ndb/include/portlib/NdbHost.h: Changed header to GPL version 2 only ndb/include/portlib/NdbMain.h: Changed header to GPL version 2 only ndb/include/portlib/NdbMem.h: Changed header to GPL version 2 only ndb/include/portlib/NdbMutex.h: Changed header to GPL version 2 only ndb/include/portlib/NdbSleep.h: Changed header to GPL version 2 only ndb/include/portlib/NdbTCP.h: Changed header to GPL version 2 only ndb/include/portlib/NdbThread.h: Changed header to GPL version 2 only ndb/include/portlib/NdbTick.h: Changed header to GPL version 2 only ndb/include/portlib/PortDefs.h: Changed header to GPL version 2 only ndb/include/portlib/prefetch.h: Changed header to GPL version 2 only ndb/include/transporter/TransporterCallback.hpp: Changed header to GPL version 2 only ndb/include/transporter/TransporterDefinitions.hpp: Changed header to GPL version 2 only ndb/include/transporter/TransporterRegistry.hpp: Changed header to GPL version 2 only ndb/include/util/BaseString.hpp: Changed header to GPL version 2 only ndb/include/util/Bitmask.hpp: Changed header to GPL version 2 only ndb/include/util/File.hpp: Changed header to GPL version 2 only ndb/include/util/InputStream.hpp: Changed header to GPL version 2 only ndb/include/util/NdbAutoPtr.hpp: Changed header to GPL version 2 only ndb/include/util/NdbOut.hpp: Changed header to GPL version 2 only ndb/include/util/NdbSqlUtil.hpp: Changed header to GPL version 2 only ndb/include/util/OutputStream.hpp: Changed header to GPL version 2 only ndb/include/util/Parser.hpp: Changed header to GPL version 2 only ndb/include/util/Properties.hpp: Changed header to GPL version 2 only ndb/include/util/SimpleProperties.hpp: Changed header to GPL version 2 only ndb/include/util/SocketAuthenticator.hpp: Changed header to GPL version 2 only ndb/include/util/SocketClient.hpp: Changed header to GPL version 2 only ndb/include/util/SocketServer.hpp: Changed header to GPL version 2 only ndb/include/util/UtilBuffer.hpp: Changed header to GPL version 2 only ndb/include/util/Vector.hpp: Changed header to GPL version 2 only ndb/include/util/basestring_vsnprintf.h: Changed header to GPL version 2 only ndb/include/util/md5_hash.hpp: Changed header to GPL version 2 only ndb/include/util/ndb_opts.h: Changed header to GPL version 2 only ndb/include/util/random.h: Changed header to GPL version 2 only ndb/include/util/socket_io.h: Changed header to GPL version 2 only ndb/include/util/uucode.h: Changed header to GPL version 2 only ndb/include/util/version.h: Changed header to GPL version 2 only ndb/ndbapi-examples/mgmapi_logevent_example/mgmapi_logevent.cpp: Changed header to GPL version 2 only ndb/ndbapi-examples/ndbapi_async_example/ndbapi_async.cpp: Changed header to GPL version 2 only ndb/ndbapi-examples/ndbapi_async_example1/ndbapi_async1.cpp: Changed header to GPL version 2 only ndb/ndbapi-examples/ndbapi_event_example/ndbapi_event.cpp: Changed header to GPL version 2 only ndb/ndbapi-examples/ndbapi_retries_example/ndbapi_retries.cpp: Changed header to GPL version 2 only ndb/ndbapi-examples/ndbapi_scan_example/ndbapi_scan.cpp: Changed header to GPL version 2 only ndb/ndbapi-examples/ndbapi_simple_example/ndbapi_simple.cpp: Changed header to GPL version 2 only ndb/ndbapi-examples/ndbapi_simple_index_example/ndbapi_simple_index.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/BlockNames.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/DebuggerNames.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/EventLogger.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/GrepError.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/SignalLoggerManager.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/AccLock.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/AlterIndx.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/AlterTab.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/AlterTable.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/AlterTrig.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/BackupImpl.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/BackupSignalData.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/CloseComReqConf.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/ContinueB.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/CopyGCI.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/CreateEvnt.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/CreateFragmentation.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/CreateIndx.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/CreateTrig.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/DictTabInfo.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/DihContinueB.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/DihSwitchReplicaReq.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/DisconnectRep.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/DropIndx.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/DropTab.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/DropTrig.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/FailRep.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/FireTrigOrd.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/FsAppendReq.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/FsCloseReq.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/FsConf.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/FsOpenReq.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/FsRef.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/GCPSave.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/IndxAttrInfo.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/IndxKeyInfo.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/LCP.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/LqhFrag.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/LqhKey.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/LqhTrans.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/MasterLCP.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/NFCompleteRep.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/NdbSttor.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/NdbfsContinueB.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/PackedSignal.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/PrepDropTab.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/ScanFrag.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/ScanTab.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/SignalDataPrint.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/SignalDroppedRep.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/SignalNames.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/StartRec.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/SumaImpl.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/SystemError.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/TcIndx.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/TcKeyConf.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/TcKeyRef.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/TcKeyReq.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/TcRollbackRep.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/TrigAttrInfo.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/TupCommit.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/TupKey.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/TuxMaint.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/UtilDelete.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/UtilExecute.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/UtilLock.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/UtilPrepare.cpp: Changed header to GPL version 2 only ndb/src/common/debugger/signaldata/UtilSequence.cpp: Changed header to GPL version 2 only ndb/src/common/logger/ConsoleLogHandler.cpp: Changed header to GPL version 2 only ndb/src/common/logger/FileLogHandler.cpp: Changed header to GPL version 2 only ndb/src/common/logger/LogHandler.cpp: Changed header to GPL version 2 only ndb/src/common/logger/LogHandlerList.cpp: Changed header to GPL version 2 only ndb/src/common/logger/LogHandlerList.hpp: Changed header to GPL version 2 only ndb/src/common/logger/Logger.cpp: Changed header to GPL version 2 only ndb/src/common/logger/SysLogHandler.cpp: Changed header to GPL version 2 only ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp: Changed header to GPL version 2 only ndb/src/common/logger/listtest/LogHandlerListUnitTest.hpp: Changed header to GPL version 2 only ndb/src/common/logger/loggertest/LoggerUnitTest.cpp: Changed header to GPL version 2 only ndb/src/common/logger/loggertest/LoggerUnitTest.hpp: Changed header to GPL version 2 only ndb/src/common/mgmcommon/ConfigRetriever.cpp: Changed header to GPL version 2 only ndb/src/common/mgmcommon/IPCConfig.cpp: Changed header to GPL version 2 only ndb/src/common/mgmcommon/printConfig/printConfig.cpp: Changed header to GPL version 2 only ndb/src/common/portlib/NdbCondition.c: Changed header to GPL version 2 only ndb/src/common/portlib/NdbConfig.c: Changed header to GPL version 2 only ndb/src/common/portlib/NdbDaemon.c: Changed header to GPL version 2 only ndb/src/common/portlib/NdbEnv.c: Changed header to GPL version 2 only ndb/src/common/portlib/NdbHost.c: Changed header to GPL version 2 only ndb/src/common/portlib/NdbMem.c: Changed header to GPL version 2 only ndb/src/common/portlib/NdbMutex.c: Changed header to GPL version 2 only ndb/src/common/portlib/NdbPortLibTest.cpp: Changed header to GPL version 2 only ndb/src/common/portlib/NdbSleep.c: Changed header to GPL version 2 only ndb/src/common/portlib/NdbTCP.cpp: Changed header to GPL version 2 only ndb/src/common/portlib/NdbThread.c: Changed header to GPL version 2 only ndb/src/common/portlib/NdbTick.c: Changed header to GPL version 2 only ndb/src/common/portlib/memtest.c: Changed header to GPL version 2 only ndb/src/common/portlib/mmslist.cpp: Changed header to GPL version 2 only ndb/src/common/portlib/mmstest.cpp: Changed header to GPL version 2 only ndb/src/common/portlib/munmaptest.cpp: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbCondition.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbConditionOSE.h: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbEnv.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbHost.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbMem.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbMem_SoftOse.cpp: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbMutex.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbOut.cpp: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbSleep.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbTCP.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbThread.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/ose/NdbTick.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/win32/NdbCondition.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/win32/NdbDaemon.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/win32/NdbEnv.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/win32/NdbHost.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/win32/NdbMem.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/win32/NdbMutex.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/win32/NdbSleep.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/win32/NdbTCP.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/win32/NdbThread.c: Changed header to GPL version 2 only ndb/src/common/portlib/old_dirs/win32/NdbTick.c: Changed header to GPL version 2 only ndb/src/common/portlib/win32/NdbCondition.c: Changed header to GPL version 2 only ndb/src/common/portlib/win32/NdbDaemon.c: Changed header to GPL version 2 only ndb/src/common/portlib/win32/NdbEnv.c: Changed header to GPL version 2 only ndb/src/common/portlib/win32/NdbHost.c: Changed header to GPL version 2 only ndb/src/common/portlib/win32/NdbMem.c: Changed header to GPL version 2 only ndb/src/common/portlib/win32/NdbMutex.c: Changed header to GPL version 2 only ndb/src/common/portlib/win32/NdbSleep.c: Changed header to GPL version 2 only ndb/src/common/portlib/win32/NdbTCP.c: Changed header to GPL version 2 only ndb/src/common/portlib/win32/NdbThread.c: Changed header to GPL version 2 only ndb/src/common/portlib/win32/NdbTick.c: Changed header to GPL version 2 only ndb/src/common/transporter/OSE_Receiver.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/OSE_Receiver.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/OSE_Signals.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/OSE_Transporter.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/OSE_Transporter.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/Packer.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/Packer.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/SCI_Transporter.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/SCI_Transporter.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/SHM_Buffer.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/SHM_Transporter.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/SHM_Transporter.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/SHM_Transporter.unix.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/SHM_Transporter.win32.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/SendBuffer.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/SendBuffer.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/TCP_Transporter.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/TCP_Transporter.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/Transporter.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/Transporter.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/TransporterInternalDefinitions.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/TransporterRegistry.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/basictest/basicTransporterTest.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/buddy.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/buddy.hpp: Changed header to GPL version 2 only ndb/src/common/transporter/failoverSCI/failoverSCI.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/perftest/perfTransporterTest.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/priotest/prioSCI/prioSCI.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/priotest/prioSHM/prioSHM.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/priotest/prioTCP/prioTCP.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/priotest/prioTransporterTest.cpp: Changed header to GPL version 2 only ndb/src/common/transporter/priotest/prioTransporterTest.hpp: Changed header to GPL version 2 only ndb/src/common/util/BaseString.cpp: Changed header to GPL version 2 only ndb/src/common/util/File.cpp: Changed header to GPL version 2 only ndb/src/common/util/InputStream.cpp: Changed header to GPL version 2 only ndb/src/common/util/NdbErrHnd.cpp: Changed header to GPL version 2 only ndb/src/common/util/NdbOut.cpp: Changed header to GPL version 2 only ndb/src/common/util/NdbSqlUtil.cpp: Changed header to GPL version 2 only ndb/src/common/util/OutputStream.cpp: Changed header to GPL version 2 only ndb/src/common/util/Parser.cpp: Changed header to GPL version 2 only ndb/src/common/util/Properties.cpp: Changed header to GPL version 2 only ndb/src/common/util/SimpleProperties.cpp: Changed header to GPL version 2 only ndb/src/common/util/SocketAuthenticator.cpp: Changed header to GPL version 2 only ndb/src/common/util/SocketClient.cpp: Changed header to GPL version 2 only ndb/src/common/util/SocketServer.cpp: Changed header to GPL version 2 only ndb/src/common/util/basestring_vsnprintf.c: Changed header to GPL version 2 only ndb/src/common/util/filetest/FileUnitTest.cpp: Changed header to GPL version 2 only ndb/src/common/util/filetest/FileUnitTest.hpp: Changed header to GPL version 2 only ndb/src/common/util/md5_hash.cpp: Changed header to GPL version 2 only ndb/src/common/util/ndb_init.c: Changed header to GPL version 2 only ndb/src/common/util/random.c: Changed header to GPL version 2 only ndb/src/common/util/socket_io.cpp: Changed header to GPL version 2 only ndb/src/common/util/strdup.c: Changed header to GPL version 2 only ndb/src/common/util/testProperties/testProperties.cpp: Changed header to GPL version 2 only ndb/src/common/util/testSimpleProperties/sp_test.cpp: Changed header to GPL version 2 only ndb/src/common/util/uucode.c: Changed header to GPL version 2 only ndb/src/common/util/version.c: Changed header to GPL version 2 only ndb/src/cw/cpcc-win32/C++/CPC_GUI.cpp: Changed header to GPL version 2 only ndb/src/cw/cpcc-win32/C++/CPC_GUI.h: Changed header to GPL version 2 only ndb/src/cw/cpcc-win32/C++/NdbControls.cpp: Changed header to GPL version 2 only ndb/src/cw/cpcc-win32/C++/StdAfx.cpp: Changed header to GPL version 2 only ndb/src/cw/cpcc-win32/C++/StdAfx.h: Changed header to GPL version 2 only ndb/src/cw/cpcc-win32/C++/TreeView.cpp: Changed header to GPL version 2 only ndb/src/cw/cpcc-win32/C++/TreeView.h: Changed header to GPL version 2 only ndb/src/cw/cpcc-win32/C++/resource.h: Changed header to GPL version 2 only ndb/src/cw/cpcd/APIService.cpp: Changed header to GPL version 2 only ndb/src/cw/cpcd/APIService.hpp: Changed header to GPL version 2 only ndb/src/cw/cpcd/CPCD.cpp: Changed header to GPL version 2 only ndb/src/cw/cpcd/CPCD.hpp: Changed header to GPL version 2 only ndb/src/cw/cpcd/Monitor.cpp: Changed header to GPL version 2 only ndb/src/cw/cpcd/Process.cpp: Changed header to GPL version 2 only ndb/src/cw/cpcd/common.cpp: Changed header to GPL version 2 only ndb/src/cw/cpcd/common.hpp: Changed header to GPL version 2 only ndb/src/cw/cpcd/main.cpp: Changed header to GPL version 2 only ndb/src/cw/test/socketclient/socketClientTest.cpp: Changed header to GPL version 2 only ndb/src/cw/util/ClientInterface.cpp: Changed header to GPL version 2 only ndb/src/cw/util/ClientInterface.hpp: Changed header to GPL version 2 only ndb/src/cw/util/SocketRegistry.cpp: Changed header to GPL version 2 only ndb/src/cw/util/SocketRegistry.hpp: Changed header to GPL version 2 only ndb/src/cw/util/SocketService.cpp: Changed header to GPL version 2 only ndb/src/cw/util/SocketService.hpp: Changed header to GPL version 2 only ndb/src/kernel/SimBlockList.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/backup/Backup.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/backup/Backup.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/backup/BackupFormat.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/backup/BackupInit.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/backup/FsBuffer.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/backup/read.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbacc/Dbacc.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/mutexes.hpp: Changed header to GPL version 2 only ndb/src/kernel/main.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbdict/SchemaFile.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbdih/DbdihInit.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbdih/Sysfile.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dblqh/DblqhInit.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtc/DbtcInit.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupLCP.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupSystemRestart.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtup/DbtupUndoLog.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtux/Dbtux.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbutil/DbUtil.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/dbutil/DbUtil.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/Filename.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/Filename.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/MemoryChannel.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/MemoryChannelOSE.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/OpenFiles.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/Pool.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/ndbfs/VoidFs.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/qmgr/Qmgr.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/qmgr/QmgrInit.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/qmgr/timer.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/suma/Suma.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/suma/Suma.hpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/suma/SumaInit.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/trix/Trix.cpp: Changed header to GPL version 2 only ndb/src/kernel/blocks/trix/Trix.hpp: Changed header to GPL version 2 only ndb/src/kernel/error/ErrorHandlingMacros.hpp: Changed header to GPL version 2 only ndb/src/kernel/error/ErrorReporter.cpp: Changed header to GPL version 2 only ndb/src/kernel/error/ErrorReporter.hpp: Changed header to GPL version 2 only ndb/src/kernel/error/TimeModule.cpp: Changed header to GPL version 2 only ndb/src/kernel/error/TimeModule.hpp: Changed header to GPL version 2 only ndb/src/kernel/error/ndbd_exit_codes.c: Changed header to GPL version 2 only ndb/src/kernel/vm/Array.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/ArrayFifoList.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/ArrayList.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/ArrayPool.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/CArray.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/Callback.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/ClusterConfiguration.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/ClusterConfiguration.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/Configuration.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/Configuration.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/DLFifoList.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/DLHashTable.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/DLHashTable2.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/DLList.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/DataBuffer.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/Emulator.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/Emulator.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/FastScheduler.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/FastScheduler.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/GlobalData.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/KeyDescriptor.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/KeyTable.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/KeyTable2.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/LongSignal.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/MetaData.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/MetaData.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/Mutex.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/Mutex.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/Prio.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/RequestTracker.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SLList.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SafeCounter.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SafeCounter.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SectionReader.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SectionReader.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SignalCounter.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SimBlockList.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SimplePropertiesSection.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SimulatedBlock.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SimulatedBlock.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SuperPool.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/SuperPool.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/ThreadConfig.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/ThreadConfig.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/TimeQueue.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/TimeQueue.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/TransporterCallback.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/VMSignal.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/VMSignal.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/WaitQueue.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/WatchDog.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/WatchDog.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/al_test/arrayListTest.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/al_test/arrayPoolTest.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/al_test/main.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/ndbd_malloc.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/ndbd_malloc.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/pc.hpp: Changed header to GPL version 2 only ndb/src/kernel/vm/testCopy/rr.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/testCopy/testCopy.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/testLongSig/testLongSig.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp: Changed header to GPL version 2 only ndb/src/kernel/vm/testSuperPool.cpp: Changed header to GPL version 2 only ndb/src/mgmapi/LocalConfig.cpp: Changed header to GPL version 2 only ndb/src/mgmapi/LocalConfig.hpp: Changed header to GPL version 2 only ndb/src/mgmapi/mgmapi.cpp: Changed header to GPL version 2 only ndb/src/mgmapi/mgmapi_configuration.hpp: Changed header to GPL version 2 only ndb/src/mgmapi/mgmapi_internal.h: Changed header to GPL version 2 only ndb/src/mgmapi/ndb_logevent.cpp: Changed header to GPL version 2 only ndb/src/mgmapi/ndb_logevent.hpp: Changed header to GPL version 2 only ndb/src/mgmapi/test/keso.c: Changed header to GPL version 2 only ndb/src/mgmapi/test/mgmSrvApi.cpp: Changed header to GPL version 2 only ndb/src/mgmclient/CommandInterpreter.cpp: Changed header to GPL version 2 only ndb/src/mgmclient/main.cpp: Changed header to GPL version 2 only ndb/src/mgmclient/ndb_mgmclient.hpp: Changed header to GPL version 2 only ndb/src/mgmclient/ndb_mgmclient.h: Changed header to GPL version 2 only ndb/src/mgmclient/test_cpcd/test_cpcd.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/Config.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/Config.hpp: Changed header to GPL version 2 only ndb/src/mgmsrv/ConfigInfo.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/ConfigInfo.hpp: Changed header to GPL version 2 only ndb/src/mgmsrv/InitConfigFileParser.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/InitConfigFileParser.hpp: Changed header to GPL version 2 only ndb/src/mgmsrv/MgmtSrvr.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/MgmtSrvr.hpp: Changed header to GPL version 2 only ndb/src/mgmsrv/MgmtSrvrConfig.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/Services.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/Services.hpp: Changed header to GPL version 2 only ndb/src/mgmsrv/SignalQueue.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/SignalQueue.hpp: Changed header to GPL version 2 only ndb/src/mgmsrv/convertStrToInt.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/convertStrToInt.hpp: Changed header to GPL version 2 only ndb/src/mgmsrv/main.cpp: Changed header to GPL version 2 only ndb/src/mgmsrv/mkconfig/mkconfig.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/API.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/ClusterMgr.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/ClusterMgr.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/DictCache.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/DictCache.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/Ndb.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbApiSignal.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbApiSignal.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbBlob.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbBlobImpl.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbDictionary.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbDictionaryImpl.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbDictionaryImpl.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbErrorOut.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbEventOperation.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbEventOperationImpl.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbEventOperationImpl.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbImpl.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbIndexOperation.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbLinHash.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbOperation.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbOperationDefine.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbOperationExec.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbOperationInt.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbOperationScan.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbOperationSearch.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbPool.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbPoolImpl.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbPoolImpl.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbRecAttr.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbReceiver.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbScanFilter.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbScanOperation.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbTransaction.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbTransactionScan.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbUtil.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbUtil.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/NdbWaiter.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/Ndberr.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/Ndbif.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/Ndbinit.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/Ndblist.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/ObjectMap.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/SignalSender.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/SignalSender.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/TransporterFacade.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/TransporterFacade.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/ndb_cluster_connection.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/ndb_cluster_connection_impl.hpp: Changed header to GPL version 2 only ndb/src/ndbapi/ndberror.c: Changed header to GPL version 2 only ndb/src/ndbapi/signal-sender/SignalSender.cpp: Changed header to GPL version 2 only ndb/src/ndbapi/signal-sender/SignalSender.hpp: Changed header to GPL version 2 only ndb/test/include/CpcClient.hpp: Changed header to GPL version 2 only ndb/test/include/HugoAsynchTransactions.hpp: Changed header to GPL version 2 only ndb/test/include/HugoCalculator.hpp: Changed header to GPL version 2 only ndb/test/include/HugoOperations.hpp: Changed header to GPL version 2 only ndb/test/include/HugoTransactions.hpp: Changed header to GPL version 2 only ndb/test/include/NDBT.hpp: Changed header to GPL version 2 only ndb/test/include/NDBT_DataSet.hpp: Changed header to GPL version 2 only ndb/test/include/NDBT_DataSetTransaction.hpp: Changed header to GPL version 2 only ndb/test/include/NDBT_Error.hpp: Changed header to GPL version 2 only ndb/test/include/NDBT_Output.hpp: Changed header to GPL version 2 only ndb/test/include/NDBT_ResultRow.hpp: Changed header to GPL version 2 only ndb/test/include/NDBT_ReturnCodes.h: Changed header to GPL version 2 only ndb/test/include/NDBT_Stats.hpp: Changed header to GPL version 2 only ndb/test/include/NDBT_Table.hpp: Changed header to GPL version 2 only ndb/test/include/NDBT_Tables.hpp: Changed header to GPL version 2 only ndb/test/include/NDBT_Test.hpp: Changed header to GPL version 2 only ndb/test/include/NdbBackup.hpp: Changed header to GPL version 2 only ndb/test/include/NdbConfig.hpp: Changed header to GPL version 2 only ndb/test/include/NdbGrep.hpp: Changed header to GPL version 2 only ndb/test/include/NdbRestarter.hpp: Changed header to GPL version 2 only ndb/test/include/NdbRestarts.hpp: Changed header to GPL version 2 only ndb/test/include/NdbSchemaCon.hpp: Changed header to GPL version 2 only ndb/test/include/NdbSchemaOp.hpp: Changed header to GPL version 2 only ndb/test/include/NdbTest.hpp: Changed header to GPL version 2 only ndb/test/include/NdbTimer.hpp: Changed header to GPL version 2 only ndb/test/include/TestNdbEventOperation.hpp: Changed header to GPL version 2 only ndb/test/include/UtilTransactions.hpp: Changed header to GPL version 2 only ndb/test/include/getarg.h: Changed header to GPL version 2 only ndb/test/ndbapi/InsertRecs.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/ScanFilter.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/ScanFunctions.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/ScanInterpretTest.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/TraceNdbApi.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/VerifyNdbApi.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/acid.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/acid2.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/adoInsertRecs.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/asyncGenerator.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/benchronja.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bulk_copy.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/cdrserver.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/celloDb.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/create_all_tabs.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/create_tab.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/drop_all_tabs.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/flexAsynch.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/flexBench.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/flexHammer.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/flexScan.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/flexTT.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/flexTimedAsynch.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/flex_bench_mysql.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/index.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/index2.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/initronja.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/interpreterInTup.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/mainAsyncGenerator.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/msa.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/ndb_async1.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/ndb_async2.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/ndb_user_populate.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/ndb_user_transaction.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/ndb_user_transaction2.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/ndb_user_transaction3.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/ndb_user_transaction4.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/ndb_user_transaction5.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/ndb_user_transaction6.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/restarter.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/restarter2.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/restarts.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/size.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testBackup.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testBasic.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testBasicAsynch.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testBlobs.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testDataBuffers.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testDeadlock.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testDict.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testGrepVerify.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testIndex.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testInterpreter.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testMgm.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testNdbApi.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testNodeRestart.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testOIBasic.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testOperations.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testOrderedIndex.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testPartitioning.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testReadPerf.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testRestartGci.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testSRBank.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testScan.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testScanInterpreter.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testScanPerf.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testSystemRestart.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bank/Bank.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bank/Bank.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/bank/BankLoad.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bank/bankCreator.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bank/bankMakeGL.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bank/bankSumAccounts.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bank/bankTimer.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bank/bankTransactionMaker.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bank/bankValidateAllGLs.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bank/testBank.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/asyncGenerator.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/dbGenerator.h: Changed header to GPL version 2 only ndb/test/ndbapi/bench/dbPopulate.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/dbPopulate.h: Changed header to GPL version 2 only ndb/test/ndbapi/bench/macros.h: Changed header to GPL version 2 only ndb/test/ndbapi/bench/mainAsyncGenerator.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/mainPopulate.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/ndb_async1.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/ndb_async2.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/ndb_error.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/ndb_schema.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/ndb_user_transaction.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/ndb_user_transaction2.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/ndb_user_transaction3.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/ndb_user_transaction4.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/ndb_user_transaction5.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/ndb_user_transaction6.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/testData.h: Changed header to GPL version 2 only ndb/test/ndbapi/bench/testDefinitions.h: Changed header to GPL version 2 only ndb/test/ndbapi/bench/userInterface.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/bench/userInterface.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/acid2/TraceNdbApi.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/acid2/VerifyNdbApi.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/dbGenerator.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/testData.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/async-src/include/userInterface.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/macros.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/async-src/user/ndb_error.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/include/ndb_schema.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/include/testDefinitions.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.c: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/dbGenerator.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/generator/mainGenerator.c: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/include/testData.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/include/userInterface.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.c: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/dbPopulate.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/populator/mainPopulate.c: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/user/localDbPrepare.c: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/user/macros.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/user/ndb_error.hpp: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userHandle.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userInterface.c: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userHandle.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userInterface.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/user/userTransaction.c: Changed header to GPL version 2 only ndb/test/ndbapi/testTimeout.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/testTransactions.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/test_event.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/test_event_merge.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/test_event_multi_table.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/userInterface.cpp: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/lmc-bench/src/user/old/userTransaction.c: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/vw_test/bcd.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/vw_test/utv.h: Changed header to GPL version 2 only ndb/test/ndbapi/old_dirs/vw_test/vcdrfunc.h: Changed header to GPL version 2 only ndb/test/newtonapi/basic_test/basic/basic.cpp: Changed header to GPL version 2 only ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp: Changed header to GPL version 2 only ndb/test/newtonapi/basic_test/common.cpp: Changed header to GPL version 2 only ndb/test/newtonapi/basic_test/common.hpp: Changed header to GPL version 2 only ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp: Changed header to GPL version 2 only ndb/test/newtonapi/basic_test/too_basic.cpp: Changed header to GPL version 2 only ndb/test/newtonapi/perf_test/perf.cpp: Changed header to GPL version 2 only ndb/test/odbc/SQL99_test/SQL99_test.cpp: Changed header to GPL version 2 only ndb/test/odbc/SQL99_test/SQL99_test.h: Changed header to GPL version 2 only ndb/test/odbc/client/NDBT_ALLOCHANDLE.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/NDBT_ALLOCHANDLE_HDBC.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/NDBT_SQLConnect.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/NDBT_SQLPrepare.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLAllocEnvTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLAllocHandleTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLAllocHandleTest_bf.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLBindColTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLBindParameterTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLCancelTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLCloseCursorTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLColAttributeTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLColAttributeTest1.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLColAttributeTest2.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLColAttributeTest3.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLConnectTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLCopyDescTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLDescribeColTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLDisconnectTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLDriverConnectTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLEndTranTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLErrorTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLExecDirectTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLExecuteTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLFetchScrollTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLFetchTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLFreeHandleTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLFreeStmtTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetConnectAttrTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetCursorNameTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetDataTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetDescFieldTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetDescRecTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetDiagFieldTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetDiagRecSimpleTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetDiagRecTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetEnvAttrTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetFunctionsTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetInfoTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetStmtAttrTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLGetTypeInfoTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLMoreResultsTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLNumResultColsTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLParamDataTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLPrepareTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLPutDataTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLRowCountTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLSetConnectAttrTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLSetCursorNameTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLSetDescFieldTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLSetDescRecTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLSetEnvAttrTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLSetStmtAttrTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLTablesTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/SQLTransactTest.cpp: Changed header to GPL version 2 only ndb/test/odbc/client/common.hpp: Changed header to GPL version 2 only ndb/test/odbc/client/main.cpp: Changed header to GPL version 2 only ndb/test/odbc/driver/testOdbcDriver.cpp: Changed header to GPL version 2 only ndb/test/odbc/test_compiler/test_compiler.cpp: Changed header to GPL version 2 only ndb/test/run-test/main.cpp: Changed header to GPL version 2 only ndb/test/run-test/run-test.hpp: Changed header to GPL version 2 only ndb/test/src/CpcClient.cpp: Changed header to GPL version 2 only ndb/test/src/HugoAsynchTransactions.cpp: Changed header to GPL version 2 only ndb/test/src/HugoCalculator.cpp: Changed header to GPL version 2 only ndb/test/src/HugoOperations.cpp: Changed header to GPL version 2 only ndb/test/src/HugoTransactions.cpp: Changed header to GPL version 2 only ndb/test/src/NDBT_Error.cpp: Changed header to GPL version 2 only ndb/test/src/NDBT_Output.cpp: Changed header to GPL version 2 only ndb/test/src/NDBT_ResultRow.cpp: Changed header to GPL version 2 only ndb/test/src/NDBT_ReturnCodes.cpp: Changed header to GPL version 2 only ndb/test/src/NDBT_Table.cpp: Changed header to GPL version 2 only ndb/test/src/NDBT_Tables.cpp: Changed header to GPL version 2 only ndb/test/src/NDBT_Test.cpp: Changed header to GPL version 2 only ndb/test/src/NdbBackup.cpp: Changed header to GPL version 2 only ndb/test/src/NdbConfig.cpp: Changed header to GPL version 2 only ndb/test/src/NdbGrep.cpp: Changed header to GPL version 2 only ndb/test/src/NdbRestarter.cpp: Changed header to GPL version 2 only ndb/test/src/NdbRestarts.cpp: Changed header to GPL version 2 only ndb/test/src/NdbSchemaCon.cpp: Changed header to GPL version 2 only ndb/test/src/NdbSchemaOp.cpp: Changed header to GPL version 2 only ndb/test/src/UtilTransactions.cpp: Changed header to GPL version 2 only ndb/test/tools/copy_tab.cpp: Changed header to GPL version 2 only ndb/test/tools/cpcc.cpp: Changed header to GPL version 2 only ndb/test/tools/create_index.cpp: Changed header to GPL version 2 only ndb/test/tools/hugoCalculator.cpp: Changed header to GPL version 2 only ndb/test/tools/hugoFill.cpp: Changed header to GPL version 2 only ndb/test/tools/hugoLoad.cpp: Changed header to GPL version 2 only ndb/test/tools/hugoLockRecords.cpp: Changed header to GPL version 2 only ndb/test/tools/hugoPkDelete.cpp: Changed header to GPL version 2 only ndb/test/tools/hugoPkRead.cpp: Changed header to GPL version 2 only ndb/test/tools/hugoPkReadRecord.cpp: Changed header to GPL version 2 only ndb/test/tools/hugoPkUpdate.cpp: Changed header to GPL version 2 only ndb/test/tools/hugoScanRead.cpp: Changed header to GPL version 2 only ndb/test/tools/hugoScanUpdate.cpp: Changed header to GPL version 2 only ndb/test/tools/old_dirs/waiter/waiter.cpp: Changed header to GPL version 2 only ndb/test/tools/restart.cpp: Changed header to GPL version 2 only ndb/test/tools/transproxy.cpp: Changed header to GPL version 2 only ndb/test/tools/verify_index.cpp: Changed header to GPL version 2 only ndb/tools/delete_all.cpp: Changed header to GPL version 2 only ndb/tools/desc.cpp: Changed header to GPL version 2 only ndb/tools/drop_index.cpp: Changed header to GPL version 2 only ndb/tools/drop_tab.cpp: Changed header to GPL version 2 only ndb/tools/listTables.cpp: Changed header to GPL version 2 only ndb/tools/ndb_config.cpp: Changed header to GPL version 2 only ndb/tools/ndb_test_platform.cpp: Changed header to GPL version 2 only ndb/tools/ndbsql.cpp: Changed header to GPL version 2 only ndb/tools/restore/Restore.cpp: Changed header to GPL version 2 only ndb/tools/restore/Restore.hpp: Changed header to GPL version 2 only ndb/tools/restore/consumer.cpp: Changed header to GPL version 2 only ndb/tools/restore/consumer.hpp: Changed header to GPL version 2 only ndb/tools/restore/consumer_printer.cpp: Changed header to GPL version 2 only ndb/tools/restore/consumer_printer.hpp: Changed header to GPL version 2 only ndb/tools/restore/consumer_restore.cpp: Changed header to GPL version 2 only ndb/tools/restore/consumer_restore.hpp: Changed header to GPL version 2 only ndb/tools/select_all.cpp: Changed header to GPL version 2 only ndb/tools/select_count.cpp: Changed header to GPL version 2 only ndb/tools/waiter.cpp: Changed header to GPL version 2 only ndb/tools/restore/consumer_restorem.cpp: Changed header to GPL version 2 only ndb/tools/restore/restore_main.cpp: Changed header to GPL version 2 only netware/mysql_fix_privilege_tables.pl: Changed header to GPL version 2 only netware/mysql_secure_installation.pl: Changed header to GPL version 2 only os2/Makefile.am: Changed header to GPL version 2 only os2/include/Makefile.am: Changed header to GPL version 2 only os2/include/sys/Makefile.am: Changed header to GPL version 2 only pstack/Makefile.am: Changed header to GPL version 2 only regex/Makefile.am: Changed header to GPL version 2 only scripts/Makefile.am: Changed header to GPL version 2 only scripts/fill_help_tables.sh: Changed header to GPL version 2 only scripts/mysql_config.sh: Changed header to GPL version 2 only scripts/mysql_secure_installation.sh: Changed header to GPL version 2 only server-tools/instance-manager/Makefile.am: Changed header to GPL version 2 only server-tools/instance-manager/buffer.cc: Changed header to GPL version 2 only server-tools/instance-manager/buffer.h: Changed header to GPL version 2 only server-tools/instance-manager/command.cc: Changed header to GPL version 2 only server-tools/instance-manager/command.h: Changed header to GPL version 2 only server-tools/instance-manager/commands.cc: Changed header to GPL version 2 only server-tools/instance-manager/commands.h: Changed header to GPL version 2 only server-tools/instance-manager/guardian.cc: Changed header to GPL version 2 only server-tools/instance-manager/guardian.h: Changed header to GPL version 2 only server-tools/instance-manager/instance.cc: Changed header to GPL version 2 only server-tools/instance-manager/instance.h: Changed header to GPL version 2 only server-tools/instance-manager/instance_map.cc: Changed header to GPL version 2 only server-tools/instance-manager/instance_map.h: Changed header to GPL version 2 only server-tools/instance-manager/instance_options.cc: Changed header to GPL version 2 only server-tools/instance-manager/instance_options.h: Changed header to GPL version 2 only server-tools/instance-manager/listener.cc: Changed header to GPL version 2 only server-tools/instance-manager/listener.h: Changed header to GPL version 2 only server-tools/instance-manager/log.cc: Changed header to GPL version 2 only server-tools/instance-manager/log.h: Changed header to GPL version 2 only server-tools/instance-manager/manager.cc: Changed header to GPL version 2 only server-tools/instance-manager/manager.h: Changed header to GPL version 2 only server-tools/instance-manager/messages.cc: Changed header to GPL version 2 only server-tools/instance-manager/messages.h: Changed header to GPL version 2 only server-tools/instance-manager/mysql_connection.cc: Changed header to GPL version 2 only server-tools/instance-manager/mysql_connection.h: Changed header to GPL version 2 only server-tools/instance-manager/mysql_manager_error.h: Changed header to GPL version 2 only server-tools/instance-manager/mysqlmanager.cc: Changed header to GPL version 2 only server-tools/instance-manager/options.cc: Changed header to GPL version 2 only server-tools/instance-manager/options.h: Changed header to GPL version 2 only server-tools/instance-manager/parse.cc: Changed header to GPL version 2 only server-tools/instance-manager/parse.h: Changed header to GPL version 2 only server-tools/instance-manager/parse_output.cc: Changed header to GPL version 2 only server-tools/instance-manager/parse_output.h: Changed header to GPL version 2 only server-tools/instance-manager/priv.cc: Changed header to GPL version 2 only server-tools/instance-manager/priv.h: Changed header to GPL version 2 only server-tools/instance-manager/protocol.cc: Changed header to GPL version 2 only server-tools/instance-manager/protocol.h: Changed header to GPL version 2 only server-tools/instance-manager/thread_registry.cc: Changed header to GPL version 2 only server-tools/instance-manager/thread_registry.h: Changed header to GPL version 2 only server-tools/instance-manager/user_map.cc: Changed header to GPL version 2 only server-tools/instance-manager/user_map.h: Changed header to GPL version 2 only sql/Makefile.am: Changed header to GPL version 2 only sql/client_settings.h: Changed header to GPL version 2 only sql/custom_conf.h: Changed header to GPL version 2 only sql/derror.cc: Changed header to GPL version 2 only sql/des_key_file.cc: Changed header to GPL version 2 only sql/discover.cc: Changed header to GPL version 2 only sql/field.cc: Changed header to GPL version 2 only sql/field.h: Changed header to GPL version 2 only sql/field_conv.cc: Changed header to GPL version 2 only sql/filesort.cc: Changed header to GPL version 2 only sql/frm_crypt.cc: Changed header to GPL version 2 only sql/gen_lex_hash.cc: Changed header to GPL version 2 only sql/gstream.cc: Changed header to GPL version 2 only sql/gstream.h: Changed header to GPL version 2 only sql/ha_archive.cc: Changed header to GPL version 2 only sql/ha_archive.h: Changed header to GPL version 2 only sql/ha_berkeley.cc: Changed header to GPL version 2 only sql/ha_berkeley.h: Changed header to GPL version 2 only sql/ha_blackhole.cc: Changed header to GPL version 2 only sql/ha_blackhole.h: Changed header to GPL version 2 only sql/ha_federated.cc: Changed header to GPL version 2 only sql/ha_federated.h: Changed header to GPL version 2 only sql/ha_heap.cc: Changed header to GPL version 2 only sql/ha_heap.h: Changed header to GPL version 2 only sql/ha_innodb.cc: Changed header to GPL version 2 only sql/ha_innodb.h: Changed header to GPL version 2 only sql/ha_myisam.cc: Changed header to GPL version 2 only sql/ha_myisam.h: Changed header to GPL version 2 only sql/ha_myisammrg.cc: Changed header to GPL version 2 only sql/ha_myisammrg.h: Changed header to GPL version 2 only sql/ha_ndbcluster.cc: Changed header to GPL version 2 only sql/ha_ndbcluster.h: Changed header to GPL version 2 only sql/handler.cc: Changed header to GPL version 2 only sql/handler.h: Changed header to GPL version 2 only sql/hash_filo.cc: Changed header to GPL version 2 only sql/hash_filo.h: Changed header to GPL version 2 only sql/hostname.cc: Changed header to GPL version 2 only sql/init.cc: Changed header to GPL version 2 only sql/item.cc: Changed header to GPL version 2 only sql/item.h: Changed header to GPL version 2 only sql/item_buff.cc: Changed header to GPL version 2 only sql/item_cmpfunc.cc: Changed header to GPL version 2 only sql/item_cmpfunc.h: Changed header to GPL version 2 only sql/item_create.cc: Changed header to GPL version 2 only sql/item_create.h: Changed header to GPL version 2 only sql/item_func.cc: Changed header to GPL version 2 only sql/item_func.h: Changed header to GPL version 2 only sql/item_geofunc.cc: Changed header to GPL version 2 only sql/item_geofunc.h: Changed header to GPL version 2 only sql/item_row.cc: Changed header to GPL version 2 only sql/item_row.h: Changed header to GPL version 2 only sql/item_strfunc.cc: Changed header to GPL version 2 only sql/item_strfunc.h: Changed header to GPL version 2 only sql/item_subselect.cc: Changed header to GPL version 2 only sql/item_subselect.h: Changed header to GPL version 2 only sql/item_sum.cc: Changed header to GPL version 2 only sql/item_sum.h: Changed header to GPL version 2 only sql/item_timefunc.cc: Changed header to GPL version 2 only sql/item_timefunc.h: Changed header to GPL version 2 only sql/item_uniq.cc: Changed header to GPL version 2 only sql/item_uniq.h: Changed header to GPL version 2 only sql/key.cc: Changed header to GPL version 2 only sql/lex.h: Changed header to GPL version 2 only sql/lex_symbol.h: Changed header to GPL version 2 only sql/lock.cc: Changed header to GPL version 2 only sql/log.cc: Changed header to GPL version 2 only sql/log_event.cc: Changed header to GPL version 2 only sql/log_event.h: Changed header to GPL version 2 only sql/matherr.c: Changed header to GPL version 2 only sql/mf_iocache.cc: Changed header to GPL version 2 only sql/my_decimal.cc: Changed header to GPL version 2 only sql/my_decimal.h: Changed header to GPL version 2 only sql/my_lock.c: Changed header to GPL version 2 only sql/mysql_priv.h: Changed header to GPL version 2 only sql/mysqld.cc: Changed header to GPL version 2 only sql/mysqld_suffix.h: Changed header to GPL version 2 only sql/net_serv.cc: Changed header to GPL version 2 only sql/opt_range.cc: Changed header to GPL version 2 only sql/opt_range.h: Changed header to GPL version 2 only sql/opt_sum.cc: Changed header to GPL version 2 only sql/parse_file.cc: Changed header to GPL version 2 only sql/parse_file.h: Changed header to GPL version 2 only sql/password.c: Changed header to GPL version 2 only sql/procedure.cc: Changed header to GPL version 2 only sql/procedure.h: Changed header to GPL version 2 only sql/protocol.cc: Changed header to GPL version 2 only sql/protocol.h: Changed header to GPL version 2 only sql/records.cc: Changed header to GPL version 2 only sql/repl_failsafe.cc: Changed header to GPL version 2 only sql/repl_failsafe.h: Changed header to GPL version 2 only sql/set_var.cc: Changed header to GPL version 2 only sql/set_var.h: Changed header to GPL version 2 only sql/slave.cc: Changed header to GPL version 2 only sql/slave.h: Changed header to GPL version 2 only sql/sp.cc: Changed header to GPL version 2 only sql/sp.h: Changed header to GPL version 2 only sql/sp_cache.cc: Changed header to GPL version 2 only sql/sp_cache.h: Changed header to GPL version 2 only sql/sp_head.cc: Changed header to GPL version 2 only sql/sp_head.h: Changed header to GPL version 2 only sql/sp_pcontext.cc: Changed header to GPL version 2 only sql/sp_pcontext.h: Changed header to GPL version 2 only sql/sp_rcontext.cc: Changed header to GPL version 2 only sql/sp_rcontext.h: Changed header to GPL version 2 only sql/spatial.cc: Changed header to GPL version 2 only sql/spatial.h: Changed header to GPL version 2 only sql/sql_acl.cc: Changed header to GPL version 2 only sql/sql_acl.h: Changed header to GPL version 2 only sql/sql_analyse.cc: Changed header to GPL version 2 only sql/sql_analyse.h: Changed header to GPL version 2 only sql/sql_array.h: Changed header to GPL version 2 only sql/sql_base.cc: Changed header to GPL version 2 only sql/sql_bitmap.h: Changed header to GPL version 2 only sql/sql_cache.cc: Changed header to GPL version 2 only sql/sql_cache.h: Changed header to GPL version 2 only sql/sql_class.cc: Changed header to GPL version 2 only sql/sql_class.h: Changed header to GPL version 2 only sql/sql_client.cc: Changed header to GPL version 2 only sql/sql_crypt.cc: Changed header to GPL version 2 only sql/sql_crypt.h: Changed header to GPL version 2 only sql/sql_cursor.cc: Changed header to GPL version 2 only sql/sql_cursor.h: Changed header to GPL version 2 only sql/sql_db.cc: Changed header to GPL version 2 only sql/sql_delete.cc: Changed header to GPL version 2 only sql/sql_derived.cc: Changed header to GPL version 2 only sql/sql_do.cc: Changed header to GPL version 2 only sql/sql_error.cc: Changed header to GPL version 2 only sql/sql_error.h: Changed header to GPL version 2 only sql/sql_handler.cc: Changed header to GPL version 2 only sql/sql_help.cc: Changed header to GPL version 2 only sql/sql_insert.cc: Changed header to GPL version 2 only sql/sql_lex.cc: Changed header to GPL version 2 only sql/sql_lex.h: Changed header to GPL version 2 only sql/sql_list.cc: Changed header to GPL version 2 only sql/sql_list.h: Changed header to GPL version 2 only sql/sql_load.cc: Changed header to GPL version 2 only sql/sql_locale.cc: Changed header to GPL version 2 only sql/sql_manager.cc: Changed header to GPL version 2 only sql/sql_manager.h: Changed header to GPL version 2 only sql/sql_map.cc: Changed header to GPL version 2 only sql/sql_map.h: Changed header to GPL version 2 only sql/sql_olap.cc: Changed header to GPL version 2 only sql/sql_parse.cc: Changed header to GPL version 2 only sql/sql_prepare.cc: Changed header to GPL version 2 only sql/sql_rename.cc: Changed header to GPL version 2 only sql/sql_repl.cc: Changed header to GPL version 2 only sql/sql_repl.h: Changed header to GPL version 2 only sql/sql_select.cc: Changed header to GPL version 2 only sql/sql_select.h: Changed header to GPL version 2 only sql/sql_show.cc: Changed header to GPL version 2 only sql/sql_sort.h: Changed header to GPL version 2 only sql/sql_state.c: Changed header to GPL version 2 only sql/sql_string.cc: Changed header to GPL version 2 only sql/sql_string.h: Changed header to GPL version 2 only sql/sql_table.cc: Changed header to GPL version 2 only sql/sql_test.cc: Changed header to GPL version 2 only sql/sql_trigger.cc: Changed header to GPL version 2 only sql/sql_trigger.h: Changed header to GPL version 2 only sql/sql_udf.cc: Changed header to GPL version 2 only sql/sql_udf.h: Changed header to GPL version 2 only sql/sql_union.cc: Changed header to GPL version 2 only sql/sql_update.cc: Changed header to GPL version 2 only sql-bench/Makefile.am: Changed header to GPL version 2 only sql-bench/as3ap.sh: Changed header to GPL version 2 only sql-bench/bench-count-distinct.sh: Changed header to GPL version 2 only sql-bench/bench-init.pl.sh: Changed header to GPL version 2 only sql-bench/compare-results.sh: Changed header to GPL version 2 only sql-bench/copy-db.sh: Changed header to GPL version 2 only sql-bench/crash-me.sh: Changed header to GPL version 2 only sql-bench/print-limit-table: Changed header to GPL version 2 only sql-bench/run-all-tests.sh: Changed header to GPL version 2 only sql/examples/ha_example.cc: Changed header to GPL version 2 only sql/examples/ha_example.h: Changed header to GPL version 2 only sql/examples/ha_tina.cc: Changed header to GPL version 2 only sql/examples/ha_tina.h: Changed header to GPL version 2 only sql/share/Makefile.am: Changed header to GPL version 2 only sql/share/charsets/Index.xml: Changed header to GPL version 2 only sql/share/charsets/armscii8.xml: Changed header to GPL version 2 only sql/share/charsets/ascii.xml: Changed header to GPL version 2 only sql/share/charsets/cp1250.xml: Changed header to GPL version 2 only sql/share/charsets/cp1251.xml: Changed header to GPL version 2 only sql/share/charsets/cp1256.xml: Changed header to GPL version 2 only sql/share/charsets/cp1257.xml: Changed header to GPL version 2 only sql/share/charsets/cp850.xml: Changed header to GPL version 2 only sql/share/charsets/cp852.xml: Changed header to GPL version 2 only sql/share/charsets/cp866.xml: Changed header to GPL version 2 only sql/share/charsets/dec8.xml: Changed header to GPL version 2 only sql/share/charsets/geostd8.xml: Changed header to GPL version 2 only sql/share/charsets/greek.xml: Changed header to GPL version 2 only sql/share/charsets/hebrew.xml: Changed header to GPL version 2 only sql/share/charsets/hp8.xml: Changed header to GPL version 2 only sql/share/charsets/keybcs2.xml: Changed header to GPL version 2 only sql/share/charsets/koi8r.xml: Changed header to GPL version 2 only sql/share/charsets/koi8u.xml: Changed header to GPL version 2 only sql/share/charsets/latin1.xml: Changed header to GPL version 2 only sql/share/charsets/latin2.xml: Changed header to GPL version 2 only sql/share/charsets/latin5.xml: Changed header to GPL version 2 only sql/share/charsets/latin7.xml: Changed header to GPL version 2 only sql/share/charsets/macce.xml: Changed header to GPL version 2 only sql/share/charsets/macroman.xml: Changed header to GPL version 2 only sql/share/charsets/swe7.xml: Changed header to GPL version 2 only sql/sql_view.cc: Changed header to GPL version 2 only sql/sql_view.h: Changed header to GPL version 2 only sql/sql_yacc.yy: Changed header to GPL version 2 only sql/stacktrace.c: Changed header to GPL version 2 only sql/stacktrace.h: Changed header to GPL version 2 only sql/strfunc.cc: Changed header to GPL version 2 only sql/structs.h: Changed header to GPL version 2 only sql/table.cc: Changed header to GPL version 2 only sql/table.h: Changed header to GPL version 2 only sql/thr_malloc.cc: Changed header to GPL version 2 only sql/time.cc: Changed header to GPL version 2 only sql/tzfile.h: Changed header to GPL version 2 only sql/tztime.cc: Changed header to GPL version 2 only sql/tztime.h: Changed header to GPL version 2 only sql/udf_example.c: Changed header to GPL version 2 only sql/uniques.cc: Changed header to GPL version 2 only sql/unireg.cc: Changed header to GPL version 2 only sql/unireg.h: Changed header to GPL version 2 only sql-bench/server-cfg.sh: Changed header to GPL version 2 only sql-bench/test-ATIS.sh: Changed header to GPL version 2 only sql-bench/test-alter-table.sh: Changed header to GPL version 2 only sql-bench/test-big-tables.sh: Changed header to GPL version 2 only sql-bench/test-connect.sh: Changed header to GPL version 2 only sql-bench/test-create.sh: Changed header to GPL version 2 only sql-bench/test-insert.sh: Changed header to GPL version 2 only sql-bench/test-select.sh: Changed header to GPL version 2 only sql-bench/test-transactions.sh: Changed header to GPL version 2 only sql-bench/test-wisconsin.sh: Changed header to GPL version 2 only sql-common/Makefile.am: Changed header to GPL version 2 only sql-common/client.c: Changed header to GPL version 2 only sql-common/my_time.c: Changed header to GPL version 2 only sql-common/my_user.c: Changed header to GPL version 2 only sql-common/pack.c: Changed header to GPL version 2 only strings/Makefile.am: Changed header to GPL version 2 only strings/bchange.c: Changed header to GPL version 2 only strings/bcmp.c: Changed header to GPL version 2 only strings/bcopy-duff.c: Changed header to GPL version 2 only strings/bfill.c: Changed header to GPL version 2 only strings/bmove.c: Changed header to GPL version 2 only strings/bmove512.c: Changed header to GPL version 2 only strings/bmove_upp-sparc.s: Changed header to GPL version 2 only strings/bmove_upp.c: Changed header to GPL version 2 only strings/bzero.c: Changed header to GPL version 2 only strings/conf_to_src.c: Changed header to GPL version 2 only strings/ctype-big5.c: Changed header to GPL version 2 only strings/ctype-bin.c: Changed header to GPL version 2 only strings/ctype-cp932.c: Changed header to GPL version 2 only strings/ctype-czech.c: Changed header to GPL version 2 only strings/ctype-euc_kr.c: Changed header to GPL version 2 only strings/ctype-eucjpms.c: Changed header to GPL version 2 only strings/ctype-gb2312.c: Changed header to GPL version 2 only strings/ctype-gbk.c: Changed header to GPL version 2 only strings/ctype-latin1.c: Changed header to GPL version 2 only strings/ctype-mb.c: Changed header to GPL version 2 only strings/ctype-simple.c: Changed header to GPL version 2 only strings/ctype-sjis.c: Changed header to GPL version 2 only strings/ctype-tis620.c: Changed header to GPL version 2 only strings/ctype-uca.c: Changed header to GPL version 2 only strings/ctype-ucs2.c: Changed header to GPL version 2 only strings/ctype-ujis.c: Changed header to GPL version 2 only strings/ctype-utf8.c: Changed header to GPL version 2 only strings/ctype-win1250ch.c: Changed header to GPL version 2 only strings/ctype.c: Changed header to GPL version 2 only strings/decimal.c: Changed header to GPL version 2 only strings/do_ctype.c: Changed header to GPL version 2 only strings/int2str.c: Changed header to GPL version 2 only strings/is_prefix.c: Changed header to GPL version 2 only strings/llstr.c: Changed header to GPL version 2 only strings/longlong2str-x86.s: Changed header to GPL version 2 only strings/longlong2str.c: Changed header to GPL version 2 only strings/longlong2str_asm.c: Changed header to GPL version 2 only strings/macros.asm: Changed header to GPL version 2 only strings/memcmp.c: Changed header to GPL version 2 only strings/memcpy.c: Changed header to GPL version 2 only strings/memset.c: Changed header to GPL version 2 only strings/my_strtoll10-x86.s: Changed header to GPL version 2 only strings/my_strtoll10.c: Changed header to GPL version 2 only strings/my_vsnprintf.c: Changed header to GPL version 2 only strings/ptr_cmp.asm: Changed header to GPL version 2 only strings/r_strinstr.c: Changed header to GPL version 2 only strings/str2int.c: Changed header to GPL version 2 only strings/str_alloc.c: Changed header to GPL version 2 only strings/str_test.c: Changed header to GPL version 2 only strings/strappend-sparc.s: Changed header to GPL version 2 only strings/strappend.c: Changed header to GPL version 2 only strings/strcat.c: Changed header to GPL version 2 only strings/strcend.c: Changed header to GPL version 2 only strings/strchr.c: Changed header to GPL version 2 only strings/strcmp.c: Changed header to GPL version 2 only strings/strcont.c: Changed header to GPL version 2 only strings/strend-sparc.s: Changed header to GPL version 2 only strings/strend.c: Changed header to GPL version 2 only strings/strfill.c: Changed header to GPL version 2 only strings/strings-not-used.h: Changed header to GPL version 2 only strings/strings-x86.s: Changed header to GPL version 2 only strings/strings.asm: Changed header to GPL version 2 only strings/strinstr-sparc.s: Changed header to GPL version 2 only strings/strinstr.c: Changed header to GPL version 2 only strings/strlen.c: Changed header to GPL version 2 only strings/strmake-sparc.s: Changed header to GPL version 2 only strings/strmake.c: Changed header to GPL version 2 only strings/strmov-sparc.s: Changed header to GPL version 2 only strings/strmov.c: Changed header to GPL version 2 only strings/strnlen.c: Changed header to GPL version 2 only strings/strnmov-sparc.s: Changed header to GPL version 2 only strings/strnmov.c: Changed header to GPL version 2 only strings/strrchr.c: Changed header to GPL version 2 only strings/strstr-sparc.s: Changed header to GPL version 2 only strings/strstr.c: Changed header to GPL version 2 only strings/strto.c: Changed header to GPL version 2 only strings/strtol.c: Changed header to GPL version 2 only strings/strtoll.c: Changed header to GPL version 2 only strings/strtoul.c: Changed header to GPL version 2 only strings/strtoull.c: Changed header to GPL version 2 only strings/strxmov-sparc.s: Changed header to GPL version 2 only strings/strxmov.asm: Changed header to GPL version 2 only strings/strxmov.c: Changed header to GPL version 2 only strings/strxnmov.c: Changed header to GPL version 2 only strings/t_ctype.h: Changed header to GPL version 2 only strings/udiv.c: Changed header to GPL version 2 only strings/xml.c: Changed header to GPL version 2 only support-files/MacOSX/Makefile.am: Changed header to GPL version 2 only support-files/Makefile.am: Changed header to GPL version 2 only support-files/MySQL-shared-compat.spec.sh: Changed header to GPL version 2 only tests/Makefile.am: Changed header to GPL version 2 only tests/connect_test.c: Changed header to GPL version 2 only tests/deadlock_test.c: Changed header to GPL version 2 only tests/insert_test.c: Changed header to GPL version 2 only tests/list_test.c: Changed header to GPL version 2 only tests/mysql_client_test.c: Changed header to GPL version 2 only tests/select_test.c: Changed header to GPL version 2 only tests/showdb_test.c: Changed header to GPL version 2 only tests/ssl_test.c: Changed header to GPL version 2 only tests/thread_test.c: Changed header to GPL version 2 only tools/Makefile.am: Changed header to GPL version 2 only tools/mysqlmanager.c: Changed header to GPL version 2 only vio/Makefile.am: Changed header to GPL version 2 only vio/test-ssl.c: Changed header to GPL version 2 only vio/test-sslclient.c: Changed header to GPL version 2 only vio/test-sslserver.c: Changed header to GPL version 2 only vio/vio.c: Changed header to GPL version 2 only vio/vio_priv.h: Changed header to GPL version 2 only vio/viosocket.c: Changed header to GPL version 2 only vio/viossl.c: Changed header to GPL version 2 only vio/viosslfactories.c: Changed header to GPL version 2 only vio/viotest-ssl.c: Changed header to GPL version 2 only win/Makefile.am: Changed header to GPL version 2 only zlib/Makefile.am: Changed header to GPL version 2 only
2854 lines
89 KiB
C
2854 lines
89 KiB
C
/* Copyright (C) 2000 MySQL AB
|
|
|
|
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
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
/*
|
|
These functions handle keyblock cacheing for ISAM and MyISAM tables.
|
|
|
|
One cache can handle many files.
|
|
It must contain buffers of the same blocksize.
|
|
init_key_cache() should be used to init cache handler.
|
|
|
|
The free list (free_block_list) is a stack like structure.
|
|
When a block is freed by free_block(), it is pushed onto the stack.
|
|
When a new block is required it is first tried to pop one from the stack.
|
|
If the stack is empty, it is tried to get a never-used block from the pool.
|
|
If this is empty too, then a block is taken from the LRU ring, flushing it
|
|
to disk, if neccessary. This is handled in find_key_block().
|
|
With the new free list, the blocks can have three temperatures:
|
|
hot, warm and cold (which is free). This is remembered in the block header
|
|
by the enum BLOCK_TEMPERATURE temperature variable. Remembering the
|
|
temperature is neccessary to correctly count the number of warm blocks,
|
|
which is required to decide when blocks are allowed to become hot. Whenever
|
|
a block is inserted to another (sub-)chain, we take the old and new
|
|
temperature into account to decide if we got one more or less warm block.
|
|
blocks_unused is the sum of never used blocks in the pool and of currently
|
|
free blocks. blocks_used is the number of blocks fetched from the pool and
|
|
as such gives the maximum number of in-use blocks at any time.
|
|
*/
|
|
|
|
#include "mysys_priv.h"
|
|
#include <keycache.h>
|
|
#include "my_static.h"
|
|
#include <m_string.h>
|
|
#include <errno.h>
|
|
#include <stdarg.h>
|
|
|
|
/*
|
|
Some compilation flags have been added specifically for this module
|
|
to control the following:
|
|
- not to let a thread to yield the control when reading directly
|
|
from key cache, which might improve performance in many cases;
|
|
to enable this add:
|
|
#define SERIALIZED_READ_FROM_CACHE
|
|
- to set an upper bound for number of threads simultaneously
|
|
using the key cache; this setting helps to determine an optimal
|
|
size for hash table and improve performance when the number of
|
|
blocks in the key cache much less than the number of threads
|
|
accessing it;
|
|
to set this number equal to <N> add
|
|
#define MAX_THREADS <N>
|
|
- to substitute calls of pthread_cond_wait for calls of
|
|
pthread_cond_timedwait (wait with timeout set up);
|
|
this setting should be used only when you want to trap a deadlock
|
|
situation, which theoretically should not happen;
|
|
to set timeout equal to <T> seconds add
|
|
#define KEYCACHE_TIMEOUT <T>
|
|
- to enable the module traps and to send debug information from
|
|
key cache module to a special debug log add:
|
|
#define KEYCACHE_DEBUG
|
|
the name of this debug log file <LOG NAME> can be set through:
|
|
#define KEYCACHE_DEBUG_LOG <LOG NAME>
|
|
if the name is not defined, it's set by default;
|
|
if the KEYCACHE_DEBUG flag is not set up and we are in a debug
|
|
mode, i.e. when ! defined(DBUG_OFF), the debug information from the
|
|
module is sent to the regular debug log.
|
|
|
|
Example of the settings:
|
|
#define SERIALIZED_READ_FROM_CACHE
|
|
#define MAX_THREADS 100
|
|
#define KEYCACHE_TIMEOUT 1
|
|
#define KEYCACHE_DEBUG
|
|
#define KEYCACHE_DEBUG_LOG "my_key_cache_debug.log"
|
|
*/
|
|
|
|
#if defined(MSDOS) && !defined(M_IC80386)
|
|
/* we nead much memory */
|
|
#undef my_malloc_lock
|
|
#undef my_free_lock
|
|
#define my_malloc_lock(A,B) halloc((long) (A/IO_SIZE),IO_SIZE)
|
|
#define my_free_lock(A,B) hfree(A)
|
|
#endif /* defined(MSDOS) && !defined(M_IC80386) */
|
|
|
|
#define STRUCT_PTR(TYPE, MEMBER, a) \
|
|
(TYPE *) ((char *) (a) - offsetof(TYPE, MEMBER))
|
|
|
|
/* types of condition variables */
|
|
#define COND_FOR_REQUESTED 0
|
|
#define COND_FOR_SAVED 1
|
|
#define COND_FOR_READERS 2
|
|
|
|
typedef pthread_cond_t KEYCACHE_CONDVAR;
|
|
|
|
/* descriptor of the page in the key cache block buffer */
|
|
struct st_keycache_page
|
|
{
|
|
int file; /* file to which the page belongs to */
|
|
my_off_t filepos; /* position of the page in the file */
|
|
};
|
|
|
|
/* element in the chain of a hash table bucket */
|
|
struct st_hash_link
|
|
{
|
|
struct st_hash_link *next, **prev; /* to connect links in the same bucket */
|
|
struct st_block_link *block; /* reference to the block for the page: */
|
|
File file; /* from such a file */
|
|
my_off_t diskpos; /* with such an offset */
|
|
uint requests; /* number of requests for the page */
|
|
};
|
|
|
|
/* simple states of a block */
|
|
#define BLOCK_ERROR 1 /* an error occured when performing disk i/o */
|
|
#define BLOCK_READ 2 /* the is page in the block buffer */
|
|
#define BLOCK_IN_SWITCH 4 /* block is preparing to read new page */
|
|
#define BLOCK_REASSIGNED 8 /* block does not accept requests for old page */
|
|
#define BLOCK_IN_FLUSH 16 /* block is in flush operation */
|
|
#define BLOCK_CHANGED 32 /* block buffer contains a dirty page */
|
|
|
|
/* page status, returned by find_key_block */
|
|
#define PAGE_READ 0
|
|
#define PAGE_TO_BE_READ 1
|
|
#define PAGE_WAIT_TO_BE_READ 2
|
|
|
|
/* block temperature determines in which (sub-)chain the block currently is */
|
|
enum BLOCK_TEMPERATURE { BLOCK_COLD /*free*/ , BLOCK_WARM , BLOCK_HOT };
|
|
|
|
/* key cache block */
|
|
struct st_block_link
|
|
{
|
|
struct st_block_link
|
|
*next_used, **prev_used; /* to connect links in the LRU chain (ring) */
|
|
struct st_block_link
|
|
*next_changed, **prev_changed; /* for lists of file dirty/clean blocks */
|
|
struct st_hash_link *hash_link; /* backward ptr to referring hash_link */
|
|
KEYCACHE_WQUEUE wqueue[2]; /* queues on waiting requests for new/old pages */
|
|
uint requests; /* number of requests for the block */
|
|
byte *buffer; /* buffer for the block page */
|
|
uint offset; /* beginning of modified data in the buffer */
|
|
uint length; /* end of data in the buffer */
|
|
uint status; /* state of the block */
|
|
enum BLOCK_TEMPERATURE temperature; /* block temperature: cold, warm, hot */
|
|
uint hits_left; /* number of hits left until promotion */
|
|
ulonglong last_hit_time; /* timestamp of the last hit */
|
|
KEYCACHE_CONDVAR *condvar; /* condition variable for 'no readers' event */
|
|
};
|
|
|
|
KEY_CACHE dflt_key_cache_var;
|
|
KEY_CACHE *dflt_key_cache= &dflt_key_cache_var;
|
|
|
|
#define FLUSH_CACHE 2000 /* sort this many blocks at once */
|
|
|
|
static int flush_all_key_blocks(KEY_CACHE *keycache);
|
|
#ifdef THREAD
|
|
static void link_into_queue(KEYCACHE_WQUEUE *wqueue,
|
|
struct st_my_thread_var *thread);
|
|
static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
|
|
struct st_my_thread_var *thread);
|
|
#endif
|
|
static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block);
|
|
static void test_key_cache(KEY_CACHE *keycache,
|
|
const char *where, my_bool lock);
|
|
|
|
#define KEYCACHE_HASH(f, pos) \
|
|
(((ulong) ((pos) >> keycache->key_cache_shift)+ \
|
|
(ulong) (f)) & (keycache->hash_entries-1))
|
|
#define FILE_HASH(f) ((uint) (f) & (CHANGED_BLOCKS_HASH-1))
|
|
|
|
#define DEFAULT_KEYCACHE_DEBUG_LOG "keycache_debug.log"
|
|
|
|
#if defined(KEYCACHE_DEBUG) && ! defined(KEYCACHE_DEBUG_LOG)
|
|
#define KEYCACHE_DEBUG_LOG DEFAULT_KEYCACHE_DEBUG_LOG
|
|
#endif
|
|
|
|
#if defined(KEYCACHE_DEBUG_LOG)
|
|
static FILE *keycache_debug_log=NULL;
|
|
static void keycache_debug_print _VARARGS((const char *fmt,...));
|
|
#define KEYCACHE_DEBUG_OPEN \
|
|
if (!keycache_debug_log) \
|
|
{ \
|
|
keycache_debug_log= fopen(KEYCACHE_DEBUG_LOG, "w"); \
|
|
(void) setvbuf(keycache_debug_log, NULL, _IOLBF, BUFSIZ); \
|
|
}
|
|
|
|
#define KEYCACHE_DEBUG_CLOSE \
|
|
if (keycache_debug_log) \
|
|
{ \
|
|
fclose(keycache_debug_log); \
|
|
keycache_debug_log= 0; \
|
|
}
|
|
#else
|
|
#define KEYCACHE_DEBUG_OPEN
|
|
#define KEYCACHE_DEBUG_CLOSE
|
|
#endif /* defined(KEYCACHE_DEBUG_LOG) */
|
|
|
|
#if defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG)
|
|
#define KEYCACHE_DBUG_PRINT(l, m) \
|
|
{ if (keycache_debug_log) fprintf(keycache_debug_log, "%s: ", l); \
|
|
keycache_debug_print m; }
|
|
|
|
#define KEYCACHE_DBUG_ASSERT(a) \
|
|
{ if (! (a) && keycache_debug_log) fclose(keycache_debug_log); \
|
|
assert(a); }
|
|
#else
|
|
#define KEYCACHE_DBUG_PRINT(l, m) DBUG_PRINT(l, m)
|
|
#define KEYCACHE_DBUG_ASSERT(a) DBUG_ASSERT(a)
|
|
#endif /* defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) */
|
|
|
|
#if defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF)
|
|
#ifdef THREAD
|
|
static long keycache_thread_id;
|
|
#define KEYCACHE_THREAD_TRACE(l) \
|
|
KEYCACHE_DBUG_PRINT(l,("|thread %ld",keycache_thread_id))
|
|
|
|
#define KEYCACHE_THREAD_TRACE_BEGIN(l) \
|
|
{ struct st_my_thread_var *thread_var= my_thread_var; \
|
|
keycache_thread_id= thread_var->id; \
|
|
KEYCACHE_DBUG_PRINT(l,("[thread %ld",keycache_thread_id)) }
|
|
|
|
#define KEYCACHE_THREAD_TRACE_END(l) \
|
|
KEYCACHE_DBUG_PRINT(l,("]thread %ld",keycache_thread_id))
|
|
#else /* THREAD */
|
|
#define KEYCACHE_THREAD_TRACE(l) KEYCACHE_DBUG_PRINT(l,(""))
|
|
#define KEYCACHE_THREAD_TRACE_BEGIN(l) KEYCACHE_DBUG_PRINT(l,(""))
|
|
#define KEYCACHE_THREAD_TRACE_END(l) KEYCACHE_DBUG_PRINT(l,(""))
|
|
#endif /* THREAD */
|
|
#else
|
|
#define KEYCACHE_THREAD_TRACE_BEGIN(l)
|
|
#define KEYCACHE_THREAD_TRACE_END(l)
|
|
#define KEYCACHE_THREAD_TRACE(l)
|
|
#endif /* defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF) */
|
|
|
|
#define BLOCK_NUMBER(b) \
|
|
((uint) (((char*)(b)-(char *) keycache->block_root)/sizeof(BLOCK_LINK)))
|
|
#define HASH_LINK_NUMBER(h) \
|
|
((uint) (((char*)(h)-(char *) keycache->hash_link_root)/sizeof(HASH_LINK)))
|
|
|
|
#if (defined(KEYCACHE_TIMEOUT) && !defined(__WIN__)) || defined(KEYCACHE_DEBUG)
|
|
static int keycache_pthread_cond_wait(pthread_cond_t *cond,
|
|
pthread_mutex_t *mutex);
|
|
#else
|
|
#define keycache_pthread_cond_wait pthread_cond_wait
|
|
#endif
|
|
|
|
#if defined(KEYCACHE_DEBUG)
|
|
static int keycache_pthread_mutex_lock(pthread_mutex_t *mutex);
|
|
static void keycache_pthread_mutex_unlock(pthread_mutex_t *mutex);
|
|
static int keycache_pthread_cond_signal(pthread_cond_t *cond);
|
|
#else
|
|
#define keycache_pthread_mutex_lock pthread_mutex_lock
|
|
#define keycache_pthread_mutex_unlock pthread_mutex_unlock
|
|
#define keycache_pthread_cond_signal pthread_cond_signal
|
|
#endif /* defined(KEYCACHE_DEBUG) */
|
|
|
|
static uint next_power(uint value)
|
|
{
|
|
uint old_value= 1;
|
|
while (value)
|
|
{
|
|
old_value= value;
|
|
value&= value-1;
|
|
}
|
|
return (old_value << 1);
|
|
}
|
|
|
|
|
|
/*
|
|
Initialize a key cache
|
|
|
|
SYNOPSIS
|
|
init_key_cache()
|
|
keycache pointer to a key cache data structure
|
|
key_cache_block_size size of blocks to keep cached data
|
|
use_mem total memory to use for the key cache
|
|
division_limit division limit (may be zero)
|
|
age_threshold age threshold (may be zero)
|
|
|
|
RETURN VALUE
|
|
number of blocks in the key cache, if successful,
|
|
0 - otherwise.
|
|
|
|
NOTES.
|
|
if keycache->key_cache_inited != 0 we assume that the key cache
|
|
is already initialized. This is for now used by myisamchk, but shouldn't
|
|
be something that a program should rely on!
|
|
|
|
It's assumed that no two threads call this function simultaneously
|
|
referring to the same key cache handle.
|
|
|
|
*/
|
|
|
|
int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|
ulong use_mem, uint division_limit,
|
|
uint age_threshold)
|
|
{
|
|
uint blocks, hash_links, length;
|
|
int error;
|
|
DBUG_ENTER("init_key_cache");
|
|
DBUG_ASSERT(key_cache_block_size >= 512);
|
|
|
|
KEYCACHE_DEBUG_OPEN;
|
|
if (keycache->key_cache_inited && keycache->disk_blocks > 0)
|
|
{
|
|
DBUG_PRINT("warning",("key cache already in use"));
|
|
DBUG_RETURN(0);
|
|
}
|
|
|
|
keycache->global_cache_w_requests= keycache->global_cache_r_requests= 0;
|
|
keycache->global_cache_read= keycache->global_cache_write= 0;
|
|
keycache->disk_blocks= -1;
|
|
if (! keycache->key_cache_inited)
|
|
{
|
|
keycache->key_cache_inited= 1;
|
|
keycache->in_init= 0;
|
|
pthread_mutex_init(&keycache->cache_lock, MY_MUTEX_INIT_FAST);
|
|
keycache->resize_queue.last_thread= NULL;
|
|
}
|
|
|
|
keycache->key_cache_mem_size= use_mem;
|
|
keycache->key_cache_block_size= key_cache_block_size;
|
|
keycache->key_cache_shift= my_bit_log2(key_cache_block_size);
|
|
DBUG_PRINT("info", ("key_cache_block_size: %u",
|
|
key_cache_block_size));
|
|
|
|
blocks= (uint) (use_mem / (sizeof(BLOCK_LINK) + 2 * sizeof(HASH_LINK) +
|
|
sizeof(HASH_LINK*) * 5/4 + key_cache_block_size));
|
|
/* It doesn't make sense to have too few blocks (less than 8) */
|
|
if (blocks >= 8 && keycache->disk_blocks < 0)
|
|
{
|
|
for ( ; ; )
|
|
{
|
|
/* Set my_hash_entries to the next bigger 2 power */
|
|
if ((keycache->hash_entries= next_power(blocks)) < blocks * 5/4)
|
|
keycache->hash_entries<<= 1;
|
|
hash_links= 2 * blocks;
|
|
#if defined(MAX_THREADS)
|
|
if (hash_links < MAX_THREADS + blocks - 1)
|
|
hash_links= MAX_THREADS + blocks - 1;
|
|
#endif
|
|
while ((length= (ALIGN_SIZE(blocks * sizeof(BLOCK_LINK)) +
|
|
ALIGN_SIZE(hash_links * sizeof(HASH_LINK)) +
|
|
ALIGN_SIZE(sizeof(HASH_LINK*) *
|
|
keycache->hash_entries))) +
|
|
((ulong) blocks << keycache->key_cache_shift) > use_mem)
|
|
blocks--;
|
|
/* Allocate memory for cache page buffers */
|
|
if ((keycache->block_mem=
|
|
my_large_malloc((ulong) blocks * keycache->key_cache_block_size,
|
|
MYF(MY_WME))))
|
|
{
|
|
/*
|
|
Allocate memory for blocks, hash_links and hash entries;
|
|
For each block 2 hash links are allocated
|
|
*/
|
|
if ((keycache->block_root= (BLOCK_LINK*) my_malloc((uint) length,
|
|
MYF(0))))
|
|
break;
|
|
my_large_free(keycache->block_mem, MYF(0));
|
|
keycache->block_mem= 0;
|
|
}
|
|
if (blocks < 8)
|
|
{
|
|
my_errno= ENOMEM;
|
|
goto err;
|
|
}
|
|
blocks= blocks / 4*3;
|
|
}
|
|
keycache->blocks_unused= (ulong) blocks;
|
|
keycache->disk_blocks= (int) blocks;
|
|
keycache->hash_links= hash_links;
|
|
keycache->hash_root= (HASH_LINK**) ((char*) keycache->block_root +
|
|
ALIGN_SIZE(blocks*sizeof(BLOCK_LINK)));
|
|
keycache->hash_link_root= (HASH_LINK*) ((char*) keycache->hash_root +
|
|
ALIGN_SIZE((sizeof(HASH_LINK*) *
|
|
keycache->hash_entries)));
|
|
bzero((byte*) keycache->block_root,
|
|
keycache->disk_blocks * sizeof(BLOCK_LINK));
|
|
bzero((byte*) keycache->hash_root,
|
|
keycache->hash_entries * sizeof(HASH_LINK*));
|
|
bzero((byte*) keycache->hash_link_root,
|
|
keycache->hash_links * sizeof(HASH_LINK));
|
|
keycache->hash_links_used= 0;
|
|
keycache->free_hash_list= NULL;
|
|
keycache->blocks_used= keycache->blocks_changed= 0;
|
|
|
|
keycache->global_blocks_changed= 0;
|
|
keycache->blocks_available=0; /* For debugging */
|
|
|
|
/* The LRU chain is empty after initialization */
|
|
keycache->used_last= NULL;
|
|
keycache->used_ins= NULL;
|
|
keycache->free_block_list= NULL;
|
|
keycache->keycache_time= 0;
|
|
keycache->warm_blocks= 0;
|
|
keycache->min_warm_blocks= (division_limit ?
|
|
blocks * division_limit / 100 + 1 :
|
|
blocks);
|
|
keycache->age_threshold= (age_threshold ?
|
|
blocks * age_threshold / 100 :
|
|
blocks);
|
|
|
|
keycache->cnt_for_resize_op= 0;
|
|
keycache->resize_in_flush= 0;
|
|
keycache->can_be_used= 1;
|
|
|
|
keycache->waiting_for_hash_link.last_thread= NULL;
|
|
keycache->waiting_for_block.last_thread= NULL;
|
|
DBUG_PRINT("exit",
|
|
("disk_blocks: %d block_root: 0x%lx hash_entries: %d\
|
|
hash_root: 0x%lx hash_links: %d hash_link_root: 0x%lx",
|
|
keycache->disk_blocks, (long) keycache->block_root,
|
|
keycache->hash_entries, (long) keycache->hash_root,
|
|
keycache->hash_links, (long) keycache->hash_link_root));
|
|
bzero((gptr) keycache->changed_blocks,
|
|
sizeof(keycache->changed_blocks[0]) * CHANGED_BLOCKS_HASH);
|
|
bzero((gptr) keycache->file_blocks,
|
|
sizeof(keycache->file_blocks[0]) * CHANGED_BLOCKS_HASH);
|
|
}
|
|
|
|
keycache->blocks= keycache->disk_blocks > 0 ? keycache->disk_blocks : 0;
|
|
DBUG_RETURN((int) keycache->disk_blocks);
|
|
|
|
err:
|
|
error= my_errno;
|
|
keycache->disk_blocks= 0;
|
|
keycache->blocks= 0;
|
|
if (keycache->block_mem)
|
|
{
|
|
my_large_free((gptr) keycache->block_mem, MYF(0));
|
|
keycache->block_mem= NULL;
|
|
}
|
|
if (keycache->block_root)
|
|
{
|
|
my_free((gptr) keycache->block_root, MYF(0));
|
|
keycache->block_root= NULL;
|
|
}
|
|
my_errno= error;
|
|
keycache->can_be_used= 0;
|
|
DBUG_RETURN(0);
|
|
}
|
|
|
|
|
|
/*
|
|
Resize a key cache
|
|
|
|
SYNOPSIS
|
|
resize_key_cache()
|
|
keycache pointer to a key cache data structure
|
|
key_cache_block_size size of blocks to keep cached data
|
|
use_mem total memory to use for the new key cache
|
|
division_limit new division limit (if not zero)
|
|
age_threshold new age threshold (if not zero)
|
|
|
|
RETURN VALUE
|
|
number of blocks in the key cache, if successful,
|
|
0 - otherwise.
|
|
|
|
NOTES.
|
|
The function first compares the memory size and the block size parameters
|
|
with the key cache values.
|
|
|
|
If they differ the function free the the memory allocated for the
|
|
old key cache blocks by calling the end_key_cache function and
|
|
then rebuilds the key cache with new blocks by calling
|
|
init_key_cache.
|
|
|
|
The function starts the operation only when all other threads
|
|
performing operations with the key cache let her to proceed
|
|
(when cnt_for_resize=0).
|
|
*/
|
|
|
|
int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|
ulong use_mem, uint division_limit,
|
|
uint age_threshold)
|
|
{
|
|
int blocks;
|
|
struct st_my_thread_var *thread;
|
|
KEYCACHE_WQUEUE *wqueue;
|
|
DBUG_ENTER("resize_key_cache");
|
|
|
|
if (!keycache->key_cache_inited)
|
|
DBUG_RETURN(keycache->disk_blocks);
|
|
|
|
if(key_cache_block_size == keycache->key_cache_block_size &&
|
|
use_mem == keycache->key_cache_mem_size)
|
|
{
|
|
change_key_cache_param(keycache, division_limit, age_threshold);
|
|
DBUG_RETURN(keycache->disk_blocks);
|
|
}
|
|
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
|
|
#ifdef THREAD
|
|
wqueue= &keycache->resize_queue;
|
|
thread= my_thread_var;
|
|
link_into_queue(wqueue, thread);
|
|
|
|
while (wqueue->last_thread->next != thread)
|
|
{
|
|
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
|
}
|
|
#endif
|
|
|
|
keycache->resize_in_flush= 1;
|
|
if (flush_all_key_blocks(keycache))
|
|
{
|
|
/* TODO: if this happens, we should write a warning in the log file ! */
|
|
keycache->resize_in_flush= 0;
|
|
blocks= 0;
|
|
keycache->can_be_used= 0;
|
|
goto finish;
|
|
}
|
|
keycache->resize_in_flush= 0;
|
|
keycache->can_be_used= 0;
|
|
#ifdef THREAD
|
|
while (keycache->cnt_for_resize_op)
|
|
{
|
|
KEYCACHE_DBUG_PRINT("resize_key_cache: wait",
|
|
("suspend thread %ld", thread->id));
|
|
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
|
}
|
|
#else
|
|
KEYCACHE_DBUG_ASSERT(keycache->cnt_for_resize_op == 0);
|
|
#endif
|
|
|
|
end_key_cache(keycache, 0); /* Don't free mutex */
|
|
/* The following will work even if use_mem is 0 */
|
|
blocks= init_key_cache(keycache, key_cache_block_size, use_mem,
|
|
division_limit, age_threshold);
|
|
|
|
finish:
|
|
#ifdef THREAD
|
|
unlink_from_queue(wqueue, thread);
|
|
/* Signal for the next resize request to proceeed if any */
|
|
if (wqueue->last_thread)
|
|
{
|
|
KEYCACHE_DBUG_PRINT("resize_key_cache: signal",
|
|
("thread %ld", wqueue->last_thread->next->id));
|
|
keycache_pthread_cond_signal(&wqueue->last_thread->next->suspend);
|
|
}
|
|
#endif
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
return blocks;
|
|
}
|
|
|
|
|
|
/*
|
|
Increment counter blocking resize key cache operation
|
|
*/
|
|
static inline void inc_counter_for_resize_op(KEY_CACHE *keycache)
|
|
{
|
|
keycache->cnt_for_resize_op++;
|
|
}
|
|
|
|
|
|
/*
|
|
Decrement counter blocking resize key cache operation;
|
|
Signal the operation to proceed when counter becomes equal zero
|
|
*/
|
|
static inline void dec_counter_for_resize_op(KEY_CACHE *keycache)
|
|
{
|
|
#ifdef THREAD
|
|
struct st_my_thread_var *last_thread;
|
|
if (!--keycache->cnt_for_resize_op &&
|
|
(last_thread= keycache->resize_queue.last_thread))
|
|
{
|
|
KEYCACHE_DBUG_PRINT("dec_counter_for_resize_op: signal",
|
|
("thread %ld", last_thread->next->id));
|
|
keycache_pthread_cond_signal(&last_thread->next->suspend);
|
|
}
|
|
#else
|
|
keycache->cnt_for_resize_op--;
|
|
#endif
|
|
}
|
|
|
|
/*
|
|
Change the key cache parameters
|
|
|
|
SYNOPSIS
|
|
change_key_cache_param()
|
|
keycache pointer to a key cache data structure
|
|
division_limit new division limit (if not zero)
|
|
age_threshold new age threshold (if not zero)
|
|
|
|
RETURN VALUE
|
|
none
|
|
|
|
NOTES.
|
|
Presently the function resets the key cache parameters
|
|
concerning midpoint insertion strategy - division_limit and
|
|
age_threshold.
|
|
*/
|
|
|
|
void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
|
|
uint age_threshold)
|
|
{
|
|
DBUG_ENTER("change_key_cache_param");
|
|
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
if (division_limit)
|
|
keycache->min_warm_blocks= (keycache->disk_blocks *
|
|
division_limit / 100 + 1);
|
|
if (age_threshold)
|
|
keycache->age_threshold= (keycache->disk_blocks *
|
|
age_threshold / 100);
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
DBUG_VOID_RETURN;
|
|
}
|
|
|
|
|
|
/*
|
|
Remove key_cache from memory
|
|
|
|
SYNOPSIS
|
|
end_key_cache()
|
|
keycache key cache handle
|
|
cleanup Complete free (Free also mutex for key cache)
|
|
|
|
RETURN VALUE
|
|
none
|
|
*/
|
|
|
|
void end_key_cache(KEY_CACHE *keycache, my_bool cleanup)
|
|
{
|
|
DBUG_ENTER("end_key_cache");
|
|
DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache));
|
|
|
|
if (!keycache->key_cache_inited)
|
|
DBUG_VOID_RETURN;
|
|
|
|
if (keycache->disk_blocks > 0)
|
|
{
|
|
if (keycache->block_mem)
|
|
{
|
|
my_large_free((gptr) keycache->block_mem, MYF(0));
|
|
keycache->block_mem= NULL;
|
|
my_free((gptr) keycache->block_root, MYF(0));
|
|
keycache->block_root= NULL;
|
|
}
|
|
keycache->disk_blocks= -1;
|
|
/* Reset blocks_changed to be safe if flush_all_key_blocks is called */
|
|
keycache->blocks_changed= 0;
|
|
}
|
|
|
|
DBUG_PRINT("status", ("used: %lu changed: %lu w_requests: %lu "
|
|
"writes: %lu r_requests: %lu reads: %lu",
|
|
keycache->blocks_used, keycache->global_blocks_changed,
|
|
(ulong) keycache->global_cache_w_requests,
|
|
(ulong) keycache->global_cache_write,
|
|
(ulong) keycache->global_cache_r_requests,
|
|
(ulong) keycache->global_cache_read));
|
|
|
|
if (cleanup)
|
|
{
|
|
pthread_mutex_destroy(&keycache->cache_lock);
|
|
keycache->key_cache_inited= keycache->can_be_used= 0;
|
|
KEYCACHE_DEBUG_CLOSE;
|
|
}
|
|
DBUG_VOID_RETURN;
|
|
} /* end_key_cache */
|
|
|
|
|
|
#ifdef THREAD
|
|
/*
|
|
Link a thread into double-linked queue of waiting threads.
|
|
|
|
SYNOPSIS
|
|
link_into_queue()
|
|
wqueue pointer to the queue structure
|
|
thread pointer to the thread to be added to the queue
|
|
|
|
RETURN VALUE
|
|
none
|
|
|
|
NOTES.
|
|
Queue is represented by a circular list of the thread structures
|
|
The list is double-linked of the type (**prev,*next), accessed by
|
|
a pointer to the last element.
|
|
*/
|
|
|
|
static void link_into_queue(KEYCACHE_WQUEUE *wqueue,
|
|
struct st_my_thread_var *thread)
|
|
{
|
|
struct st_my_thread_var *last;
|
|
if (! (last= wqueue->last_thread))
|
|
{
|
|
/* Queue is empty */
|
|
thread->next= thread;
|
|
thread->prev= &thread->next;
|
|
}
|
|
else
|
|
{
|
|
thread->prev= last->next->prev;
|
|
last->next->prev= &thread->next;
|
|
thread->next= last->next;
|
|
last->next= thread;
|
|
}
|
|
wqueue->last_thread= thread;
|
|
}
|
|
|
|
/*
|
|
Unlink a thread from double-linked queue of waiting threads
|
|
|
|
SYNOPSIS
|
|
unlink_from_queue()
|
|
wqueue pointer to the queue structure
|
|
thread pointer to the thread to be removed from the queue
|
|
|
|
RETURN VALUE
|
|
none
|
|
|
|
NOTES.
|
|
See NOTES for link_into_queue
|
|
*/
|
|
|
|
static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
|
|
struct st_my_thread_var *thread)
|
|
{
|
|
KEYCACHE_DBUG_PRINT("unlink_from_queue", ("thread %ld", thread->id));
|
|
if (thread->next == thread)
|
|
/* The queue contains only one member */
|
|
wqueue->last_thread= NULL;
|
|
else
|
|
{
|
|
thread->next->prev= thread->prev;
|
|
*thread->prev=thread->next;
|
|
if (wqueue->last_thread == thread)
|
|
wqueue->last_thread= STRUCT_PTR(struct st_my_thread_var, next,
|
|
thread->prev);
|
|
}
|
|
thread->next= NULL;
|
|
}
|
|
|
|
|
|
/*
|
|
Add a thread to single-linked queue of waiting threads
|
|
|
|
SYNOPSIS
|
|
add_to_queue()
|
|
wqueue pointer to the queue structure
|
|
thread pointer to the thread to be added to the queue
|
|
|
|
RETURN VALUE
|
|
none
|
|
|
|
NOTES.
|
|
Queue is represented by a circular list of the thread structures
|
|
The list is single-linked of the type (*next), accessed by a pointer
|
|
to the last element.
|
|
*/
|
|
|
|
static inline void add_to_queue(KEYCACHE_WQUEUE *wqueue,
|
|
struct st_my_thread_var *thread)
|
|
{
|
|
struct st_my_thread_var *last;
|
|
if (! (last= wqueue->last_thread))
|
|
thread->next= thread;
|
|
else
|
|
{
|
|
thread->next= last->next;
|
|
last->next= thread;
|
|
}
|
|
wqueue->last_thread= thread;
|
|
}
|
|
|
|
|
|
/*
|
|
Remove all threads from queue signaling them to proceed
|
|
|
|
SYNOPSIS
|
|
realease_queue()
|
|
wqueue pointer to the queue structure
|
|
thread pointer to the thread to be added to the queue
|
|
|
|
RETURN VALUE
|
|
none
|
|
|
|
NOTES.
|
|
See notes for add_to_queue
|
|
When removed from the queue each thread is signaled via condition
|
|
variable thread->suspend.
|
|
*/
|
|
|
|
static void release_queue(KEYCACHE_WQUEUE *wqueue)
|
|
{
|
|
struct st_my_thread_var *last= wqueue->last_thread;
|
|
struct st_my_thread_var *next= last->next;
|
|
struct st_my_thread_var *thread;
|
|
do
|
|
{
|
|
thread=next;
|
|
KEYCACHE_DBUG_PRINT("release_queue: signal", ("thread %ld", thread->id));
|
|
keycache_pthread_cond_signal(&thread->suspend);
|
|
next=thread->next;
|
|
thread->next= NULL;
|
|
}
|
|
while (thread != last);
|
|
wqueue->last_thread= NULL;
|
|
}
|
|
#endif
|
|
|
|
|
|
/*
|
|
Unlink a block from the chain of dirty/clean blocks
|
|
*/
|
|
|
|
static inline void unlink_changed(BLOCK_LINK *block)
|
|
{
|
|
if (block->next_changed)
|
|
block->next_changed->prev_changed= block->prev_changed;
|
|
*block->prev_changed= block->next_changed;
|
|
}
|
|
|
|
|
|
/*
|
|
Link a block into the chain of dirty/clean blocks
|
|
*/
|
|
|
|
static inline void link_changed(BLOCK_LINK *block, BLOCK_LINK **phead)
|
|
{
|
|
block->prev_changed= phead;
|
|
if ((block->next_changed= *phead))
|
|
(*phead)->prev_changed= &block->next_changed;
|
|
*phead= block;
|
|
}
|
|
|
|
|
|
/*
|
|
Unlink a block from the chain of dirty/clean blocks, if it's asked for,
|
|
and link it to the chain of clean blocks for the specified file
|
|
*/
|
|
|
|
static void link_to_file_list(KEY_CACHE *keycache,
|
|
BLOCK_LINK *block, int file, my_bool unlink)
|
|
{
|
|
if (unlink)
|
|
unlink_changed(block);
|
|
link_changed(block, &keycache->file_blocks[FILE_HASH(file)]);
|
|
if (block->status & BLOCK_CHANGED)
|
|
{
|
|
block->status&= ~BLOCK_CHANGED;
|
|
keycache->blocks_changed--;
|
|
keycache->global_blocks_changed--;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
Unlink a block from the chain of clean blocks for the specified
|
|
file and link it to the chain of dirty blocks for this file
|
|
*/
|
|
|
|
static inline void link_to_changed_list(KEY_CACHE *keycache,
|
|
BLOCK_LINK *block)
|
|
{
|
|
unlink_changed(block);
|
|
link_changed(block,
|
|
&keycache->changed_blocks[FILE_HASH(block->hash_link->file)]);
|
|
block->status|=BLOCK_CHANGED;
|
|
keycache->blocks_changed++;
|
|
keycache->global_blocks_changed++;
|
|
}
|
|
|
|
|
|
/*
|
|
Link a block to the LRU chain at the beginning or at the end of
|
|
one of two parts.
|
|
|
|
SYNOPSIS
|
|
link_block()
|
|
keycache pointer to a key cache data structure
|
|
block pointer to the block to link to the LRU chain
|
|
hot <-> to link the block into the hot subchain
|
|
at_end <-> to link the block at the end of the subchain
|
|
|
|
RETURN VALUE
|
|
none
|
|
|
|
NOTES.
|
|
The LRU chain is represented by a curcular list of block structures.
|
|
The list is double-linked of the type (**prev,*next) type.
|
|
The LRU chain is divided into two parts - hot and warm.
|
|
There are two pointers to access the last blocks of these two
|
|
parts. The beginning of the warm part follows right after the
|
|
end of the hot part.
|
|
Only blocks of the warm part can be used for replacement.
|
|
The first block from the beginning of this subchain is always
|
|
taken for eviction (keycache->last_used->next)
|
|
|
|
LRU chain: +------+ H O T +------+
|
|
+----| end |----...<----| beg |----+
|
|
| +------+last +------+ |
|
|
v<-link in latest hot (new end) |
|
|
| link in latest warm (new end)->^
|
|
| +------+ W A R M +------+ |
|
|
+----| beg |---->...----| end |----+
|
|
+------+ +------+ins
|
|
first for eviction
|
|
*/
|
|
|
|
static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot,
|
|
my_bool at_end)
|
|
{
|
|
BLOCK_LINK *ins;
|
|
BLOCK_LINK **pins;
|
|
|
|
KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests));
|
|
#ifdef THREAD
|
|
if (!hot && keycache->waiting_for_block.last_thread)
|
|
{
|
|
/* Signal that in the LRU warm sub-chain an available block has appeared */
|
|
struct st_my_thread_var *last_thread=
|
|
keycache->waiting_for_block.last_thread;
|
|
struct st_my_thread_var *first_thread= last_thread->next;
|
|
struct st_my_thread_var *next_thread= first_thread;
|
|
HASH_LINK *hash_link= (HASH_LINK *) first_thread->opt_info;
|
|
struct st_my_thread_var *thread;
|
|
do
|
|
{
|
|
thread= next_thread;
|
|
next_thread= thread->next;
|
|
/*
|
|
We notify about the event all threads that ask
|
|
for the same page as the first thread in the queue
|
|
*/
|
|
if ((HASH_LINK *) thread->opt_info == hash_link)
|
|
{
|
|
KEYCACHE_DBUG_PRINT("link_block: signal", ("thread %ld", thread->id));
|
|
keycache_pthread_cond_signal(&thread->suspend);
|
|
unlink_from_queue(&keycache->waiting_for_block, thread);
|
|
block->requests++;
|
|
}
|
|
}
|
|
while (thread != last_thread);
|
|
hash_link->block= block;
|
|
KEYCACHE_THREAD_TRACE("link_block: after signaling");
|
|
#if defined(KEYCACHE_DEBUG)
|
|
KEYCACHE_DBUG_PRINT("link_block",
|
|
("linked,unlinked block %u status=%x #requests=%u #available=%u",
|
|
BLOCK_NUMBER(block), block->status,
|
|
block->requests, keycache->blocks_available));
|
|
#endif
|
|
return;
|
|
}
|
|
#else /* THREAD */
|
|
KEYCACHE_DBUG_ASSERT(! (!hot && keycache->waiting_for_block.last_thread));
|
|
/* Condition not transformed using DeMorgan, to keep the text identical */
|
|
#endif /* THREAD */
|
|
pins= hot ? &keycache->used_ins : &keycache->used_last;
|
|
ins= *pins;
|
|
if (ins)
|
|
{
|
|
ins->next_used->prev_used= &block->next_used;
|
|
block->next_used= ins->next_used;
|
|
block->prev_used= &ins->next_used;
|
|
ins->next_used= block;
|
|
if (at_end)
|
|
*pins= block;
|
|
}
|
|
else
|
|
{
|
|
/* The LRU chain is empty */
|
|
keycache->used_last= keycache->used_ins= block->next_used= block;
|
|
block->prev_used= &block->next_used;
|
|
}
|
|
KEYCACHE_THREAD_TRACE("link_block");
|
|
#if defined(KEYCACHE_DEBUG)
|
|
keycache->blocks_available++;
|
|
KEYCACHE_DBUG_PRINT("link_block",
|
|
("linked block %u:%1u status=%x #requests=%u #available=%u",
|
|
BLOCK_NUMBER(block), at_end, block->status,
|
|
block->requests, keycache->blocks_available));
|
|
KEYCACHE_DBUG_ASSERT((ulong) keycache->blocks_available <=
|
|
keycache->blocks_used);
|
|
#endif
|
|
}
|
|
|
|
|
|
/*
|
|
Unlink a block from the LRU chain
|
|
|
|
SYNOPSIS
|
|
unlink_block()
|
|
keycache pointer to a key cache data structure
|
|
block pointer to the block to unlink from the LRU chain
|
|
|
|
RETURN VALUE
|
|
none
|
|
|
|
NOTES.
|
|
See NOTES for link_block
|
|
*/
|
|
|
|
static void unlink_block(KEY_CACHE *keycache, BLOCK_LINK *block)
|
|
{
|
|
if (block->next_used == block)
|
|
/* The list contains only one member */
|
|
keycache->used_last= keycache->used_ins= NULL;
|
|
else
|
|
{
|
|
block->next_used->prev_used= block->prev_used;
|
|
*block->prev_used= block->next_used;
|
|
if (keycache->used_last == block)
|
|
keycache->used_last= STRUCT_PTR(BLOCK_LINK, next_used, block->prev_used);
|
|
if (keycache->used_ins == block)
|
|
keycache->used_ins=STRUCT_PTR(BLOCK_LINK, next_used, block->prev_used);
|
|
}
|
|
block->next_used= NULL;
|
|
|
|
KEYCACHE_THREAD_TRACE("unlink_block");
|
|
#if defined(KEYCACHE_DEBUG)
|
|
keycache->blocks_available--;
|
|
KEYCACHE_DBUG_PRINT("unlink_block",
|
|
("unlinked block %u status=%x #requests=%u #available=%u",
|
|
BLOCK_NUMBER(block), block->status,
|
|
block->requests, keycache->blocks_available));
|
|
KEYCACHE_DBUG_ASSERT(keycache->blocks_available >= 0);
|
|
#endif
|
|
}
|
|
|
|
|
|
/*
|
|
Register requests for a block
|
|
*/
|
|
static void reg_requests(KEY_CACHE *keycache, BLOCK_LINK *block, int count)
|
|
{
|
|
if (! block->requests)
|
|
/* First request for the block unlinks it */
|
|
unlink_block(keycache, block);
|
|
block->requests+=count;
|
|
}
|
|
|
|
|
|
/*
|
|
Unregister request for a block
|
|
linking it to the LRU chain if it's the last request
|
|
|
|
SYNOPSIS
|
|
unreg_request()
|
|
keycache pointer to a key cache data structure
|
|
block pointer to the block to link to the LRU chain
|
|
at_end <-> to link the block at the end of the LRU chain
|
|
|
|
RETURN VALUE
|
|
none
|
|
|
|
NOTES.
|
|
Every linking to the LRU chain decrements by one a special block
|
|
counter (if it's positive). If the at_end parameter is TRUE the block is
|
|
added either at the end of warm sub-chain or at the end of hot sub-chain.
|
|
It is added to the hot subchain if its counter is zero and number of
|
|
blocks in warm sub-chain is not less than some low limit (determined by
|
|
the division_limit parameter). Otherwise the block is added to the warm
|
|
sub-chain. If the at_end parameter is FALSE the block is always added
|
|
at beginning of the warm sub-chain.
|
|
Thus a warm block can be promoted to the hot sub-chain when its counter
|
|
becomes zero for the first time.
|
|
At the same time the block at the very beginning of the hot subchain
|
|
might be moved to the beginning of the warm subchain if it stays untouched
|
|
for a too long time (this time is determined by parameter age_threshold).
|
|
*/
|
|
|
|
static void unreg_request(KEY_CACHE *keycache,
|
|
BLOCK_LINK *block, int at_end)
|
|
{
|
|
if (! --block->requests)
|
|
{
|
|
my_bool hot;
|
|
if (block->hits_left)
|
|
block->hits_left--;
|
|
hot= !block->hits_left && at_end &&
|
|
keycache->warm_blocks > keycache->min_warm_blocks;
|
|
if (hot)
|
|
{
|
|
if (block->temperature == BLOCK_WARM)
|
|
keycache->warm_blocks--;
|
|
block->temperature= BLOCK_HOT;
|
|
KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks: %lu",
|
|
keycache->warm_blocks));
|
|
}
|
|
link_block(keycache, block, hot, (my_bool)at_end);
|
|
block->last_hit_time= keycache->keycache_time;
|
|
keycache->keycache_time++;
|
|
|
|
block= keycache->used_ins;
|
|
/* Check if we should link a hot block to the warm block */
|
|
if (block && keycache->keycache_time - block->last_hit_time >
|
|
keycache->age_threshold)
|
|
{
|
|
unlink_block(keycache, block);
|
|
link_block(keycache, block, 0, 0);
|
|
if (block->temperature != BLOCK_WARM)
|
|
{
|
|
keycache->warm_blocks++;
|
|
block->temperature= BLOCK_WARM;
|
|
}
|
|
KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks: %lu",
|
|
keycache->warm_blocks));
|
|
}
|
|
}
|
|
}
|
|
|
|
/*
|
|
Remove a reader of the page in block
|
|
*/
|
|
|
|
static inline void remove_reader(BLOCK_LINK *block)
|
|
{
|
|
if (! --block->hash_link->requests && block->condvar)
|
|
keycache_pthread_cond_signal(block->condvar);
|
|
}
|
|
|
|
|
|
/*
|
|
Wait until the last reader of the page in block
|
|
signals on its termination
|
|
*/
|
|
|
|
static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block)
|
|
{
|
|
#ifdef THREAD
|
|
struct st_my_thread_var *thread= my_thread_var;
|
|
while (block->hash_link->requests)
|
|
{
|
|
KEYCACHE_DBUG_PRINT("wait_for_readers: wait",
|
|
("suspend thread %ld block %u",
|
|
thread->id, BLOCK_NUMBER(block)));
|
|
block->condvar= &thread->suspend;
|
|
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
|
block->condvar= NULL;
|
|
}
|
|
#else
|
|
KEYCACHE_DBUG_ASSERT(block->hash_link->requests == 0);
|
|
#endif
|
|
}
|
|
|
|
|
|
/*
|
|
Add a hash link to a bucket in the hash_table
|
|
*/
|
|
|
|
static inline void link_hash(HASH_LINK **start, HASH_LINK *hash_link)
|
|
{
|
|
if (*start)
|
|
(*start)->prev= &hash_link->next;
|
|
hash_link->next= *start;
|
|
hash_link->prev= start;
|
|
*start= hash_link;
|
|
}
|
|
|
|
|
|
/*
|
|
Remove a hash link from the hash table
|
|
*/
|
|
|
|
static void unlink_hash(KEY_CACHE *keycache, HASH_LINK *hash_link)
|
|
{
|
|
KEYCACHE_DBUG_PRINT("unlink_hash", ("fd: %u pos_ %lu #requests=%u",
|
|
(uint) hash_link->file,(ulong) hash_link->diskpos, hash_link->requests));
|
|
KEYCACHE_DBUG_ASSERT(hash_link->requests == 0);
|
|
if ((*hash_link->prev= hash_link->next))
|
|
hash_link->next->prev= hash_link->prev;
|
|
hash_link->block= NULL;
|
|
#ifdef THREAD
|
|
if (keycache->waiting_for_hash_link.last_thread)
|
|
{
|
|
/* Signal that a free hash link has appeared */
|
|
struct st_my_thread_var *last_thread=
|
|
keycache->waiting_for_hash_link.last_thread;
|
|
struct st_my_thread_var *first_thread= last_thread->next;
|
|
struct st_my_thread_var *next_thread= first_thread;
|
|
KEYCACHE_PAGE *first_page= (KEYCACHE_PAGE *) (first_thread->opt_info);
|
|
struct st_my_thread_var *thread;
|
|
|
|
hash_link->file= first_page->file;
|
|
hash_link->diskpos= first_page->filepos;
|
|
do
|
|
{
|
|
KEYCACHE_PAGE *page;
|
|
thread= next_thread;
|
|
page= (KEYCACHE_PAGE *) thread->opt_info;
|
|
next_thread= thread->next;
|
|
/*
|
|
We notify about the event all threads that ask
|
|
for the same page as the first thread in the queue
|
|
*/
|
|
if (page->file == hash_link->file && page->filepos == hash_link->diskpos)
|
|
{
|
|
KEYCACHE_DBUG_PRINT("unlink_hash: signal", ("thread %ld", thread->id));
|
|
keycache_pthread_cond_signal(&thread->suspend);
|
|
unlink_from_queue(&keycache->waiting_for_hash_link, thread);
|
|
}
|
|
}
|
|
while (thread != last_thread);
|
|
link_hash(&keycache->hash_root[KEYCACHE_HASH(hash_link->file,
|
|
hash_link->diskpos)],
|
|
hash_link);
|
|
return;
|
|
}
|
|
#else /* THREAD */
|
|
KEYCACHE_DBUG_ASSERT(! (keycache->waiting_for_hash_link.last_thread));
|
|
#endif /* THREAD */
|
|
hash_link->next= keycache->free_hash_list;
|
|
keycache->free_hash_list= hash_link;
|
|
}
|
|
|
|
|
|
/*
|
|
Get the hash link for a page
|
|
*/
|
|
|
|
static HASH_LINK *get_hash_link(KEY_CACHE *keycache,
|
|
int file, my_off_t filepos)
|
|
{
|
|
reg1 HASH_LINK *hash_link, **start;
|
|
KEYCACHE_PAGE page;
|
|
#if defined(KEYCACHE_DEBUG)
|
|
int cnt;
|
|
#endif
|
|
|
|
KEYCACHE_DBUG_PRINT("get_hash_link", ("fd: %u pos: %lu",
|
|
(uint) file,(ulong) filepos));
|
|
|
|
restart:
|
|
/*
|
|
Find the bucket in the hash table for the pair (file, filepos);
|
|
start contains the head of the bucket list,
|
|
hash_link points to the first member of the list
|
|
*/
|
|
hash_link= *(start= &keycache->hash_root[KEYCACHE_HASH(file, filepos)]);
|
|
#if defined(KEYCACHE_DEBUG)
|
|
cnt= 0;
|
|
#endif
|
|
/* Look for an element for the pair (file, filepos) in the bucket chain */
|
|
while (hash_link &&
|
|
(hash_link->diskpos != filepos || hash_link->file != file))
|
|
{
|
|
hash_link= hash_link->next;
|
|
#if defined(KEYCACHE_DEBUG)
|
|
cnt++;
|
|
if (! (cnt <= keycache->hash_links_used))
|
|
{
|
|
int i;
|
|
for (i=0, hash_link= *start ;
|
|
i < cnt ; i++, hash_link= hash_link->next)
|
|
{
|
|
KEYCACHE_DBUG_PRINT("get_hash_link", ("fd: %u pos: %lu",
|
|
(uint) hash_link->file,(ulong) hash_link->diskpos));
|
|
}
|
|
}
|
|
KEYCACHE_DBUG_ASSERT(cnt <= keycache->hash_links_used);
|
|
#endif
|
|
}
|
|
if (! hash_link)
|
|
{
|
|
/* There is no hash link in the hash table for the pair (file, filepos) */
|
|
if (keycache->free_hash_list)
|
|
{
|
|
hash_link= keycache->free_hash_list;
|
|
keycache->free_hash_list= hash_link->next;
|
|
}
|
|
else if (keycache->hash_links_used < keycache->hash_links)
|
|
{
|
|
hash_link= &keycache->hash_link_root[keycache->hash_links_used++];
|
|
}
|
|
else
|
|
{
|
|
#ifdef THREAD
|
|
/* Wait for a free hash link */
|
|
struct st_my_thread_var *thread= my_thread_var;
|
|
KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting"));
|
|
page.file= file;
|
|
page.filepos= filepos;
|
|
thread->opt_info= (void *) &page;
|
|
link_into_queue(&keycache->waiting_for_hash_link, thread);
|
|
KEYCACHE_DBUG_PRINT("get_hash_link: wait",
|
|
("suspend thread %ld", thread->id));
|
|
keycache_pthread_cond_wait(&thread->suspend,
|
|
&keycache->cache_lock);
|
|
thread->opt_info= NULL;
|
|
#else
|
|
KEYCACHE_DBUG_ASSERT(0);
|
|
#endif
|
|
goto restart;
|
|
}
|
|
hash_link->file= file;
|
|
hash_link->diskpos= filepos;
|
|
link_hash(start, hash_link);
|
|
}
|
|
/* Register the request for the page */
|
|
hash_link->requests++;
|
|
|
|
return hash_link;
|
|
}
|
|
|
|
|
|
/*
|
|
Get a block for the file page requested by a keycache read/write operation;
|
|
If the page is not in the cache return a free block, if there is none
|
|
return the lru block after saving its buffer if the page is dirty.
|
|
|
|
SYNOPSIS
|
|
|
|
find_key_block()
|
|
keycache pointer to a key cache data structure
|
|
file handler for the file to read page from
|
|
filepos position of the page in the file
|
|
init_hits_left how initialize the block counter for the page
|
|
wrmode <-> get for writing
|
|
page_st out {PAGE_READ,PAGE_TO_BE_READ,PAGE_WAIT_TO_BE_READ}
|
|
|
|
RETURN VALUE
|
|
Pointer to the found block if successful, 0 - otherwise
|
|
|
|
NOTES.
|
|
For the page from file positioned at filepos the function checks whether
|
|
the page is in the key cache specified by the first parameter.
|
|
If this is the case it immediately returns the block.
|
|
If not, the function first chooses a block for this page. If there is
|
|
no not used blocks in the key cache yet, the function takes the block
|
|
at the very beginning of the warm sub-chain. It saves the page in that
|
|
block if it's dirty before returning the pointer to it.
|
|
The function returns in the page_st parameter the following values:
|
|
PAGE_READ - if page already in the block,
|
|
PAGE_TO_BE_READ - if it is to be read yet by the current thread
|
|
WAIT_TO_BE_READ - if it is to be read by another thread
|
|
If an error occurs THE BLOCK_ERROR bit is set in the block status.
|
|
It might happen that there are no blocks in LRU chain (in warm part) -
|
|
all blocks are unlinked for some read/write operations. Then the function
|
|
waits until first of this operations links any block back.
|
|
*/
|
|
|
|
static BLOCK_LINK *find_key_block(KEY_CACHE *keycache,
|
|
File file, my_off_t filepos,
|
|
int init_hits_left,
|
|
int wrmode, int *page_st)
|
|
{
|
|
HASH_LINK *hash_link;
|
|
BLOCK_LINK *block;
|
|
int error= 0;
|
|
int page_status;
|
|
|
|
DBUG_ENTER("find_key_block");
|
|
KEYCACHE_THREAD_TRACE("find_key_block:begin");
|
|
DBUG_PRINT("enter", ("fd: %d pos: %lu wrmode: %d",
|
|
file, (ulong) filepos, wrmode));
|
|
KEYCACHE_DBUG_PRINT("find_key_block", ("fd: %d pos: %lu wrmode: %d",
|
|
file, (ulong) filepos,
|
|
wrmode));
|
|
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
|
|
DBUG_EXECUTE("check_keycache2",
|
|
test_key_cache(keycache, "start of find_key_block", 0););
|
|
#endif
|
|
|
|
restart:
|
|
/* Find the hash link for the requested page (file, filepos) */
|
|
hash_link= get_hash_link(keycache, file, filepos);
|
|
|
|
page_status= -1;
|
|
if ((block= hash_link->block) &&
|
|
block->hash_link == hash_link && (block->status & BLOCK_READ))
|
|
page_status= PAGE_READ;
|
|
|
|
if (wrmode && keycache->resize_in_flush)
|
|
{
|
|
/* This is a write request during the flush phase of a resize operation */
|
|
|
|
if (page_status != PAGE_READ)
|
|
{
|
|
/* We don't need the page in the cache: we are going to write on disk */
|
|
hash_link->requests--;
|
|
unlink_hash(keycache, hash_link);
|
|
return 0;
|
|
}
|
|
if (!(block->status & BLOCK_IN_FLUSH))
|
|
{
|
|
hash_link->requests--;
|
|
/*
|
|
Remove block to invalidate the page in the block buffer
|
|
as we are going to write directly on disk.
|
|
Although we have an exlusive lock for the updated key part
|
|
the control can be yieded by the current thread as we might
|
|
have unfinished readers of other key parts in the block
|
|
buffer. Still we are guaranteed not to have any readers
|
|
of the key part we are writing into until the block is
|
|
removed from the cache as we set the BLOCL_REASSIGNED
|
|
flag (see the code below that handles reading requests).
|
|
*/
|
|
free_block(keycache, block);
|
|
return 0;
|
|
}
|
|
/* Wait intil the page is flushed on disk */
|
|
hash_link->requests--;
|
|
{
|
|
#ifdef THREAD
|
|
struct st_my_thread_var *thread= my_thread_var;
|
|
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
|
do
|
|
{
|
|
KEYCACHE_DBUG_PRINT("find_key_block: wait",
|
|
("suspend thread %ld", thread->id));
|
|
keycache_pthread_cond_wait(&thread->suspend,
|
|
&keycache->cache_lock);
|
|
}
|
|
while(thread->next);
|
|
#else
|
|
KEYCACHE_DBUG_ASSERT(0);
|
|
/*
|
|
Given the use of "resize_in_flush", it seems impossible
|
|
that this whole branch is ever entered in single-threaded case
|
|
because "(wrmode && keycache->resize_in_flush)" cannot be true.
|
|
TODO: Check this, and then put the whole branch into the
|
|
"#ifdef THREAD" guard.
|
|
*/
|
|
#endif
|
|
}
|
|
/* Invalidate page in the block if it has not been done yet */
|
|
if (block->status)
|
|
free_block(keycache, block);
|
|
return 0;
|
|
}
|
|
|
|
if (page_status == PAGE_READ &&
|
|
(block->status & (BLOCK_IN_SWITCH | BLOCK_REASSIGNED)))
|
|
{
|
|
/* This is a request for a page to be removed from cache */
|
|
|
|
KEYCACHE_DBUG_PRINT("find_key_block",
|
|
("request for old page in block %u "
|
|
"wrmode: %d block->status: %d",
|
|
BLOCK_NUMBER(block), wrmode, block->status));
|
|
/*
|
|
Only reading requests can proceed until the old dirty page is flushed,
|
|
all others are to be suspended, then resubmitted
|
|
*/
|
|
if (!wrmode && !(block->status & BLOCK_REASSIGNED))
|
|
reg_requests(keycache, block, 1);
|
|
else
|
|
{
|
|
hash_link->requests--;
|
|
KEYCACHE_DBUG_PRINT("find_key_block",
|
|
("request waiting for old page to be saved"));
|
|
{
|
|
#ifdef THREAD
|
|
struct st_my_thread_var *thread= my_thread_var;
|
|
/* Put the request into the queue of those waiting for the old page */
|
|
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
|
/* Wait until the request can be resubmitted */
|
|
do
|
|
{
|
|
KEYCACHE_DBUG_PRINT("find_key_block: wait",
|
|
("suspend thread %ld", thread->id));
|
|
keycache_pthread_cond_wait(&thread->suspend,
|
|
&keycache->cache_lock);
|
|
}
|
|
while(thread->next);
|
|
#else
|
|
KEYCACHE_DBUG_ASSERT(0);
|
|
/* No parallel requests in single-threaded case */
|
|
#endif
|
|
}
|
|
KEYCACHE_DBUG_PRINT("find_key_block",
|
|
("request for old page resubmitted"));
|
|
/* Resubmit the request */
|
|
goto restart;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
/* This is a request for a new page or for a page not to be removed */
|
|
if (! block)
|
|
{
|
|
/* No block is assigned for the page yet */
|
|
if (keycache->blocks_unused)
|
|
{
|
|
if (keycache->free_block_list)
|
|
{
|
|
/* There is a block in the free list. */
|
|
block= keycache->free_block_list;
|
|
keycache->free_block_list= block->next_used;
|
|
block->next_used= NULL;
|
|
}
|
|
else
|
|
{
|
|
/* There are some never used blocks, take first of them */
|
|
block= &keycache->block_root[keycache->blocks_used];
|
|
block->buffer= ADD_TO_PTR(keycache->block_mem,
|
|
((ulong) keycache->blocks_used*
|
|
keycache->key_cache_block_size),
|
|
byte*);
|
|
keycache->blocks_used++;
|
|
}
|
|
keycache->blocks_unused--;
|
|
block->status= 0;
|
|
block->length= 0;
|
|
block->offset= keycache->key_cache_block_size;
|
|
block->requests= 1;
|
|
block->temperature= BLOCK_COLD;
|
|
block->hits_left= init_hits_left;
|
|
block->last_hit_time= 0;
|
|
link_to_file_list(keycache, block, file, 0);
|
|
block->hash_link= hash_link;
|
|
hash_link->block= block;
|
|
page_status= PAGE_TO_BE_READ;
|
|
KEYCACHE_DBUG_PRINT("find_key_block",
|
|
("got free or never used block %u",
|
|
BLOCK_NUMBER(block)));
|
|
}
|
|
else
|
|
{
|
|
/* There are no never used blocks, use a block from the LRU chain */
|
|
|
|
/*
|
|
Wait until a new block is added to the LRU chain;
|
|
several threads might wait here for the same page,
|
|
all of them must get the same block
|
|
*/
|
|
|
|
#ifdef THREAD
|
|
if (! keycache->used_last)
|
|
{
|
|
struct st_my_thread_var *thread= my_thread_var;
|
|
thread->opt_info= (void *) hash_link;
|
|
link_into_queue(&keycache->waiting_for_block, thread);
|
|
do
|
|
{
|
|
KEYCACHE_DBUG_PRINT("find_key_block: wait",
|
|
("suspend thread %ld", thread->id));
|
|
keycache_pthread_cond_wait(&thread->suspend,
|
|
&keycache->cache_lock);
|
|
}
|
|
while (thread->next);
|
|
thread->opt_info= NULL;
|
|
}
|
|
#else
|
|
KEYCACHE_DBUG_ASSERT(keycache->used_last);
|
|
#endif
|
|
block= hash_link->block;
|
|
if (! block)
|
|
{
|
|
/*
|
|
Take the first block from the LRU chain
|
|
unlinking it from the chain
|
|
*/
|
|
block= keycache->used_last->next_used;
|
|
block->hits_left= init_hits_left;
|
|
block->last_hit_time= 0;
|
|
reg_requests(keycache, block,1);
|
|
hash_link->block= block;
|
|
}
|
|
|
|
if (block->hash_link != hash_link &&
|
|
! (block->status & BLOCK_IN_SWITCH) )
|
|
{
|
|
/* this is a primary request for a new page */
|
|
block->status|= BLOCK_IN_SWITCH;
|
|
|
|
KEYCACHE_DBUG_PRINT("find_key_block",
|
|
("got block %u for new page", BLOCK_NUMBER(block)));
|
|
|
|
if (block->status & BLOCK_CHANGED)
|
|
{
|
|
/* The block contains a dirty page - push it out of the cache */
|
|
|
|
KEYCACHE_DBUG_PRINT("find_key_block", ("block is dirty"));
|
|
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
/*
|
|
The call is thread safe because only the current
|
|
thread might change the block->hash_link value
|
|
*/
|
|
error= my_pwrite(block->hash_link->file,
|
|
block->buffer+block->offset,
|
|
block->length - block->offset,
|
|
block->hash_link->diskpos+ block->offset,
|
|
MYF(MY_NABP | MY_WAIT_IF_FULL));
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
keycache->global_cache_write++;
|
|
}
|
|
|
|
block->status|= BLOCK_REASSIGNED;
|
|
if (block->hash_link)
|
|
{
|
|
/*
|
|
Wait until all pending read requests
|
|
for this page are executed
|
|
(we could have avoided this waiting, if we had read
|
|
a page in the cache in a sweep, without yielding control)
|
|
*/
|
|
wait_for_readers(keycache, block);
|
|
|
|
/* Remove the hash link for this page from the hash table */
|
|
unlink_hash(keycache, block->hash_link);
|
|
/* All pending requests for this page must be resubmitted */
|
|
if (block->wqueue[COND_FOR_SAVED].last_thread)
|
|
release_queue(&block->wqueue[COND_FOR_SAVED]);
|
|
}
|
|
link_to_file_list(keycache, block, file,
|
|
(my_bool)(block->hash_link ? 1 : 0));
|
|
block->status= error? BLOCK_ERROR : 0;
|
|
block->length= 0;
|
|
block->offset= keycache->key_cache_block_size;
|
|
block->hash_link= hash_link;
|
|
page_status= PAGE_TO_BE_READ;
|
|
|
|
KEYCACHE_DBUG_ASSERT(block->hash_link->block == block);
|
|
KEYCACHE_DBUG_ASSERT(hash_link->block->hash_link == hash_link);
|
|
}
|
|
else
|
|
{
|
|
/* This is for secondary requests for a new page only */
|
|
KEYCACHE_DBUG_PRINT("find_key_block",
|
|
("block->hash_link: %p hash_link: %p "
|
|
"block->status: %u", block->hash_link,
|
|
hash_link, block->status ));
|
|
page_status= (((block->hash_link == hash_link) &&
|
|
(block->status & BLOCK_READ)) ?
|
|
PAGE_READ : PAGE_WAIT_TO_BE_READ);
|
|
}
|
|
}
|
|
keycache->global_cache_read++;
|
|
}
|
|
else
|
|
{
|
|
reg_requests(keycache, block, 1);
|
|
KEYCACHE_DBUG_PRINT("find_key_block",
|
|
("block->hash_link: %p hash_link: %p "
|
|
"block->status: %u", block->hash_link,
|
|
hash_link, block->status ));
|
|
page_status= (((block->hash_link == hash_link) &&
|
|
(block->status & BLOCK_READ)) ?
|
|
PAGE_READ : PAGE_WAIT_TO_BE_READ);
|
|
}
|
|
}
|
|
|
|
KEYCACHE_DBUG_ASSERT(page_status != -1);
|
|
*page_st=page_status;
|
|
KEYCACHE_DBUG_PRINT("find_key_block",
|
|
("fd: %d pos: %lu block->status: %u page_status: %u",
|
|
file, (ulong) filepos, block->status,
|
|
(uint) page_status));
|
|
|
|
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
|
|
DBUG_EXECUTE("check_keycache2",
|
|
test_key_cache(keycache, "end of find_key_block",0););
|
|
#endif
|
|
KEYCACHE_THREAD_TRACE("find_key_block:end");
|
|
DBUG_RETURN(block);
|
|
}
|
|
|
|
|
|
/*
|
|
Read into a key cache block buffer from disk.
|
|
|
|
SYNOPSIS
|
|
|
|
read_block()
|
|
keycache pointer to a key cache data structure
|
|
block block to which buffer the data is to be read
|
|
read_length size of data to be read
|
|
min_length at least so much data must be read
|
|
primary <-> the current thread will read the data
|
|
|
|
RETURN VALUE
|
|
None
|
|
|
|
NOTES.
|
|
The function either reads a page data from file to the block buffer,
|
|
or waits until another thread reads it. What page to read is determined
|
|
by a block parameter - reference to a hash link for this page.
|
|
If an error occurs THE BLOCK_ERROR bit is set in the block status.
|
|
We do not report error when the size of successfully read
|
|
portion is less than read_length, but not less than min_length.
|
|
*/
|
|
|
|
static void read_block(KEY_CACHE *keycache,
|
|
BLOCK_LINK *block, uint read_length,
|
|
uint min_length, my_bool primary)
|
|
{
|
|
uint got_length;
|
|
|
|
/* On entry cache_lock is locked */
|
|
|
|
KEYCACHE_THREAD_TRACE("read_block");
|
|
if (primary)
|
|
{
|
|
/*
|
|
This code is executed only by threads
|
|
that submitted primary requests
|
|
*/
|
|
|
|
KEYCACHE_DBUG_PRINT("read_block",
|
|
("page to be read by primary request"));
|
|
|
|
/* Page is not in buffer yet, is to be read from disk */
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
/*
|
|
Here other threads may step in and register as secondary readers.
|
|
They will register in block->wqueue[COND_FOR_REQUESTED].
|
|
*/
|
|
got_length= my_pread(block->hash_link->file, block->buffer,
|
|
read_length, block->hash_link->diskpos, MYF(0));
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
if (got_length < min_length)
|
|
block->status|= BLOCK_ERROR;
|
|
else
|
|
{
|
|
block->status= BLOCK_READ;
|
|
block->length= got_length;
|
|
}
|
|
KEYCACHE_DBUG_PRINT("read_block",
|
|
("primary request: new page in cache"));
|
|
/* Signal that all pending requests for this page now can be processed */
|
|
if (block->wqueue[COND_FOR_REQUESTED].last_thread)
|
|
release_queue(&block->wqueue[COND_FOR_REQUESTED]);
|
|
}
|
|
else
|
|
{
|
|
/*
|
|
This code is executed only by threads
|
|
that submitted secondary requests
|
|
*/
|
|
KEYCACHE_DBUG_PRINT("read_block",
|
|
("secondary request waiting for new page to be read"));
|
|
{
|
|
#ifdef THREAD
|
|
struct st_my_thread_var *thread= my_thread_var;
|
|
/* Put the request into a queue and wait until it can be processed */
|
|
add_to_queue(&block->wqueue[COND_FOR_REQUESTED], thread);
|
|
do
|
|
{
|
|
KEYCACHE_DBUG_PRINT("read_block: wait",
|
|
("suspend thread %ld", thread->id));
|
|
keycache_pthread_cond_wait(&thread->suspend,
|
|
&keycache->cache_lock);
|
|
}
|
|
while (thread->next);
|
|
#else
|
|
KEYCACHE_DBUG_ASSERT(0);
|
|
/* No parallel requests in single-threaded case */
|
|
#endif
|
|
}
|
|
KEYCACHE_DBUG_PRINT("read_block",
|
|
("secondary request: new page in cache"));
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
Read a block of data from a cached file into a buffer;
|
|
|
|
SYNOPSIS
|
|
|
|
key_cache_read()
|
|
keycache pointer to a key cache data structure
|
|
file handler for the file for the block of data to be read
|
|
filepos position of the block of data in the file
|
|
level determines the weight of the data
|
|
buff buffer to where the data must be placed
|
|
length length of the buffer
|
|
block_length length of the block in the key cache buffer
|
|
return_buffer return pointer to the key cache buffer with the data
|
|
|
|
RETURN VALUE
|
|
Returns address from where the data is placed if sucessful, 0 - otherwise.
|
|
|
|
NOTES.
|
|
The function ensures that a block of data of size length from file
|
|
positioned at filepos is in the buffers for some key cache blocks.
|
|
Then the function either copies the data into the buffer buff, or,
|
|
if return_buffer is TRUE, it just returns the pointer to the key cache
|
|
buffer with the data.
|
|
Filepos must be a multiple of 'block_length', but it doesn't
|
|
have to be a multiple of key_cache_block_size;
|
|
*/
|
|
|
|
byte *key_cache_read(KEY_CACHE *keycache,
|
|
File file, my_off_t filepos, int level,
|
|
byte *buff, uint length,
|
|
uint block_length __attribute__((unused)),
|
|
int return_buffer __attribute__((unused)))
|
|
{
|
|
int error=0;
|
|
uint offset= 0;
|
|
byte *start= buff;
|
|
DBUG_ENTER("key_cache_read");
|
|
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
|
|
(uint) file, (ulong) filepos, length));
|
|
|
|
if (keycache->can_be_used)
|
|
{
|
|
/* Key cache is used */
|
|
reg1 BLOCK_LINK *block;
|
|
uint read_length;
|
|
uint status;
|
|
int page_st;
|
|
|
|
offset= (uint) (filepos & (keycache->key_cache_block_size-1));
|
|
/* Read data in key_cache_block_size increments */
|
|
do
|
|
{
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
if (!keycache->can_be_used)
|
|
{
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
goto no_key_cache;
|
|
}
|
|
filepos-= offset;
|
|
read_length= length;
|
|
set_if_smaller(read_length, keycache->key_cache_block_size-offset);
|
|
KEYCACHE_DBUG_ASSERT(read_length > 0);
|
|
|
|
#ifndef THREAD
|
|
if (block_length > keycache->key_cache_block_size || offset)
|
|
return_buffer=0;
|
|
#endif
|
|
|
|
inc_counter_for_resize_op(keycache);
|
|
keycache->global_cache_r_requests++;
|
|
block=find_key_block(keycache, file, filepos, level, 0, &page_st);
|
|
if (block->status != BLOCK_ERROR && page_st != PAGE_READ)
|
|
{
|
|
/* The requested page is to be read into the block buffer */
|
|
read_block(keycache, block,
|
|
keycache->key_cache_block_size, read_length+offset,
|
|
(my_bool)(page_st == PAGE_TO_BE_READ));
|
|
}
|
|
else if (! (block->status & BLOCK_ERROR) &&
|
|
block->length < read_length + offset)
|
|
{
|
|
/*
|
|
Impossible if nothing goes wrong:
|
|
this could only happen if we are using a file with
|
|
small key blocks and are trying to read outside the file
|
|
*/
|
|
my_errno= -1;
|
|
block->status|= BLOCK_ERROR;
|
|
}
|
|
|
|
if (! ((status= block->status) & BLOCK_ERROR))
|
|
{
|
|
#ifndef THREAD
|
|
if (! return_buffer)
|
|
#endif
|
|
{
|
|
#if !defined(SERIALIZED_READ_FROM_CACHE)
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
#endif
|
|
|
|
/* Copy data from the cache buffer */
|
|
if (!(read_length & 511))
|
|
bmove512(buff, block->buffer+offset, read_length);
|
|
else
|
|
memcpy(buff, block->buffer+offset, (size_t) read_length);
|
|
|
|
#if !defined(SERIALIZED_READ_FROM_CACHE)
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
#endif
|
|
}
|
|
}
|
|
|
|
remove_reader(block);
|
|
/*
|
|
Link the block into the LRU chain
|
|
if it's the last submitted request for the block
|
|
*/
|
|
unreg_request(keycache, block, 1);
|
|
|
|
dec_counter_for_resize_op(keycache);
|
|
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
|
|
if (status & BLOCK_ERROR)
|
|
DBUG_RETURN((byte *) 0);
|
|
|
|
#ifndef THREAD
|
|
/* This is only true if we where able to read everything in one block */
|
|
if (return_buffer)
|
|
DBUG_RETURN(block->buffer);
|
|
#endif
|
|
buff+= read_length;
|
|
filepos+= read_length+offset;
|
|
offset= 0;
|
|
|
|
} while ((length-= read_length));
|
|
DBUG_RETURN(start);
|
|
}
|
|
|
|
no_key_cache: /* Key cache is not used */
|
|
|
|
/* We can't use mutex here as the key cache may not be initialized */
|
|
keycache->global_cache_r_requests++;
|
|
keycache->global_cache_read++;
|
|
if (my_pread(file, (byte*) buff, length, filepos+offset, MYF(MY_NABP)))
|
|
error= 1;
|
|
DBUG_RETURN(error ? (byte*) 0 : start);
|
|
}
|
|
|
|
|
|
/*
|
|
Insert a block of file data from a buffer into key cache
|
|
|
|
SYNOPSIS
|
|
key_cache_insert()
|
|
keycache pointer to a key cache data structure
|
|
file handler for the file to insert data from
|
|
filepos position of the block of data in the file to insert
|
|
level determines the weight of the data
|
|
buff buffer to read data from
|
|
length length of the data in the buffer
|
|
|
|
NOTES
|
|
This is used by MyISAM to move all blocks from a index file to the key
|
|
cache
|
|
|
|
RETURN VALUE
|
|
0 if a success, 1 - otherwise.
|
|
*/
|
|
|
|
int key_cache_insert(KEY_CACHE *keycache,
|
|
File file, my_off_t filepos, int level,
|
|
byte *buff, uint length)
|
|
{
|
|
DBUG_ENTER("key_cache_insert");
|
|
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
|
|
(uint) file,(ulong) filepos, length));
|
|
|
|
if (keycache->can_be_used)
|
|
{
|
|
/* Key cache is used */
|
|
reg1 BLOCK_LINK *block;
|
|
uint read_length;
|
|
int page_st;
|
|
int error;
|
|
uint offset;
|
|
|
|
offset= (uint) (filepos & (keycache->key_cache_block_size-1));
|
|
do
|
|
{
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
if (!keycache->can_be_used)
|
|
{
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
DBUG_RETURN(0);
|
|
}
|
|
/* Read data into key cache from buff in key_cache_block_size incr. */
|
|
filepos-= offset;
|
|
read_length= length;
|
|
set_if_smaller(read_length, keycache->key_cache_block_size-offset);
|
|
KEYCACHE_DBUG_ASSERT(read_length > 0);
|
|
|
|
inc_counter_for_resize_op(keycache);
|
|
keycache->global_cache_r_requests++;
|
|
block= find_key_block(keycache, file, filepos, level, 0, &page_st);
|
|
if (block->status != BLOCK_ERROR && page_st != PAGE_READ)
|
|
{
|
|
/* The requested page is to be read into the block buffer */
|
|
#if !defined(SERIALIZED_READ_FROM_CACHE)
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
/*
|
|
Here other threads may step in and register as secondary readers.
|
|
They will register in block->wqueue[COND_FOR_REQUESTED].
|
|
*/
|
|
#endif
|
|
|
|
/* Copy data from buff */
|
|
if (!(read_length & 511))
|
|
bmove512(block->buffer+offset, buff, read_length);
|
|
else
|
|
memcpy(block->buffer+offset, buff, (size_t) read_length);
|
|
|
|
#if !defined(SERIALIZED_READ_FROM_CACHE)
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
/* Here we are alone again. */
|
|
#endif
|
|
block->status= BLOCK_READ;
|
|
block->length= read_length+offset;
|
|
KEYCACHE_DBUG_PRINT("key_cache_insert",
|
|
("primary request: new page in cache"));
|
|
/* Signal that all pending requests for this now can be processed. */
|
|
if (block->wqueue[COND_FOR_REQUESTED].last_thread)
|
|
release_queue(&block->wqueue[COND_FOR_REQUESTED]);
|
|
}
|
|
|
|
remove_reader(block);
|
|
/*
|
|
Link the block into the LRU chain
|
|
if it's the last submitted request for the block
|
|
*/
|
|
unreg_request(keycache, block, 1);
|
|
|
|
error= (block->status & BLOCK_ERROR);
|
|
|
|
dec_counter_for_resize_op(keycache);
|
|
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
|
|
if (error)
|
|
DBUG_RETURN(1);
|
|
|
|
buff+= read_length;
|
|
filepos+= read_length+offset;
|
|
offset= 0;
|
|
|
|
} while ((length-= read_length));
|
|
}
|
|
DBUG_RETURN(0);
|
|
}
|
|
|
|
|
|
/*
|
|
Write a buffer into a cached file.
|
|
|
|
SYNOPSIS
|
|
|
|
key_cache_write()
|
|
keycache pointer to a key cache data structure
|
|
file handler for the file to write data to
|
|
filepos position in the file to write data to
|
|
level determines the weight of the data
|
|
buff buffer with the data
|
|
length length of the buffer
|
|
dont_write if is 0 then all dirty pages involved in writing
|
|
should have been flushed from key cache
|
|
|
|
RETURN VALUE
|
|
0 if a success, 1 - otherwise.
|
|
|
|
NOTES.
|
|
The function copies the data of size length from buff into buffers
|
|
for key cache blocks that are assigned to contain the portion of
|
|
the file starting with position filepos.
|
|
It ensures that this data is flushed to the file if dont_write is FALSE.
|
|
Filepos must be a multiple of 'block_length', but it doesn't
|
|
have to be a multiple of key_cache_block_size;
|
|
*/
|
|
|
|
int key_cache_write(KEY_CACHE *keycache,
|
|
File file, my_off_t filepos, int level,
|
|
byte *buff, uint length,
|
|
uint block_length __attribute__((unused)),
|
|
int dont_write)
|
|
{
|
|
reg1 BLOCK_LINK *block;
|
|
int error=0;
|
|
DBUG_ENTER("key_cache_write");
|
|
DBUG_PRINT("enter",
|
|
("fd: %u pos: %lu length: %u block_length: %u key_block_length: %u",
|
|
(uint) file, (ulong) filepos, length, block_length,
|
|
keycache ? keycache->key_cache_block_size : 0));
|
|
|
|
if (!dont_write)
|
|
{
|
|
/* Force writing from buff into disk */
|
|
keycache->global_cache_write++;
|
|
if (my_pwrite(file, buff, length, filepos, MYF(MY_NABP | MY_WAIT_IF_FULL)))
|
|
DBUG_RETURN(1);
|
|
}
|
|
|
|
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
|
|
DBUG_EXECUTE("check_keycache",
|
|
test_key_cache(keycache, "start of key_cache_write", 1););
|
|
#endif
|
|
|
|
if (keycache->can_be_used)
|
|
{
|
|
/* Key cache is used */
|
|
uint read_length;
|
|
int page_st;
|
|
uint offset;
|
|
|
|
offset= (uint) (filepos & (keycache->key_cache_block_size-1));
|
|
do
|
|
{
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
if (!keycache->can_be_used)
|
|
{
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
goto no_key_cache;
|
|
}
|
|
/* Write data in key_cache_block_size increments */
|
|
filepos-= offset;
|
|
read_length= length;
|
|
set_if_smaller(read_length, keycache->key_cache_block_size-offset);
|
|
KEYCACHE_DBUG_ASSERT(read_length > 0);
|
|
|
|
inc_counter_for_resize_op(keycache);
|
|
keycache->global_cache_w_requests++;
|
|
block= find_key_block(keycache, file, filepos, level, 1, &page_st);
|
|
if (!block)
|
|
{
|
|
/* It happens only for requests submitted during resize operation */
|
|
dec_counter_for_resize_op(keycache);
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
if (dont_write)
|
|
{
|
|
keycache->global_cache_w_requests++;
|
|
keycache->global_cache_write++;
|
|
if (my_pwrite(file, (byte*) buff, length, filepos,
|
|
MYF(MY_NABP | MY_WAIT_IF_FULL)))
|
|
error=1;
|
|
}
|
|
goto next_block;
|
|
}
|
|
|
|
if (block->status != BLOCK_ERROR && page_st != PAGE_READ &&
|
|
(offset || read_length < keycache->key_cache_block_size))
|
|
read_block(keycache, block,
|
|
offset + read_length >= keycache->key_cache_block_size?
|
|
offset : keycache->key_cache_block_size,
|
|
offset,(my_bool)(page_st == PAGE_TO_BE_READ));
|
|
|
|
if (!dont_write)
|
|
{
|
|
/* buff has been written to disk at start */
|
|
if ((block->status & BLOCK_CHANGED) &&
|
|
(!offset && read_length >= keycache->key_cache_block_size))
|
|
link_to_file_list(keycache, block, block->hash_link->file, 1);
|
|
}
|
|
else if (! (block->status & BLOCK_CHANGED))
|
|
link_to_changed_list(keycache, block);
|
|
|
|
set_if_smaller(block->offset, offset);
|
|
set_if_bigger(block->length, read_length+offset);
|
|
|
|
if (! (block->status & BLOCK_ERROR))
|
|
{
|
|
if (!(read_length & 511))
|
|
bmove512(block->buffer+offset, buff, read_length);
|
|
else
|
|
memcpy(block->buffer+offset, buff, (size_t) read_length);
|
|
}
|
|
|
|
block->status|=BLOCK_READ;
|
|
|
|
/* Unregister the request */
|
|
block->hash_link->requests--;
|
|
unreg_request(keycache, block, 1);
|
|
|
|
if (block->status & BLOCK_ERROR)
|
|
{
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
error= 1;
|
|
break;
|
|
}
|
|
|
|
dec_counter_for_resize_op(keycache);
|
|
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
|
|
next_block:
|
|
buff+= read_length;
|
|
filepos+= read_length+offset;
|
|
offset= 0;
|
|
|
|
} while ((length-= read_length));
|
|
goto end;
|
|
}
|
|
|
|
no_key_cache:
|
|
/* Key cache is not used */
|
|
if (dont_write)
|
|
{
|
|
keycache->global_cache_w_requests++;
|
|
keycache->global_cache_write++;
|
|
if (my_pwrite(file, (byte*) buff, length, filepos,
|
|
MYF(MY_NABP | MY_WAIT_IF_FULL)))
|
|
error=1;
|
|
}
|
|
|
|
end:
|
|
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
|
|
DBUG_EXECUTE("exec",
|
|
test_key_cache(keycache, "end of key_cache_write", 1););
|
|
#endif
|
|
DBUG_RETURN(error);
|
|
}
|
|
|
|
|
|
/*
|
|
Free block: remove reference to it from hash table,
|
|
remove it from the chain file of dirty/clean blocks
|
|
and add it to the free list.
|
|
*/
|
|
|
|
static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block)
|
|
{
|
|
KEYCACHE_THREAD_TRACE("free block");
|
|
KEYCACHE_DBUG_PRINT("free_block",
|
|
("block %u to be freed, hash_link %p",
|
|
BLOCK_NUMBER(block), block->hash_link));
|
|
if (block->hash_link)
|
|
{
|
|
/*
|
|
While waiting for readers to finish, new readers might request the
|
|
block. But since we set block->status|= BLOCK_REASSIGNED, they
|
|
will wait on block->wqueue[COND_FOR_SAVED]. They must be signalled
|
|
later.
|
|
*/
|
|
block->status|= BLOCK_REASSIGNED;
|
|
wait_for_readers(keycache, block);
|
|
unlink_hash(keycache, block->hash_link);
|
|
}
|
|
|
|
unlink_changed(block);
|
|
block->status= 0;
|
|
block->length= 0;
|
|
block->offset= keycache->key_cache_block_size;
|
|
KEYCACHE_THREAD_TRACE("free block");
|
|
KEYCACHE_DBUG_PRINT("free_block",
|
|
("block is freed"));
|
|
unreg_request(keycache, block, 0);
|
|
block->hash_link= NULL;
|
|
|
|
/* Remove the free block from the LRU ring. */
|
|
unlink_block(keycache, block);
|
|
if (block->temperature == BLOCK_WARM)
|
|
keycache->warm_blocks--;
|
|
block->temperature= BLOCK_COLD;
|
|
/* Insert the free block in the free list. */
|
|
block->next_used= keycache->free_block_list;
|
|
keycache->free_block_list= block;
|
|
/* Keep track of the number of currently unused blocks. */
|
|
keycache->blocks_unused++;
|
|
|
|
/* All pending requests for this page must be resubmitted. */
|
|
if (block->wqueue[COND_FOR_SAVED].last_thread)
|
|
release_queue(&block->wqueue[COND_FOR_SAVED]);
|
|
}
|
|
|
|
|
|
static int cmp_sec_link(BLOCK_LINK **a, BLOCK_LINK **b)
|
|
{
|
|
return (((*a)->hash_link->diskpos < (*b)->hash_link->diskpos) ? -1 :
|
|
((*a)->hash_link->diskpos > (*b)->hash_link->diskpos) ? 1 : 0);
|
|
}
|
|
|
|
|
|
/*
|
|
Flush a portion of changed blocks to disk,
|
|
free used blocks if requested
|
|
*/
|
|
|
|
static int flush_cached_blocks(KEY_CACHE *keycache,
|
|
File file, BLOCK_LINK **cache,
|
|
BLOCK_LINK **end,
|
|
enum flush_type type)
|
|
{
|
|
int error;
|
|
int last_errno= 0;
|
|
uint count= (uint) (end-cache);
|
|
|
|
/* Don't lock the cache during the flush */
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
/*
|
|
As all blocks referred in 'cache' are marked by BLOCK_IN_FLUSH
|
|
we are guarunteed no thread will change them
|
|
*/
|
|
qsort((byte*) cache, count, sizeof(*cache), (qsort_cmp) cmp_sec_link);
|
|
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
for ( ; cache != end ; cache++)
|
|
{
|
|
BLOCK_LINK *block= *cache;
|
|
|
|
KEYCACHE_DBUG_PRINT("flush_cached_blocks",
|
|
("block %u to be flushed", BLOCK_NUMBER(block)));
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
error= my_pwrite(file,
|
|
block->buffer+block->offset,
|
|
block->length - block->offset,
|
|
block->hash_link->diskpos+ block->offset,
|
|
MYF(MY_NABP | MY_WAIT_IF_FULL));
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
keycache->global_cache_write++;
|
|
if (error)
|
|
{
|
|
block->status|= BLOCK_ERROR;
|
|
if (!last_errno)
|
|
last_errno= errno ? errno : -1;
|
|
}
|
|
/*
|
|
Let to proceed for possible waiting requests to write to the block page.
|
|
It might happen only during an operation to resize the key cache.
|
|
*/
|
|
if (block->wqueue[COND_FOR_SAVED].last_thread)
|
|
release_queue(&block->wqueue[COND_FOR_SAVED]);
|
|
/* type will never be FLUSH_IGNORE_CHANGED here */
|
|
if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE))
|
|
{
|
|
keycache->blocks_changed--;
|
|
keycache->global_blocks_changed--;
|
|
free_block(keycache, block);
|
|
}
|
|
else
|
|
{
|
|
block->status&= ~BLOCK_IN_FLUSH;
|
|
link_to_file_list(keycache, block, file, 1);
|
|
unreg_request(keycache, block, 1);
|
|
}
|
|
|
|
}
|
|
return last_errno;
|
|
}
|
|
|
|
|
|
/*
|
|
flush all key blocks for a file to disk, but don't do any mutex locks
|
|
|
|
flush_key_blocks_int()
|
|
keycache pointer to a key cache data structure
|
|
file handler for the file to flush to
|
|
flush_type type of the flush
|
|
|
|
NOTES
|
|
This function doesn't do any mutex locks because it needs to be called both
|
|
from flush_key_blocks and flush_all_key_blocks (the later one does the
|
|
mutex lock in the resize_key_cache() function).
|
|
|
|
RETURN
|
|
0 ok
|
|
1 error
|
|
*/
|
|
|
|
static int flush_key_blocks_int(KEY_CACHE *keycache,
|
|
File file, enum flush_type type)
|
|
{
|
|
BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache;
|
|
int last_errno= 0;
|
|
DBUG_ENTER("flush_key_blocks_int");
|
|
DBUG_PRINT("enter",("file: %d blocks_used: %lu blocks_changed: %lu",
|
|
file, keycache->blocks_used, keycache->blocks_changed));
|
|
|
|
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
|
|
DBUG_EXECUTE("check_keycache",
|
|
test_key_cache(keycache, "start of flush_key_blocks", 0););
|
|
#endif
|
|
|
|
cache= cache_buff;
|
|
if (keycache->disk_blocks > 0 &&
|
|
(!my_disable_flush_key_blocks || type != FLUSH_KEEP))
|
|
{
|
|
/* Key cache exists and flush is not disabled */
|
|
int error= 0;
|
|
uint count= 0;
|
|
BLOCK_LINK **pos,**end;
|
|
BLOCK_LINK *first_in_switch= NULL;
|
|
BLOCK_LINK *block, *next;
|
|
#if defined(KEYCACHE_DEBUG)
|
|
uint cnt=0;
|
|
#endif
|
|
|
|
if (type != FLUSH_IGNORE_CHANGED)
|
|
{
|
|
/*
|
|
Count how many key blocks we have to cache to be able
|
|
to flush all dirty pages with minimum seek moves
|
|
*/
|
|
for (block= keycache->changed_blocks[FILE_HASH(file)] ;
|
|
block ;
|
|
block= block->next_changed)
|
|
{
|
|
if (block->hash_link->file == file)
|
|
{
|
|
count++;
|
|
KEYCACHE_DBUG_ASSERT(count<= keycache->blocks_used);
|
|
}
|
|
}
|
|
/* Allocate a new buffer only if its bigger than the one we have */
|
|
if (count > FLUSH_CACHE &&
|
|
!(cache= (BLOCK_LINK**) my_malloc(sizeof(BLOCK_LINK*)*count,
|
|
MYF(0))))
|
|
{
|
|
cache= cache_buff;
|
|
count= FLUSH_CACHE;
|
|
}
|
|
}
|
|
|
|
/* Retrieve the blocks and write them to a buffer to be flushed */
|
|
restart:
|
|
end= (pos= cache)+count;
|
|
for (block= keycache->changed_blocks[FILE_HASH(file)] ;
|
|
block ;
|
|
block= next)
|
|
{
|
|
#if defined(KEYCACHE_DEBUG)
|
|
cnt++;
|
|
KEYCACHE_DBUG_ASSERT(cnt <= keycache->blocks_used);
|
|
#endif
|
|
next= block->next_changed;
|
|
if (block->hash_link->file == file)
|
|
{
|
|
/*
|
|
Mark the block with BLOCK_IN_FLUSH in order not to let
|
|
other threads to use it for new pages and interfere with
|
|
our sequence ot flushing dirty file pages
|
|
*/
|
|
block->status|= BLOCK_IN_FLUSH;
|
|
|
|
if (! (block->status & BLOCK_IN_SWITCH))
|
|
{
|
|
/*
|
|
We care only for the blocks for which flushing was not
|
|
initiated by other threads as a result of page swapping
|
|
*/
|
|
reg_requests(keycache, block, 1);
|
|
if (type != FLUSH_IGNORE_CHANGED)
|
|
{
|
|
/* It's not a temporary file */
|
|
if (pos == end)
|
|
{
|
|
/*
|
|
This happens only if there is not enough
|
|
memory for the big block
|
|
*/
|
|
if ((error= flush_cached_blocks(keycache, file, cache,
|
|
end,type)))
|
|
last_errno=error;
|
|
/*
|
|
Restart the scan as some other thread might have changed
|
|
the changed blocks chain: the blocks that were in switch
|
|
state before the flush started have to be excluded
|
|
*/
|
|
goto restart;
|
|
}
|
|
*pos++= block;
|
|
}
|
|
else
|
|
{
|
|
/* It's a temporary file */
|
|
keycache->blocks_changed--;
|
|
keycache->global_blocks_changed--;
|
|
free_block(keycache, block);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
/* Link the block into a list of blocks 'in switch' */
|
|
unlink_changed(block);
|
|
link_changed(block, &first_in_switch);
|
|
}
|
|
}
|
|
}
|
|
if (pos != cache)
|
|
{
|
|
if ((error= flush_cached_blocks(keycache, file, cache, pos, type)))
|
|
last_errno= error;
|
|
}
|
|
/* Wait until list of blocks in switch is empty */
|
|
while (first_in_switch)
|
|
{
|
|
#if defined(KEYCACHE_DEBUG)
|
|
cnt= 0;
|
|
#endif
|
|
block= first_in_switch;
|
|
{
|
|
#ifdef THREAD
|
|
struct st_my_thread_var *thread= my_thread_var;
|
|
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
|
do
|
|
{
|
|
KEYCACHE_DBUG_PRINT("flush_key_blocks_int: wait",
|
|
("suspend thread %ld", thread->id));
|
|
keycache_pthread_cond_wait(&thread->suspend,
|
|
&keycache->cache_lock);
|
|
}
|
|
while (thread->next);
|
|
#else
|
|
KEYCACHE_DBUG_ASSERT(0);
|
|
/* No parallel requests in single-threaded case */
|
|
#endif
|
|
}
|
|
#if defined(KEYCACHE_DEBUG)
|
|
cnt++;
|
|
KEYCACHE_DBUG_ASSERT(cnt <= keycache->blocks_used);
|
|
#endif
|
|
}
|
|
/* The following happens very seldom */
|
|
if (! (type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE))
|
|
{
|
|
#if defined(KEYCACHE_DEBUG)
|
|
cnt=0;
|
|
#endif
|
|
for (block= keycache->file_blocks[FILE_HASH(file)] ;
|
|
block ;
|
|
block= next)
|
|
{
|
|
#if defined(KEYCACHE_DEBUG)
|
|
cnt++;
|
|
KEYCACHE_DBUG_ASSERT(cnt <= keycache->blocks_used);
|
|
#endif
|
|
next= block->next_changed;
|
|
if (block->hash_link->file == file &&
|
|
(! (block->status & BLOCK_CHANGED)
|
|
|| type == FLUSH_IGNORE_CHANGED))
|
|
{
|
|
reg_requests(keycache, block, 1);
|
|
free_block(keycache, block);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#ifndef DBUG_OFF
|
|
DBUG_EXECUTE("check_keycache",
|
|
test_key_cache(keycache, "end of flush_key_blocks", 0););
|
|
#endif
|
|
if (cache != cache_buff)
|
|
my_free((gptr) cache, MYF(0));
|
|
if (last_errno)
|
|
errno=last_errno; /* Return first error */
|
|
DBUG_RETURN(last_errno != 0);
|
|
}
|
|
|
|
|
|
/*
|
|
Flush all blocks for a file to disk
|
|
|
|
SYNOPSIS
|
|
|
|
flush_key_blocks()
|
|
keycache pointer to a key cache data structure
|
|
file handler for the file to flush to
|
|
flush_type type of the flush
|
|
|
|
RETURN
|
|
0 ok
|
|
1 error
|
|
*/
|
|
|
|
int flush_key_blocks(KEY_CACHE *keycache,
|
|
File file, enum flush_type type)
|
|
{
|
|
int res;
|
|
DBUG_ENTER("flush_key_blocks");
|
|
DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
|
|
|
|
if (keycache->disk_blocks <= 0)
|
|
DBUG_RETURN(0);
|
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
|
inc_counter_for_resize_op(keycache);
|
|
res= flush_key_blocks_int(keycache, file, type);
|
|
dec_counter_for_resize_op(keycache);
|
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
|
DBUG_RETURN(res);
|
|
}
|
|
|
|
|
|
/*
|
|
Flush all blocks in the key cache to disk
|
|
*/
|
|
|
|
static int flush_all_key_blocks(KEY_CACHE *keycache)
|
|
{
|
|
#if defined(KEYCACHE_DEBUG)
|
|
uint cnt=0;
|
|
#endif
|
|
while (keycache->blocks_changed > 0)
|
|
{
|
|
BLOCK_LINK *block;
|
|
for (block= keycache->used_last->next_used ; ; block=block->next_used)
|
|
{
|
|
if (block->hash_link)
|
|
{
|
|
#if defined(KEYCACHE_DEBUG)
|
|
cnt++;
|
|
KEYCACHE_DBUG_ASSERT(cnt <= keycache->blocks_used);
|
|
#endif
|
|
if (flush_key_blocks_int(keycache, block->hash_link->file,
|
|
FLUSH_RELEASE))
|
|
return 1;
|
|
break;
|
|
}
|
|
if (block == keycache->used_last)
|
|
break;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
/*
|
|
Reset the counters of a key cache.
|
|
|
|
SYNOPSIS
|
|
reset_key_cache_counters()
|
|
name the name of a key cache
|
|
key_cache pointer to the key kache to be reset
|
|
|
|
DESCRIPTION
|
|
This procedure is used by process_key_caches() to reset the counters of all
|
|
currently used key caches, both the default one and the named ones.
|
|
|
|
RETURN
|
|
0 on success (always because it can't fail)
|
|
*/
|
|
|
|
int reset_key_cache_counters(const char *name, KEY_CACHE *key_cache)
|
|
{
|
|
DBUG_ENTER("reset_key_cache_counters");
|
|
if (!key_cache->key_cache_inited)
|
|
{
|
|
DBUG_PRINT("info", ("Key cache %s not initialized.", name));
|
|
DBUG_RETURN(0);
|
|
}
|
|
DBUG_PRINT("info", ("Resetting counters for key cache %s.", name));
|
|
|
|
key_cache->global_blocks_changed= 0; /* Key_blocks_not_flushed */
|
|
key_cache->global_cache_r_requests= 0; /* Key_read_requests */
|
|
key_cache->global_cache_read= 0; /* Key_reads */
|
|
key_cache->global_cache_w_requests= 0; /* Key_write_requests */
|
|
key_cache->global_cache_write= 0; /* Key_writes */
|
|
DBUG_RETURN(0);
|
|
}
|
|
|
|
|
|
#ifndef DBUG_OFF
|
|
/*
|
|
Test if disk-cache is ok
|
|
*/
|
|
static void test_key_cache(KEY_CACHE *keycache __attribute__((unused)),
|
|
const char *where __attribute__((unused)),
|
|
my_bool lock __attribute__((unused)))
|
|
{
|
|
/* TODO */
|
|
}
|
|
#endif
|
|
|
|
#if defined(KEYCACHE_TIMEOUT)
|
|
|
|
#define KEYCACHE_DUMP_FILE "keycache_dump.txt"
|
|
#define MAX_QUEUE_LEN 100
|
|
|
|
|
|
static void keycache_dump(KEY_CACHE *keycache)
|
|
{
|
|
FILE *keycache_dump_file=fopen(KEYCACHE_DUMP_FILE, "w");
|
|
struct st_my_thread_var *last;
|
|
struct st_my_thread_var *thread;
|
|
BLOCK_LINK *block;
|
|
HASH_LINK *hash_link;
|
|
KEYCACHE_PAGE *page;
|
|
uint i;
|
|
|
|
fprintf(keycache_dump_file, "thread:%u\n", thread->id);
|
|
|
|
i=0;
|
|
thread=last=waiting_for_hash_link.last_thread;
|
|
fprintf(keycache_dump_file, "queue of threads waiting for hash link\n");
|
|
if (thread)
|
|
do
|
|
{
|
|
thread=thread->next;
|
|
page= (KEYCACHE_PAGE *) thread->opt_info;
|
|
fprintf(keycache_dump_file,
|
|
"thread:%u, (file,filepos)=(%u,%lu)\n",
|
|
thread->id,(uint) page->file,(ulong) page->filepos);
|
|
if (++i == MAX_QUEUE_LEN)
|
|
break;
|
|
}
|
|
while (thread != last);
|
|
|
|
i=0;
|
|
thread=last=waiting_for_block.last_thread;
|
|
fprintf(keycache_dump_file, "queue of threads waiting for block\n");
|
|
if (thread)
|
|
do
|
|
{
|
|
thread=thread->next;
|
|
hash_link= (HASH_LINK *) thread->opt_info;
|
|
fprintf(keycache_dump_file,
|
|
"thread:%u hash_link:%u (file,filepos)=(%u,%lu)\n",
|
|
thread->id, (uint) HASH_LINK_NUMBER(hash_link),
|
|
(uint) hash_link->file,(ulong) hash_link->diskpos);
|
|
if (++i == MAX_QUEUE_LEN)
|
|
break;
|
|
}
|
|
while (thread != last);
|
|
|
|
for (i=0 ; i< keycache->blocks_used ; i++)
|
|
{
|
|
int j;
|
|
block= &keycache->block_root[i];
|
|
hash_link= block->hash_link;
|
|
fprintf(keycache_dump_file,
|
|
"block:%u hash_link:%d status:%x #requests=%u waiting_for_readers:%d\n",
|
|
i, (int) (hash_link ? HASH_LINK_NUMBER(hash_link) : -1),
|
|
block->status, block->requests, block->condvar ? 1 : 0);
|
|
for (j=0 ; j < 2; j++)
|
|
{
|
|
KEYCACHE_WQUEUE *wqueue=&block->wqueue[j];
|
|
thread= last= wqueue->last_thread;
|
|
fprintf(keycache_dump_file, "queue #%d\n", j);
|
|
if (thread)
|
|
{
|
|
do
|
|
{
|
|
thread=thread->next;
|
|
fprintf(keycache_dump_file,
|
|
"thread:%u\n", thread->id);
|
|
if (++i == MAX_QUEUE_LEN)
|
|
break;
|
|
}
|
|
while (thread != last);
|
|
}
|
|
}
|
|
}
|
|
fprintf(keycache_dump_file, "LRU chain:");
|
|
block= keycache= used_last;
|
|
if (block)
|
|
{
|
|
do
|
|
{
|
|
block= block->next_used;
|
|
fprintf(keycache_dump_file,
|
|
"block:%u, ", BLOCK_NUMBER(block));
|
|
}
|
|
while (block != keycache->used_last);
|
|
}
|
|
fprintf(keycache_dump_file, "\n");
|
|
|
|
fclose(keycache_dump_file);
|
|
}
|
|
|
|
#endif /* defined(KEYCACHE_TIMEOUT) */
|
|
|
|
#if defined(KEYCACHE_TIMEOUT) && !defined(__WIN__)
|
|
|
|
|
|
static int keycache_pthread_cond_wait(pthread_cond_t *cond,
|
|
pthread_mutex_t *mutex)
|
|
{
|
|
int rc;
|
|
struct timeval now; /* time when we started waiting */
|
|
struct timespec timeout; /* timeout value for the wait function */
|
|
struct timezone tz;
|
|
#if defined(KEYCACHE_DEBUG)
|
|
int cnt=0;
|
|
#endif
|
|
|
|
/* Get current time */
|
|
gettimeofday(&now, &tz);
|
|
/* Prepare timeout value */
|
|
timeout.tv_sec= now.tv_sec + KEYCACHE_TIMEOUT;
|
|
/*
|
|
timeval uses microseconds.
|
|
timespec uses nanoseconds.
|
|
1 nanosecond = 1000 micro seconds
|
|
*/
|
|
timeout.tv_nsec= now.tv_usec * 1000;
|
|
KEYCACHE_THREAD_TRACE_END("started waiting");
|
|
#if defined(KEYCACHE_DEBUG)
|
|
cnt++;
|
|
if (cnt % 100 == 0)
|
|
fprintf(keycache_debug_log, "waiting...\n");
|
|
fflush(keycache_debug_log);
|
|
#endif
|
|
rc= pthread_cond_timedwait(cond, mutex, &timeout);
|
|
KEYCACHE_THREAD_TRACE_BEGIN("finished waiting");
|
|
if (rc == ETIMEDOUT || rc == ETIME)
|
|
{
|
|
#if defined(KEYCACHE_DEBUG)
|
|
fprintf(keycache_debug_log,"aborted by keycache timeout\n");
|
|
fclose(keycache_debug_log);
|
|
abort();
|
|
#endif
|
|
keycache_dump();
|
|
}
|
|
|
|
#if defined(KEYCACHE_DEBUG)
|
|
KEYCACHE_DBUG_ASSERT(rc != ETIMEDOUT);
|
|
#else
|
|
assert(rc != ETIMEDOUT);
|
|
#endif
|
|
return rc;
|
|
}
|
|
#else
|
|
#if defined(KEYCACHE_DEBUG)
|
|
static int keycache_pthread_cond_wait(pthread_cond_t *cond,
|
|
pthread_mutex_t *mutex)
|
|
{
|
|
int rc;
|
|
KEYCACHE_THREAD_TRACE_END("started waiting");
|
|
rc= pthread_cond_wait(cond, mutex);
|
|
KEYCACHE_THREAD_TRACE_BEGIN("finished waiting");
|
|
return rc;
|
|
}
|
|
#endif
|
|
#endif /* defined(KEYCACHE_TIMEOUT) && !defined(__WIN__) */
|
|
|
|
#if defined(KEYCACHE_DEBUG)
|
|
|
|
|
|
static int keycache_pthread_mutex_lock(pthread_mutex_t *mutex)
|
|
{
|
|
int rc;
|
|
rc= pthread_mutex_lock(mutex);
|
|
KEYCACHE_THREAD_TRACE_BEGIN("");
|
|
return rc;
|
|
}
|
|
|
|
|
|
static void keycache_pthread_mutex_unlock(pthread_mutex_t *mutex)
|
|
{
|
|
KEYCACHE_THREAD_TRACE_END("");
|
|
pthread_mutex_unlock(mutex);
|
|
}
|
|
|
|
|
|
static int keycache_pthread_cond_signal(pthread_cond_t *cond)
|
|
{
|
|
int rc;
|
|
KEYCACHE_THREAD_TRACE("signal");
|
|
rc= pthread_cond_signal(cond);
|
|
return rc;
|
|
}
|
|
|
|
|
|
#if defined(KEYCACHE_DEBUG_LOG)
|
|
|
|
|
|
static void keycache_debug_print(const char * fmt,...)
|
|
{
|
|
va_list args;
|
|
va_start(args,fmt);
|
|
if (keycache_debug_log)
|
|
{
|
|
VOID(vfprintf(keycache_debug_log, fmt, args));
|
|
VOID(fputc('\n',keycache_debug_log));
|
|
}
|
|
va_end(args);
|
|
}
|
|
#endif /* defined(KEYCACHE_DEBUG_LOG) */
|
|
|
|
#if defined(KEYCACHE_DEBUG_LOG)
|
|
|
|
|
|
void keycache_debug_log_close(void)
|
|
{
|
|
if (keycache_debug_log)
|
|
fclose(keycache_debug_log);
|
|
}
|
|
#endif /* defined(KEYCACHE_DEBUG_LOG) */
|
|
|
|
#endif /* defined(KEYCACHE_DEBUG) */
|