mariadb/sql/spatial.cc

3807 lines
87 KiB
C++
Raw Normal View History

2011-07-04 01:25:49 +02:00
/*
2013-07-16 19:09:54 +02:00
Copyright (c) 2002, 2013, Oracle and/or its affiliates.
2021-04-09 13:32:06 +02:00
Copyright (c) 2011, 2021, MariaDB Corporation.
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
Many files: 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
2006-12-23 20:17:15 +01:00
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
#include "mariadb.h"
#include "sql_priv.h"
#include "spatial.h"
#include "gstream.h" // Gis_read_stream
#include "sql_string.h" // String
/* This is from item_func.h. Didn't want to #include the whole file. */
double my_double_round(double value, longlong dec, bool dec_unsigned,
bool truncate);
#ifdef HAVE_SPATIAL
/*
exponential notation :
1 sign
1 number before the decimal point
1 decimal point
14 number of significant digits (see String::qs_append(double))
1 'e' sign
1 exponent sign
3 exponent digits
==
22
"f" notation :
1 optional 0
1 sign
14 number significant digits (see String::qs_append(double) )
1 decimal point
==
17
*/
#define MAX_DIGITS_IN_DOUBLE MY_GCVT_MAX_FIELD_WIDTH
int MBR::within(const MBR *mbr)
{
/*
We have to take into account the 'dimension' of
the MBR, where the dimension of a single point is 0,
the dimesion of an vertical or horizontal line is 1,
and finally the dimension of the solid rectangle is 2.
*/
int dim1= dimension();
int dim2= mbr->dimension();
DBUG_ASSERT(dim1 >= 0 && dim1 <= 2 && dim2 >= 0 && dim2 <= 2);
/*
Either/both of the two operands can degrade to a point or a
horizontal/vertical line segment, and we have to treat such cases
separately.
*/
switch (dim1)
{
case 0:
DBUG_ASSERT(xmin == xmax && ymin == ymax);
switch (dim2)
{
case 0:
DBUG_ASSERT(mbr->xmin == mbr->xmax && mbr->ymin == mbr->ymax);
return equals(mbr);
break;
case 1:
DBUG_ASSERT((mbr->xmin == mbr->xmax && mbr->ymin != mbr->ymax) ||
(mbr->ymin == mbr->ymax && mbr->xmin != mbr->xmax));
return ((xmin > mbr->xmin && xmin < mbr->xmax && ymin == mbr->ymin) ||
(ymin > mbr->ymin && ymin < mbr->ymax && xmin == mbr->xmin));
break;
case 2:
DBUG_ASSERT(mbr->xmin != mbr->xmax && mbr->ymin != mbr->ymax);
return (xmin > mbr->xmin && xmax < mbr->xmax &&
ymin > mbr->ymin && ymax < mbr->ymax);
break;
}
break;
case 1:
DBUG_ASSERT((xmin == xmax && ymin != ymax) ||
(ymin == ymax && xmin != xmax));
switch (dim2)
{
case 0:
DBUG_ASSERT(mbr->xmin == mbr->xmax && mbr->ymin == mbr->ymax);
return 0;
break;
case 1:
DBUG_ASSERT((mbr->xmin == mbr->xmax && mbr->ymin != mbr->ymax) ||
(mbr->ymin == mbr->ymax && mbr->xmin != mbr->xmax));
return ((xmin == xmax && mbr->xmin == mbr->xmax && mbr->xmin == xmin &&
mbr->ymin <= ymin && mbr->ymax >= ymax) ||
(ymin == ymax && mbr->ymin == mbr->ymax && mbr->ymin == ymin &&
mbr->xmin <= xmin && mbr->xmax >= xmax));
break;
case 2:
DBUG_ASSERT(mbr->xmin != mbr->xmax && mbr->ymin != mbr->ymax);
return ((xmin == xmax && xmin > mbr->xmin && xmax < mbr->xmax &&
ymin >= mbr->ymin && ymax <= mbr->ymax) ||
(ymin == ymax && ymin > mbr->ymin && ymax < mbr->ymax &&
xmin >= mbr->xmin && xmax <= mbr->xmax));
break;
}
break;
case 2:
DBUG_ASSERT(xmin != xmax && ymin != ymax);
switch (dim2)
{
case 0:
case 1:
return 0;
break;
case 2:
DBUG_ASSERT(mbr->xmin != mbr->xmax && mbr->ymin != mbr->ymax);
return ((mbr->xmin <= xmin) && (mbr->ymin <= ymin) &&
(mbr->xmax >= xmax) && (mbr->ymax >= ymax));
break;
}
break;
}
// Never reached.
DBUG_ASSERT(false);
return 0;
}
/***************************** Gis_class_info *******************************/
String Geometry::bad_geometry_data("Bad object", &my_charset_bin);
Fixed compiler warnings detected by option -Wshadow and -Wunused: - Removed not used variables and functions - Added #ifdef around code that is not used - Renamed variables and functions to avoid conflicts - Removed some not used arguments Fixed some class/struct warnings in ndb Added define IS_LONGDATA() to simplify code in libmysql.c I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes BUILD/SETUP.sh: Added printing of unused functions and variables. Made it easy to test compiling with -Wshadow BUILD/compile-pentium-gcov: Added warnings Mark binary with -gcov client/mysql.cc: Fixed warnings found with gcc -Wshadow client/mysql_upgrade.c: Fixed warnings found with gcc -Wshadow client/mysqlbinlog.cc: Fixed warnings found with gcc -Wshadow client/mysqldump.c: Fixed warnings found with gcc -Wshadow client/mysqltest.c: Fixed warnings found with gcc -Wshadow client/sql_string.cc: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.cc client/sql_string.h: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.h cmd-line-utils/readline/display.c: Fixed compiler warning cmd-line-utils/readline/histexpand.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/input.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/text.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/vi_mode.c: Fixed warnings found with gcc -Wshadow dbug/dbug_analyze.c: Fixed warnings found with gcc -Wshadow extra/my_print_defaults.c: Prefixed defaults_extra_file and defaults_group_suffix with 'my' to avoid conflicts with similar named local variables extra/yassl/include/buffer.hpp: Fixed compiler warnings extra/yassl/include/crypto_wrapper.hpp: Fixed compiler warnings extra/yassl/include/yassl_imp.hpp: Fixed compiler warnings extra/yassl/include/yassl_int.hpp: Fixed compiler warnings extra/yassl/src/crypto_wrapper.cpp: Fixed compiler warnings extra/yassl/taocrypt/benchmark/benchmark.cpp: Fixed warnings found with gcc -Wshadow extra/yassl/taocrypt/include/algebra.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/des.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hash.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hmac.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modarith.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modes.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/rsa.hpp: Fixed compiler warnings extra/yassl/taocrypt/mySTL/list.hpp: Fixed compiler warnings extra/yassl/taocrypt/src/aes.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/algebra.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/asn.cpp: Fixed compiler warnings extra/yassl/taocrypt/test/test.cpp: Fixed compiler warnings extra/yassl/testsuite/testsuite.cpp: Fixed compiler warnings include/m_ctype.h: Fixed warnings found with gcc -Wshadow include/my_pthread.h: Fixed warnings found with gcc -Wshadow include/my_sys.h: Fixed warnings found with gcc -Wshadow include/my_time.h: Fixed warnings found with gcc -Wshadow include/mysql.h: Fixed warnings found with gcc -Wshadow Added define IS_LONGDATA() to simplify code in libmysql.c libmysql/libmysql.c: Fixed warnings found with gcc -Wshadow (Mostly replaced bind -> my_bind and time -> my_time) libmysqld/lib_sql.cc: Removed not used variables and labels myisam/ft_boolean_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_open.c: Fixed warnings found with gcc -Wshadow myisam/mi_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_unique.c: Fixed compiler warning myisam/myisampack.c: Fixed warnings found with gcc -Wshadow myisam/rt_index.c: Remove not used variables myisam/sort.c: Fixed warnings found with gcc -Wshadow mysql-test/r/mysqlcheck.result: Remove databases and tables possible left by previous test mysql-test/r/mysqltest.result: New test results mysql-test/t/mysql.test: Coverage tests mysql-test/t/mysqlbinlog.test: Coverage tests mysql-test/t/mysqlcheck.test: Remove databases and tables possible left by previous test mysql-test/t/mysqltest.test: Coverage tests mysys/default.c: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions mysys/mf_iocache2.c: Fixed warnings found with gcc -Wshadow mysys/mf_keycache.c: Fixed warnings found with gcc -Wshadow mysys/my_bitmap.c: Fixed warnings found with gcc -Wshadow mysys/sha1.c: Fixed warnings found with gcc -Wshadow ndb/include/kernel/signaldata/ArbitSignalData.hpp: Fixed compiler warning ndb/include/kernel/signaldata/DictTabInfo.hpp: Fixed compiler warnings ndb/include/ndbapi/NdbReceiver.hpp: Fixed warnings found with gcc -Wshadow ndb/include/transporter/TransporterDefinitions.hpp: Fixed compiler warning ndb/include/util/InputStream.hpp: Fixed compiler warning ndb/include/util/OutputStream.hpp: Fixed compiler warning ndb/include/util/SimpleProperties.hpp: Fixed compiler warning ndb/include/util/SocketAuthenticator.hpp: Fixed compiler warning ndb/include/util/SocketServer.hpp: Fixed compiler warning ndb/src/common/mgmcommon/ConfigRetriever.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/portlib/NdbTick.c: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/SHM_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.hpp: Fixed compiler warning ndb/src/common/transporter/Transporter.cpp: Removed not used variable ndb/src/common/transporter/TransporterRegistry.cpp: Removed not used variable ndb/src/common/util/Bitmask.cpp: Moved function to avoid warnings of not used function ndb/src/common/util/ConfigValues.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/File.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/Properties.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/SocketClient.cpp: Fixed wrong return value ndb/src/common/util/random.c: Fixed warnings found with gcc -Wshadow ndb/src/common/util/socket_io.cpp: Fixed warnings found with gcc -Wshadow ndb/src/cw/cpcd/APIService.cpp: Removed not used variable ndb/src/cw/cpcd/main.cpp: Removed not used variables ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Removed not used variables ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Removed not used variables ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: Removed not used variable ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: Removed not used variables ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Removed not used variables ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/Qmgr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.hpp: Fixed compiler warnings ndb/src/kernel/vm/MetaData.hpp: Fixed compiler warnings ndb/src/mgmapi/LocalConfig.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmapi/mgmapi.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmclient/CommandInterpreter.cpp: Removed not used variables ndb/src/mgmsrv/ConfigInfo.cpp: Fixed warnings found with gcc -Wshadow Removed not used variables ndb/src/mgmsrv/ConfigInfo.hpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmsrv/InitConfigFileParser.cpp: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions ndb/src/mgmsrv/MgmtSrvr.cpp: Removed not used variables and functions ndb/src/mgmsrv/MgmtSrvr.hpp: Fixed compiler warnings ndb/src/mgmsrv/Services.cpp: Removed not used variables and functions ndb/src/mgmsrv/main.cpp: Removed not used variable ndb/src/ndbapi/ClusterMgr.hpp: Fixed compiler warnings ndb/src/ndbapi/Ndb.cpp: Removed not used variables ndb/src/ndbapi/NdbBlob.cpp: Removed not used variables ndb/src/ndbapi/NdbDictionaryImpl.cpp: Removed not used variables ndb/src/ndbapi/NdbIndexOperation.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationDefine.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationExec.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationSearch.cpp: Removed not used variables ndb/src/ndbapi/NdbScanFilter.cpp: Fixed compiler warning ndb/src/ndbapi/NdbScanOperation.cpp: Removed not used variables ndb/src/ndbapi/SignalSender.cpp: Removed not used variables ndb/src/ndbapi/ndb_cluster_connection.cpp: Removed not used variable ndb/tools/delete_all.cpp: Removed not used variable ndb/tools/desc.cpp: Removed not used variable ndb/tools/drop_index.cpp: Removed not used variable ndb/tools/drop_tab.cpp: Removed not used variable ndb/tools/listTables.cpp: Removed not used variable ndb/tools/ndb_config.cpp: Fixed warnings found with gcc -Wshadow Added missing puts(desc) ndb/tools/restore/Restore.hpp: Changed delimiter to define instead of static variable, as the static variable caused a LOT of compiler warnings Fixed compiler warning ndb/tools/restore/consumer.hpp: Fixed compiler warning ndb/tools/restore/restore_main.cpp: Fixed compiler warnings ndb/tools/select_all.cpp: Removed not used variables ndb/tools/select_count.cpp: Removed not used variable server-tools/instance-manager/commands.h: Fixed compiler warnings server-tools/instance-manager/guardian.cc: Fixed compiler warnings server-tools/instance-manager/instance_options.cc: Removed not used variables server-tools/instance-manager/mysql_connection.cc: Fixed compiler warnings server-tools/instance-manager/options.cc: Fixed compiler warnings server-tools/instance-manager/options.h: Fixed compiler warnings server-tools/instance-manager/parse.cc: Removed not used variable server-tools/instance-manager/user_map.cc: Fixed compiler warnings server-tools/instance-manager/user_map.h: Fixed compiler warnings sql/field.cc: Fixed compiler warnings sql/field.h: Fixed compiler warnings sql/filesort.cc: Fixed compiler warnings sql/ha_archive.cc: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_archive.h: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_federated.cc: Fixed compiler warnings sql/ha_heap.cc: Fixed compiler warnings sql/ha_myisam.cc: Fixed compiler warnings sql/ha_myisammrg.cc: Fixed compiler warnings sql/ha_ndbcluster.cc: Fixed compiler warnings sql/handler.cc: Fixed compiler warnings sql/item.cc: Fixed compiler warnings sql/item.h: Fixed compiler warnings new_item() -> clone_item(), to avoid a lot of warnings with variable 'new_item' el() -> element_index() sql/item_cmpfunc.cc: Fixed compiler warnings sql/item_cmpfunc.h: Fixed compiler warnings sql/item_func.cc: Fixed compiler warnings sql/item_geofunc.cc: Fixed compiler warnings sql/item_row.h: Fixed compiler warnings sql/item_strfunc.cc: Fixed compiler warnings sql/item_subselect.cc: Fixed compiler warnings sql/item_subselect.h: Fixed compiler warnings sql/item_sum.cc: Fixed compiler warnings sql/item_timefunc.cc: Fixed compiler warnings sql/log.cc: Fixed compiler warnings More comments Added #ifdef HAVE_REPLICATION sql/log_event.cc: Fixed compiler warnings sql/log_event.h: Fixed compiler warnings sql/mysql_priv.h: query_id -> global_query_id, to avoid a lot of clashes with function and class variables start_time -> server_start_time sql/mysqld.cc: Fixed compiler warnings: - Removed not used variables - Added #ifndef EMBEDDED_LIBRARY - Fixed shadow warnings sql/net_serv.cc: Fixed compiler warnings sql/opt_range.cc: range -> last_range to avoid shadow warnings Removed not used function print_rowid() sql/opt_range.h: range -> last_range to avoid shadow warnings sql/password.c: Fixed compiler warnings sql/protocol.cc: Fixed compiler warnings sql/repl_failsafe.cc: Fixed compiler warnings sql/set_var.cc: Fixed compiler warnings sql/set_var.h: type() -> show_type() Fixed compiler warnings sql/slave.cc: Fixed compiler warnings sql/sp_head.cc: Fixed compiler warnings sql/sp_head.h: Fixed compiler warnings sql/spatial.cc: Fixed compiler warnings sql/spatial.h: length() -> geom_length() to avoid compiler warnings wkb_end -> wkb_last to avoid compiler warnings with local variables named 'wkb_end' sql/sql_cache.h: Fixed compiler warnings sql/sql_class.cc: Fixed compiler warnings sql/sql_class.h: log -> log_xid() to avoid compiler warnings Fixed shadow compiler warnings sql/sql_derived.cc: Removed not used variable sql/sql_insert.cc: Fixed compiler warnings sql/sql_lex.cc: Fixed compiler warnings sql/sql_lex.h: res -> saved_error to make the meaning of the variable clear and avoid shadow warnings sql/sql_load.cc: Fixed compiler warnings sql/sql_parse.cc: Fixed compiler warnings sql/sql_prepare.cc: Fixed compiler warnings sql/sql_select.cc: Fixed compiler warnings sql/sql_show.cc: Fixed compiler warnings sql/sql_string.cc: Fixed compiler warnings sql/sql_string.h: Fixed compiler warnings sql/sql_table.cc: Fixed compiler warnings sql/sql_trigger.cc: Fixed compiler warnings sql/sql_trigger.h: table -> trigger_table to avoid warnings from local variables sql/sql_union.cc: Fixed compiler warnings (mainly res -> saved_error) sql-common/client.c: Removed not used variable sql-common/my_time.c: Removed not used variable time -> my_time sql/sql_update.cc: Removed not used variable sql/sql_view.cc: Removed not used variable sql/sql_yacc.yy: Removed not used variable sql/table.cc: Removed not used variable sql/tztime.cc: Removed not used variable sql/unireg.cc: Removed not used variable strings/ctype-bin.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-cp932.c: Fixed compiler warnings strings/ctype-eucjpms.c: Fixed compiler warnings strings/ctype-mb.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-simple.c: mblen -> mb_len to avoid compiler warnings with local variable mblen exp -> exponent strings/ctype-sjis.c: Fixed compiler warnings strings/ctype-uca.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-ujis.c: Fixed compiler warnings strings/ctype-utf8.c: Fixed compiler warnings strings/decimal.c: Fixed compiler warnings strings/my_vsnprintf.c: Added comment strings/strtod.c: Fixed compiler warnings tests/mysql_client_test.c: Fixed compiler warnings (Biggest part of patch is to not get a conflict with global function 'bind')
2006-12-14 23:51:37 +01:00
Geometry::Class_info *Geometry::ci_collection[Geometry::wkb_last+1]=
{
NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
static Geometry::Class_info **ci_collection_end=
Fixed compiler warnings detected by option -Wshadow and -Wunused: - Removed not used variables and functions - Added #ifdef around code that is not used - Renamed variables and functions to avoid conflicts - Removed some not used arguments Fixed some class/struct warnings in ndb Added define IS_LONGDATA() to simplify code in libmysql.c I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes BUILD/SETUP.sh: Added printing of unused functions and variables. Made it easy to test compiling with -Wshadow BUILD/compile-pentium-gcov: Added warnings Mark binary with -gcov client/mysql.cc: Fixed warnings found with gcc -Wshadow client/mysql_upgrade.c: Fixed warnings found with gcc -Wshadow client/mysqlbinlog.cc: Fixed warnings found with gcc -Wshadow client/mysqldump.c: Fixed warnings found with gcc -Wshadow client/mysqltest.c: Fixed warnings found with gcc -Wshadow client/sql_string.cc: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.cc client/sql_string.h: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.h cmd-line-utils/readline/display.c: Fixed compiler warning cmd-line-utils/readline/histexpand.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/input.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/text.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/vi_mode.c: Fixed warnings found with gcc -Wshadow dbug/dbug_analyze.c: Fixed warnings found with gcc -Wshadow extra/my_print_defaults.c: Prefixed defaults_extra_file and defaults_group_suffix with 'my' to avoid conflicts with similar named local variables extra/yassl/include/buffer.hpp: Fixed compiler warnings extra/yassl/include/crypto_wrapper.hpp: Fixed compiler warnings extra/yassl/include/yassl_imp.hpp: Fixed compiler warnings extra/yassl/include/yassl_int.hpp: Fixed compiler warnings extra/yassl/src/crypto_wrapper.cpp: Fixed compiler warnings extra/yassl/taocrypt/benchmark/benchmark.cpp: Fixed warnings found with gcc -Wshadow extra/yassl/taocrypt/include/algebra.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/des.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hash.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hmac.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modarith.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modes.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/rsa.hpp: Fixed compiler warnings extra/yassl/taocrypt/mySTL/list.hpp: Fixed compiler warnings extra/yassl/taocrypt/src/aes.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/algebra.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/asn.cpp: Fixed compiler warnings extra/yassl/taocrypt/test/test.cpp: Fixed compiler warnings extra/yassl/testsuite/testsuite.cpp: Fixed compiler warnings include/m_ctype.h: Fixed warnings found with gcc -Wshadow include/my_pthread.h: Fixed warnings found with gcc -Wshadow include/my_sys.h: Fixed warnings found with gcc -Wshadow include/my_time.h: Fixed warnings found with gcc -Wshadow include/mysql.h: Fixed warnings found with gcc -Wshadow Added define IS_LONGDATA() to simplify code in libmysql.c libmysql/libmysql.c: Fixed warnings found with gcc -Wshadow (Mostly replaced bind -> my_bind and time -> my_time) libmysqld/lib_sql.cc: Removed not used variables and labels myisam/ft_boolean_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_open.c: Fixed warnings found with gcc -Wshadow myisam/mi_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_unique.c: Fixed compiler warning myisam/myisampack.c: Fixed warnings found with gcc -Wshadow myisam/rt_index.c: Remove not used variables myisam/sort.c: Fixed warnings found with gcc -Wshadow mysql-test/r/mysqlcheck.result: Remove databases and tables possible left by previous test mysql-test/r/mysqltest.result: New test results mysql-test/t/mysql.test: Coverage tests mysql-test/t/mysqlbinlog.test: Coverage tests mysql-test/t/mysqlcheck.test: Remove databases and tables possible left by previous test mysql-test/t/mysqltest.test: Coverage tests mysys/default.c: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions mysys/mf_iocache2.c: Fixed warnings found with gcc -Wshadow mysys/mf_keycache.c: Fixed warnings found with gcc -Wshadow mysys/my_bitmap.c: Fixed warnings found with gcc -Wshadow mysys/sha1.c: Fixed warnings found with gcc -Wshadow ndb/include/kernel/signaldata/ArbitSignalData.hpp: Fixed compiler warning ndb/include/kernel/signaldata/DictTabInfo.hpp: Fixed compiler warnings ndb/include/ndbapi/NdbReceiver.hpp: Fixed warnings found with gcc -Wshadow ndb/include/transporter/TransporterDefinitions.hpp: Fixed compiler warning ndb/include/util/InputStream.hpp: Fixed compiler warning ndb/include/util/OutputStream.hpp: Fixed compiler warning ndb/include/util/SimpleProperties.hpp: Fixed compiler warning ndb/include/util/SocketAuthenticator.hpp: Fixed compiler warning ndb/include/util/SocketServer.hpp: Fixed compiler warning ndb/src/common/mgmcommon/ConfigRetriever.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/portlib/NdbTick.c: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/SHM_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.hpp: Fixed compiler warning ndb/src/common/transporter/Transporter.cpp: Removed not used variable ndb/src/common/transporter/TransporterRegistry.cpp: Removed not used variable ndb/src/common/util/Bitmask.cpp: Moved function to avoid warnings of not used function ndb/src/common/util/ConfigValues.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/File.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/Properties.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/SocketClient.cpp: Fixed wrong return value ndb/src/common/util/random.c: Fixed warnings found with gcc -Wshadow ndb/src/common/util/socket_io.cpp: Fixed warnings found with gcc -Wshadow ndb/src/cw/cpcd/APIService.cpp: Removed not used variable ndb/src/cw/cpcd/main.cpp: Removed not used variables ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Removed not used variables ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Removed not used variables ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: Removed not used variable ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: Removed not used variables ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Removed not used variables ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/Qmgr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.hpp: Fixed compiler warnings ndb/src/kernel/vm/MetaData.hpp: Fixed compiler warnings ndb/src/mgmapi/LocalConfig.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmapi/mgmapi.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmclient/CommandInterpreter.cpp: Removed not used variables ndb/src/mgmsrv/ConfigInfo.cpp: Fixed warnings found with gcc -Wshadow Removed not used variables ndb/src/mgmsrv/ConfigInfo.hpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmsrv/InitConfigFileParser.cpp: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions ndb/src/mgmsrv/MgmtSrvr.cpp: Removed not used variables and functions ndb/src/mgmsrv/MgmtSrvr.hpp: Fixed compiler warnings ndb/src/mgmsrv/Services.cpp: Removed not used variables and functions ndb/src/mgmsrv/main.cpp: Removed not used variable ndb/src/ndbapi/ClusterMgr.hpp: Fixed compiler warnings ndb/src/ndbapi/Ndb.cpp: Removed not used variables ndb/src/ndbapi/NdbBlob.cpp: Removed not used variables ndb/src/ndbapi/NdbDictionaryImpl.cpp: Removed not used variables ndb/src/ndbapi/NdbIndexOperation.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationDefine.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationExec.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationSearch.cpp: Removed not used variables ndb/src/ndbapi/NdbScanFilter.cpp: Fixed compiler warning ndb/src/ndbapi/NdbScanOperation.cpp: Removed not used variables ndb/src/ndbapi/SignalSender.cpp: Removed not used variables ndb/src/ndbapi/ndb_cluster_connection.cpp: Removed not used variable ndb/tools/delete_all.cpp: Removed not used variable ndb/tools/desc.cpp: Removed not used variable ndb/tools/drop_index.cpp: Removed not used variable ndb/tools/drop_tab.cpp: Removed not used variable ndb/tools/listTables.cpp: Removed not used variable ndb/tools/ndb_config.cpp: Fixed warnings found with gcc -Wshadow Added missing puts(desc) ndb/tools/restore/Restore.hpp: Changed delimiter to define instead of static variable, as the static variable caused a LOT of compiler warnings Fixed compiler warning ndb/tools/restore/consumer.hpp: Fixed compiler warning ndb/tools/restore/restore_main.cpp: Fixed compiler warnings ndb/tools/select_all.cpp: Removed not used variables ndb/tools/select_count.cpp: Removed not used variable server-tools/instance-manager/commands.h: Fixed compiler warnings server-tools/instance-manager/guardian.cc: Fixed compiler warnings server-tools/instance-manager/instance_options.cc: Removed not used variables server-tools/instance-manager/mysql_connection.cc: Fixed compiler warnings server-tools/instance-manager/options.cc: Fixed compiler warnings server-tools/instance-manager/options.h: Fixed compiler warnings server-tools/instance-manager/parse.cc: Removed not used variable server-tools/instance-manager/user_map.cc: Fixed compiler warnings server-tools/instance-manager/user_map.h: Fixed compiler warnings sql/field.cc: Fixed compiler warnings sql/field.h: Fixed compiler warnings sql/filesort.cc: Fixed compiler warnings sql/ha_archive.cc: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_archive.h: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_federated.cc: Fixed compiler warnings sql/ha_heap.cc: Fixed compiler warnings sql/ha_myisam.cc: Fixed compiler warnings sql/ha_myisammrg.cc: Fixed compiler warnings sql/ha_ndbcluster.cc: Fixed compiler warnings sql/handler.cc: Fixed compiler warnings sql/item.cc: Fixed compiler warnings sql/item.h: Fixed compiler warnings new_item() -> clone_item(), to avoid a lot of warnings with variable 'new_item' el() -> element_index() sql/item_cmpfunc.cc: Fixed compiler warnings sql/item_cmpfunc.h: Fixed compiler warnings sql/item_func.cc: Fixed compiler warnings sql/item_geofunc.cc: Fixed compiler warnings sql/item_row.h: Fixed compiler warnings sql/item_strfunc.cc: Fixed compiler warnings sql/item_subselect.cc: Fixed compiler warnings sql/item_subselect.h: Fixed compiler warnings sql/item_sum.cc: Fixed compiler warnings sql/item_timefunc.cc: Fixed compiler warnings sql/log.cc: Fixed compiler warnings More comments Added #ifdef HAVE_REPLICATION sql/log_event.cc: Fixed compiler warnings sql/log_event.h: Fixed compiler warnings sql/mysql_priv.h: query_id -> global_query_id, to avoid a lot of clashes with function and class variables start_time -> server_start_time sql/mysqld.cc: Fixed compiler warnings: - Removed not used variables - Added #ifndef EMBEDDED_LIBRARY - Fixed shadow warnings sql/net_serv.cc: Fixed compiler warnings sql/opt_range.cc: range -> last_range to avoid shadow warnings Removed not used function print_rowid() sql/opt_range.h: range -> last_range to avoid shadow warnings sql/password.c: Fixed compiler warnings sql/protocol.cc: Fixed compiler warnings sql/repl_failsafe.cc: Fixed compiler warnings sql/set_var.cc: Fixed compiler warnings sql/set_var.h: type() -> show_type() Fixed compiler warnings sql/slave.cc: Fixed compiler warnings sql/sp_head.cc: Fixed compiler warnings sql/sp_head.h: Fixed compiler warnings sql/spatial.cc: Fixed compiler warnings sql/spatial.h: length() -> geom_length() to avoid compiler warnings wkb_end -> wkb_last to avoid compiler warnings with local variables named 'wkb_end' sql/sql_cache.h: Fixed compiler warnings sql/sql_class.cc: Fixed compiler warnings sql/sql_class.h: log -> log_xid() to avoid compiler warnings Fixed shadow compiler warnings sql/sql_derived.cc: Removed not used variable sql/sql_insert.cc: Fixed compiler warnings sql/sql_lex.cc: Fixed compiler warnings sql/sql_lex.h: res -> saved_error to make the meaning of the variable clear and avoid shadow warnings sql/sql_load.cc: Fixed compiler warnings sql/sql_parse.cc: Fixed compiler warnings sql/sql_prepare.cc: Fixed compiler warnings sql/sql_select.cc: Fixed compiler warnings sql/sql_show.cc: Fixed compiler warnings sql/sql_string.cc: Fixed compiler warnings sql/sql_string.h: Fixed compiler warnings sql/sql_table.cc: Fixed compiler warnings sql/sql_trigger.cc: Fixed compiler warnings sql/sql_trigger.h: table -> trigger_table to avoid warnings from local variables sql/sql_union.cc: Fixed compiler warnings (mainly res -> saved_error) sql-common/client.c: Removed not used variable sql-common/my_time.c: Removed not used variable time -> my_time sql/sql_update.cc: Removed not used variable sql/sql_view.cc: Removed not used variable sql/sql_yacc.yy: Removed not used variable sql/table.cc: Removed not used variable sql/tztime.cc: Removed not used variable sql/unireg.cc: Removed not used variable strings/ctype-bin.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-cp932.c: Fixed compiler warnings strings/ctype-eucjpms.c: Fixed compiler warnings strings/ctype-mb.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-simple.c: mblen -> mb_len to avoid compiler warnings with local variable mblen exp -> exponent strings/ctype-sjis.c: Fixed compiler warnings strings/ctype-uca.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-ujis.c: Fixed compiler warnings strings/ctype-utf8.c: Fixed compiler warnings strings/decimal.c: Fixed compiler warnings strings/my_vsnprintf.c: Added comment strings/strtod.c: Fixed compiler warnings tests/mysql_client_test.c: Fixed compiler warnings (Biggest part of patch is to not get a conflict with global function 'bind')
2006-12-14 23:51:37 +01:00
Geometry::ci_collection+Geometry::wkb_last + 1;
Geometry::Class_info::Class_info(const char *name, const char *geojson_name,
int type_id, create_geom_t create_func):
This is an implementation of two WL items: - WL#3158: IM: Instance configuration extensions; - WL#3159: IM: --bootstrap and --start-default-instance modes The following new statements have been added: - CREATE INSTANCE; - DROP INSTANCE; The behaviour of the following statements have been changed: - SET; - UNSET; - FLUSH INSTANCES; - SHOW INSTANCES; - SHOW INSTANCE OPTIONS; BitKeeper/deleted/.del-im_options_set.imtest~b53d9d60e5684833: Delete: mysql-test/t/im_options_set.imtest BitKeeper/deleted/.del-im_options_set.result~59278f56be61d921: Delete: mysql-test/r/im_options_set.result BitKeeper/deleted/.del-im_options_unset.imtest~768eb186b51d0048: Delete: mysql-test/t/im_options_unset.imtest BitKeeper/deleted/.del-im_options_unset.result~20a4790cd3c70a4f: Delete: mysql-test/r/im_options_unset.result client/get_password.c: Change prototype to avoid casting when using C-strings (char *). include/m_string.h: Moved LEX_STRING to global header from sql/ to be accessible from all components (IM for one). include/my_sys.h: Added constants for modify_defaults_file(). include/mysql_com.h: Removed duplicated declarations. my_sys.h should be used instead. libmysql/get_password.c: Change prototype to avoid casting when using C-strings (char *). mysql-test/mysql-test-run.pl: Added environment variables to be used from tests. mysql-test/r/im_daemon_life_cycle.result: Column name has been changed in SHOW INSTANCES. mysql-test/r/im_life_cycle.result: 1. Column name has been changed in SHOW INSTANCES. 2. Removed redundant SHOW INSTANCE STATUS statements. mysql-test/r/im_utils.result: Updated the result file. mysql-test/t/im_daemon_life_cycle-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. mysql-test/t/im_daemon_life_cycle.imtest: Get Instance Manager and managed mysqld-instances enough time to start. mysql-test/t/im_life_cycle.imtest: 1. Polishing; 2. Fixed a test error in 1.1.2. mysql-test/t/im_utils.imtest: Get Instance Manager and managed mysqld-instances enough time to start. mysys/default.c: Pass the name of the section to the handler function as well. mysys/default_modify.c: Added REMOVE_SECTION functionality. server-tools/instance-manager/IMService.cpp: Polishing: be more verbose. server-tools/instance-manager/IMService.h: Polishing: added copyright. server-tools/instance-manager/Makefile.am: Added new files. server-tools/instance-manager/WindowsService.cpp: Polishing: according to The Coding Style, TRUE/FALSE must be used instead of true/false. server-tools/instance-manager/WindowsService.h: Polishing: added copyright. server-tools/instance-manager/command.h: Polishing: provide a comment for the main operation of "Command" class. server-tools/instance-manager/commands.cc: 1. Added support for CREATE INSTANCE, DROP INSTANCE statements; 2. Added "deprecated" column in output of SHOW INSTANCE OPTIONS; 3. Modified the behaviour of SET/UNSET, FLUSH INSTANCES statements; server-tools/instance-manager/commands.h: 1. Added support for CREATE INSTANCE, DROP INSTANCE statements; 2. Added "deprecated" column in output of SHOW INSTANCE OPTIONS; 3. Modified the behaviour of SET/UNSET, FLUSH INSTANCES statements; server-tools/instance-manager/guardian.cc: Added operations to retrieve state of managed instances. server-tools/instance-manager/guardian.h: Added operations to retrieve state of managed instances. server-tools/instance-manager/instance.cc: 1. Provided an operation to check validity of instance name. 2. Added an attribute to distiguish mysqld-instances, whose configuration should be kept backward-compatible. server-tools/instance-manager/instance.h: 1. Provided an operation to check validity of instance name. 2. Added an attribute to distiguish mysqld-instances, whose configuration should be kept backward-compatible. server-tools/instance-manager/instance_map.cc: 1. Used the operation to check validity of instance name; 2. Added operations to manage instances. server-tools/instance-manager/instance_map.h: Added operations to manage instances. server-tools/instance-manager/instance_options.cc: Changed Instance_options so that it will be possible to manage options on the fly. server-tools/instance-manager/instance_options.h: Changed Instance_options so that it will be possible to manage options on the fly. server-tools/instance-manager/listener.cc: 1. Remove reference to the instance of Options; 2. Use new Options naming scheme. server-tools/instance-manager/listener.h: Remove reference to the instance of Options; server-tools/instance-manager/log.cc: Polishing: use TRUE/FALSE instead of true/false. server-tools/instance-manager/manager.cc: Added a common for IM operation to work with configuration file. server-tools/instance-manager/manager.h: Added a common for IM operation to work with configuration file. server-tools/instance-manager/messages.cc: Added messages for new errors. server-tools/instance-manager/mysql_connection.cc: 1. Move a constant to common place. 2. Polishing. server-tools/instance-manager/mysql_manager_error.h: Added new errors. server-tools/instance-manager/mysqlmanager.cc: 1. Use error code from Options::load(); 2. Eliminate type-casting warning on Windows. server-tools/instance-manager/options.cc: Added support for user-management command-line options. server-tools/instance-manager/options.h: Added support for user-management command-line options. server-tools/instance-manager/parse.cc: 1. Added support of new statements: - CREATE INSTANCE; - DROP INSTANCE. 2. Modified SET/UNSET. server-tools/instance-manager/parse.h: 1. Added support of new statements: - CREATE INSTANCE; - DROP INSTANCE. 2. Modified SET/UNSET. server-tools/instance-manager/parse_output.cc: Sorted out header files. server-tools/instance-manager/parse_output.h: Sorted out header files. server-tools/instance-manager/portability.h: 1. Added constants for Windows. 2. Moved system-dependent defines from instance_options.cc. server-tools/instance-manager/priv.cc: Updated version. server-tools/instance-manager/priv.h: Added some global constants. server-tools/instance-manager/protocol.cc: Replaced NAME_WITH_LENGTH by LEX_STRING. server-tools/instance-manager/protocol.h: Replaced NAME_WITH_LENGTH by LEX_STRING. server-tools/instance-manager/thread_registry.cc: Polishing: use TRUE/FALSE instead of true/false. server-tools/instance-manager/user_map.cc: Added support for managing password database. server-tools/instance-manager/user_map.h: Added support for managing password database. sql/sp.cc: Replaced LEX_STRING_WITH_INIT by LEX_STRING + struct initialization. sql/sp_head.cc: Replaced LEX_STRING_WITH_INIT by LEX_STRING + struct initialization. sql/spatial.cc: Removed LEX_STRING_WITH_INIT. sql/spatial.h: Removed LEX_STRING_WITH_INIT. sql/sql_string.h: Moved STRING_WITH_LEN() macro out from sql (to m_string.h). sql/sql_trigger.cc: Moved STRING_WITH_LEN() macro out from sql (to m_string.h). sql/structs.h: Removed LEX_STRING_WITH_INIT. support-files/mysql.server.sh: Instruct Instance Manager to work in mysqld-safe compatible mode for backward compatibility. mysql-test/r/im_cmd_line.result: Added result file. mysql-test/r/im_instance_conf.result: Added result file. mysql-test/r/im_options.result: Added result file. mysql-test/t/im_cmd_line.imtest: IM command-line options test. mysql-test/t/im_instance_conf-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. mysql-test/t/im_instance_conf.imtest: Added a new test case for checking instance-management. mysql-test/t/im_life_cycle-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. mysql-test/t/im_options.imtest: Join im_options_set and im_options_unset and add new tests. mysql-test/t/im_utils-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. server-tools/instance-manager/exit_codes.h: New file for defining exit codes for user-management mode. server-tools/instance-manager/user_management_commands.cc: User-management commands implementation. server-tools/instance-manager/user_management_commands.h: User-management command declarations.
2006-05-18 16:57:50 +02:00
m_type_id(type_id), m_create_func(create_func)
{
This is an implementation of two WL items: - WL#3158: IM: Instance configuration extensions; - WL#3159: IM: --bootstrap and --start-default-instance modes The following new statements have been added: - CREATE INSTANCE; - DROP INSTANCE; The behaviour of the following statements have been changed: - SET; - UNSET; - FLUSH INSTANCES; - SHOW INSTANCES; - SHOW INSTANCE OPTIONS; BitKeeper/deleted/.del-im_options_set.imtest~b53d9d60e5684833: Delete: mysql-test/t/im_options_set.imtest BitKeeper/deleted/.del-im_options_set.result~59278f56be61d921: Delete: mysql-test/r/im_options_set.result BitKeeper/deleted/.del-im_options_unset.imtest~768eb186b51d0048: Delete: mysql-test/t/im_options_unset.imtest BitKeeper/deleted/.del-im_options_unset.result~20a4790cd3c70a4f: Delete: mysql-test/r/im_options_unset.result client/get_password.c: Change prototype to avoid casting when using C-strings (char *). include/m_string.h: Moved LEX_STRING to global header from sql/ to be accessible from all components (IM for one). include/my_sys.h: Added constants for modify_defaults_file(). include/mysql_com.h: Removed duplicated declarations. my_sys.h should be used instead. libmysql/get_password.c: Change prototype to avoid casting when using C-strings (char *). mysql-test/mysql-test-run.pl: Added environment variables to be used from tests. mysql-test/r/im_daemon_life_cycle.result: Column name has been changed in SHOW INSTANCES. mysql-test/r/im_life_cycle.result: 1. Column name has been changed in SHOW INSTANCES. 2. Removed redundant SHOW INSTANCE STATUS statements. mysql-test/r/im_utils.result: Updated the result file. mysql-test/t/im_daemon_life_cycle-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. mysql-test/t/im_daemon_life_cycle.imtest: Get Instance Manager and managed mysqld-instances enough time to start. mysql-test/t/im_life_cycle.imtest: 1. Polishing; 2. Fixed a test error in 1.1.2. mysql-test/t/im_utils.imtest: Get Instance Manager and managed mysqld-instances enough time to start. mysys/default.c: Pass the name of the section to the handler function as well. mysys/default_modify.c: Added REMOVE_SECTION functionality. server-tools/instance-manager/IMService.cpp: Polishing: be more verbose. server-tools/instance-manager/IMService.h: Polishing: added copyright. server-tools/instance-manager/Makefile.am: Added new files. server-tools/instance-manager/WindowsService.cpp: Polishing: according to The Coding Style, TRUE/FALSE must be used instead of true/false. server-tools/instance-manager/WindowsService.h: Polishing: added copyright. server-tools/instance-manager/command.h: Polishing: provide a comment for the main operation of "Command" class. server-tools/instance-manager/commands.cc: 1. Added support for CREATE INSTANCE, DROP INSTANCE statements; 2. Added "deprecated" column in output of SHOW INSTANCE OPTIONS; 3. Modified the behaviour of SET/UNSET, FLUSH INSTANCES statements; server-tools/instance-manager/commands.h: 1. Added support for CREATE INSTANCE, DROP INSTANCE statements; 2. Added "deprecated" column in output of SHOW INSTANCE OPTIONS; 3. Modified the behaviour of SET/UNSET, FLUSH INSTANCES statements; server-tools/instance-manager/guardian.cc: Added operations to retrieve state of managed instances. server-tools/instance-manager/guardian.h: Added operations to retrieve state of managed instances. server-tools/instance-manager/instance.cc: 1. Provided an operation to check validity of instance name. 2. Added an attribute to distiguish mysqld-instances, whose configuration should be kept backward-compatible. server-tools/instance-manager/instance.h: 1. Provided an operation to check validity of instance name. 2. Added an attribute to distiguish mysqld-instances, whose configuration should be kept backward-compatible. server-tools/instance-manager/instance_map.cc: 1. Used the operation to check validity of instance name; 2. Added operations to manage instances. server-tools/instance-manager/instance_map.h: Added operations to manage instances. server-tools/instance-manager/instance_options.cc: Changed Instance_options so that it will be possible to manage options on the fly. server-tools/instance-manager/instance_options.h: Changed Instance_options so that it will be possible to manage options on the fly. server-tools/instance-manager/listener.cc: 1. Remove reference to the instance of Options; 2. Use new Options naming scheme. server-tools/instance-manager/listener.h: Remove reference to the instance of Options; server-tools/instance-manager/log.cc: Polishing: use TRUE/FALSE instead of true/false. server-tools/instance-manager/manager.cc: Added a common for IM operation to work with configuration file. server-tools/instance-manager/manager.h: Added a common for IM operation to work with configuration file. server-tools/instance-manager/messages.cc: Added messages for new errors. server-tools/instance-manager/mysql_connection.cc: 1. Move a constant to common place. 2. Polishing. server-tools/instance-manager/mysql_manager_error.h: Added new errors. server-tools/instance-manager/mysqlmanager.cc: 1. Use error code from Options::load(); 2. Eliminate type-casting warning on Windows. server-tools/instance-manager/options.cc: Added support for user-management command-line options. server-tools/instance-manager/options.h: Added support for user-management command-line options. server-tools/instance-manager/parse.cc: 1. Added support of new statements: - CREATE INSTANCE; - DROP INSTANCE. 2. Modified SET/UNSET. server-tools/instance-manager/parse.h: 1. Added support of new statements: - CREATE INSTANCE; - DROP INSTANCE. 2. Modified SET/UNSET. server-tools/instance-manager/parse_output.cc: Sorted out header files. server-tools/instance-manager/parse_output.h: Sorted out header files. server-tools/instance-manager/portability.h: 1. Added constants for Windows. 2. Moved system-dependent defines from instance_options.cc. server-tools/instance-manager/priv.cc: Updated version. server-tools/instance-manager/priv.h: Added some global constants. server-tools/instance-manager/protocol.cc: Replaced NAME_WITH_LENGTH by LEX_STRING. server-tools/instance-manager/protocol.h: Replaced NAME_WITH_LENGTH by LEX_STRING. server-tools/instance-manager/thread_registry.cc: Polishing: use TRUE/FALSE instead of true/false. server-tools/instance-manager/user_map.cc: Added support for managing password database. server-tools/instance-manager/user_map.h: Added support for managing password database. sql/sp.cc: Replaced LEX_STRING_WITH_INIT by LEX_STRING + struct initialization. sql/sp_head.cc: Replaced LEX_STRING_WITH_INIT by LEX_STRING + struct initialization. sql/spatial.cc: Removed LEX_STRING_WITH_INIT. sql/spatial.h: Removed LEX_STRING_WITH_INIT. sql/sql_string.h: Moved STRING_WITH_LEN() macro out from sql (to m_string.h). sql/sql_trigger.cc: Moved STRING_WITH_LEN() macro out from sql (to m_string.h). sql/structs.h: Removed LEX_STRING_WITH_INIT. support-files/mysql.server.sh: Instruct Instance Manager to work in mysqld-safe compatible mode for backward compatibility. mysql-test/r/im_cmd_line.result: Added result file. mysql-test/r/im_instance_conf.result: Added result file. mysql-test/r/im_options.result: Added result file. mysql-test/t/im_cmd_line.imtest: IM command-line options test. mysql-test/t/im_instance_conf-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. mysql-test/t/im_instance_conf.imtest: Added a new test case for checking instance-management. mysql-test/t/im_life_cycle-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. mysql-test/t/im_options.imtest: Join im_options_set and im_options_unset and add new tests. mysql-test/t/im_utils-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. server-tools/instance-manager/exit_codes.h: New file for defining exit codes for user-management mode. server-tools/instance-manager/user_management_commands.cc: User-management commands implementation. server-tools/instance-manager/user_management_commands.h: User-management command declarations.
2006-05-18 16:57:50 +02:00
m_name.str= (char *) name;
m_name.length= strlen(name);
m_geojson_name.str= (char *) geojson_name;
m_geojson_name.length= strlen(geojson_name);
This is an implementation of two WL items: - WL#3158: IM: Instance configuration extensions; - WL#3159: IM: --bootstrap and --start-default-instance modes The following new statements have been added: - CREATE INSTANCE; - DROP INSTANCE; The behaviour of the following statements have been changed: - SET; - UNSET; - FLUSH INSTANCES; - SHOW INSTANCES; - SHOW INSTANCE OPTIONS; BitKeeper/deleted/.del-im_options_set.imtest~b53d9d60e5684833: Delete: mysql-test/t/im_options_set.imtest BitKeeper/deleted/.del-im_options_set.result~59278f56be61d921: Delete: mysql-test/r/im_options_set.result BitKeeper/deleted/.del-im_options_unset.imtest~768eb186b51d0048: Delete: mysql-test/t/im_options_unset.imtest BitKeeper/deleted/.del-im_options_unset.result~20a4790cd3c70a4f: Delete: mysql-test/r/im_options_unset.result client/get_password.c: Change prototype to avoid casting when using C-strings (char *). include/m_string.h: Moved LEX_STRING to global header from sql/ to be accessible from all components (IM for one). include/my_sys.h: Added constants for modify_defaults_file(). include/mysql_com.h: Removed duplicated declarations. my_sys.h should be used instead. libmysql/get_password.c: Change prototype to avoid casting when using C-strings (char *). mysql-test/mysql-test-run.pl: Added environment variables to be used from tests. mysql-test/r/im_daemon_life_cycle.result: Column name has been changed in SHOW INSTANCES. mysql-test/r/im_life_cycle.result: 1. Column name has been changed in SHOW INSTANCES. 2. Removed redundant SHOW INSTANCE STATUS statements. mysql-test/r/im_utils.result: Updated the result file. mysql-test/t/im_daemon_life_cycle-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. mysql-test/t/im_daemon_life_cycle.imtest: Get Instance Manager and managed mysqld-instances enough time to start. mysql-test/t/im_life_cycle.imtest: 1. Polishing; 2. Fixed a test error in 1.1.2. mysql-test/t/im_utils.imtest: Get Instance Manager and managed mysqld-instances enough time to start. mysys/default.c: Pass the name of the section to the handler function as well. mysys/default_modify.c: Added REMOVE_SECTION functionality. server-tools/instance-manager/IMService.cpp: Polishing: be more verbose. server-tools/instance-manager/IMService.h: Polishing: added copyright. server-tools/instance-manager/Makefile.am: Added new files. server-tools/instance-manager/WindowsService.cpp: Polishing: according to The Coding Style, TRUE/FALSE must be used instead of true/false. server-tools/instance-manager/WindowsService.h: Polishing: added copyright. server-tools/instance-manager/command.h: Polishing: provide a comment for the main operation of "Command" class. server-tools/instance-manager/commands.cc: 1. Added support for CREATE INSTANCE, DROP INSTANCE statements; 2. Added "deprecated" column in output of SHOW INSTANCE OPTIONS; 3. Modified the behaviour of SET/UNSET, FLUSH INSTANCES statements; server-tools/instance-manager/commands.h: 1. Added support for CREATE INSTANCE, DROP INSTANCE statements; 2. Added "deprecated" column in output of SHOW INSTANCE OPTIONS; 3. Modified the behaviour of SET/UNSET, FLUSH INSTANCES statements; server-tools/instance-manager/guardian.cc: Added operations to retrieve state of managed instances. server-tools/instance-manager/guardian.h: Added operations to retrieve state of managed instances. server-tools/instance-manager/instance.cc: 1. Provided an operation to check validity of instance name. 2. Added an attribute to distiguish mysqld-instances, whose configuration should be kept backward-compatible. server-tools/instance-manager/instance.h: 1. Provided an operation to check validity of instance name. 2. Added an attribute to distiguish mysqld-instances, whose configuration should be kept backward-compatible. server-tools/instance-manager/instance_map.cc: 1. Used the operation to check validity of instance name; 2. Added operations to manage instances. server-tools/instance-manager/instance_map.h: Added operations to manage instances. server-tools/instance-manager/instance_options.cc: Changed Instance_options so that it will be possible to manage options on the fly. server-tools/instance-manager/instance_options.h: Changed Instance_options so that it will be possible to manage options on the fly. server-tools/instance-manager/listener.cc: 1. Remove reference to the instance of Options; 2. Use new Options naming scheme. server-tools/instance-manager/listener.h: Remove reference to the instance of Options; server-tools/instance-manager/log.cc: Polishing: use TRUE/FALSE instead of true/false. server-tools/instance-manager/manager.cc: Added a common for IM operation to work with configuration file. server-tools/instance-manager/manager.h: Added a common for IM operation to work with configuration file. server-tools/instance-manager/messages.cc: Added messages for new errors. server-tools/instance-manager/mysql_connection.cc: 1. Move a constant to common place. 2. Polishing. server-tools/instance-manager/mysql_manager_error.h: Added new errors. server-tools/instance-manager/mysqlmanager.cc: 1. Use error code from Options::load(); 2. Eliminate type-casting warning on Windows. server-tools/instance-manager/options.cc: Added support for user-management command-line options. server-tools/instance-manager/options.h: Added support for user-management command-line options. server-tools/instance-manager/parse.cc: 1. Added support of new statements: - CREATE INSTANCE; - DROP INSTANCE. 2. Modified SET/UNSET. server-tools/instance-manager/parse.h: 1. Added support of new statements: - CREATE INSTANCE; - DROP INSTANCE. 2. Modified SET/UNSET. server-tools/instance-manager/parse_output.cc: Sorted out header files. server-tools/instance-manager/parse_output.h: Sorted out header files. server-tools/instance-manager/portability.h: 1. Added constants for Windows. 2. Moved system-dependent defines from instance_options.cc. server-tools/instance-manager/priv.cc: Updated version. server-tools/instance-manager/priv.h: Added some global constants. server-tools/instance-manager/protocol.cc: Replaced NAME_WITH_LENGTH by LEX_STRING. server-tools/instance-manager/protocol.h: Replaced NAME_WITH_LENGTH by LEX_STRING. server-tools/instance-manager/thread_registry.cc: Polishing: use TRUE/FALSE instead of true/false. server-tools/instance-manager/user_map.cc: Added support for managing password database. server-tools/instance-manager/user_map.h: Added support for managing password database. sql/sp.cc: Replaced LEX_STRING_WITH_INIT by LEX_STRING + struct initialization. sql/sp_head.cc: Replaced LEX_STRING_WITH_INIT by LEX_STRING + struct initialization. sql/spatial.cc: Removed LEX_STRING_WITH_INIT. sql/spatial.h: Removed LEX_STRING_WITH_INIT. sql/sql_string.h: Moved STRING_WITH_LEN() macro out from sql (to m_string.h). sql/sql_trigger.cc: Moved STRING_WITH_LEN() macro out from sql (to m_string.h). sql/structs.h: Removed LEX_STRING_WITH_INIT. support-files/mysql.server.sh: Instruct Instance Manager to work in mysqld-safe compatible mode for backward compatibility. mysql-test/r/im_cmd_line.result: Added result file. mysql-test/r/im_instance_conf.result: Added result file. mysql-test/r/im_options.result: Added result file. mysql-test/t/im_cmd_line.imtest: IM command-line options test. mysql-test/t/im_instance_conf-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. mysql-test/t/im_instance_conf.imtest: Added a new test case for checking instance-management. mysql-test/t/im_life_cycle-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. mysql-test/t/im_options.imtest: Join im_options_set and im_options_unset and add new tests. mysql-test/t/im_utils-im.opt: Set minimal monitoring interval for Instance Manager to speed up testing. server-tools/instance-manager/exit_codes.h: New file for defining exit codes for user-management mode. server-tools/instance-manager/user_management_commands.cc: User-management commands implementation. server-tools/instance-manager/user_management_commands.h: User-management command declarations.
2006-05-18 16:57:50 +02:00
ci_collection[type_id]= this;
}
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
static Geometry *create_point(char *buffer)
{
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
return new (buffer) Gis_point;
}
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
static Geometry *create_linestring(char *buffer)
{
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
return new (buffer) Gis_line_string;
}
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
static Geometry *create_polygon(char *buffer)
{
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
return new (buffer) Gis_polygon;
}
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
static Geometry *create_multipoint(char *buffer)
{
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
return new (buffer) Gis_multi_point;
}
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
static Geometry *create_multipolygon(char *buffer)
{
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
return new (buffer) Gis_multi_polygon;
}
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
static Geometry *create_multilinestring(char *buffer)
{
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
return new (buffer) Gis_multi_line_string;
}
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
static Geometry *create_geometrycollection(char *buffer)
{
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
return new (buffer) Gis_geometry_collection;
}
static Geometry::Class_info point_class("POINT", "Point",
Geometry::wkb_point, create_point);
static Geometry::Class_info linestring_class("LINESTRING", "LineString",
Geometry::wkb_linestring,
create_linestring);
static Geometry::Class_info polygon_class("POLYGON", "Polygon",
Geometry::wkb_polygon,
create_polygon);
static Geometry::Class_info multipoint_class("MULTIPOINT", "MultiPoint",
Geometry::wkb_multipoint,
create_multipoint);
static Geometry::Class_info
multilinestring_class("MULTILINESTRING", "MultiLineString",
Geometry::wkb_multilinestring, create_multilinestring);
static Geometry::Class_info multipolygon_class("MULTIPOLYGON", "MultiPolygon",
Geometry::wkb_multipolygon,
create_multipolygon);
static Geometry::Class_info
geometrycollection_class("GEOMETRYCOLLECTION", "GeometryCollection",
Geometry::wkb_geometrycollection,
create_geometrycollection);
static void get_point(double *x, double *y, const char *data)
{
float8get(*x, data);
float8get(*y, data + SIZEOF_STORED_DOUBLE);
}
/***************************** Geometry *******************************/
Geometry::Class_info *Geometry::find_class(const char *name, size_t len)
{
for (Class_info **cur_rt= ci_collection;
cur_rt < ci_collection_end; cur_rt++)
{
if (*cur_rt &&
((*cur_rt)->m_name.length == len) &&
(my_charset_latin1.strnncoll((*cur_rt)->m_name.str, len,
name, len) == 0))
return *cur_rt;
}
return 0;
}
2010-05-26 16:12:23 +02:00
Geometry *Geometry::create_by_typeid(Geometry_buffer *buffer, int type_id)
{
Class_info *ci;
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
if (!(ci= find_class(type_id)))
2010-05-26 16:12:23 +02:00
return NULL;
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
return (*ci->m_create_func)(buffer->data);
2010-05-26 16:12:23 +02:00
}
Geometry *Geometry::construct(Geometry_buffer *buffer,
const char *data, uint32 data_len)
{
uint32 geom_type;
Geometry *result;
if (data_len < SRID_SIZE + WKB_HEADER_SIZE) // < 4 + (1 + 4)
return NULL;
Bug#45288: pb2 returns a lot of compilation warnings on linux Fix warnings flagged by the new warning option -Wunused-but-set-variable that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The option causes a warning whenever a local variable is assigned to but is later unused. It also warns about meaningless pointer dereferences. client/mysql.cc: Meaningless pointer dereferences. client/mysql_upgrade.c: Check whether reading from the file succeeded. extra/comp_err.c: Unused. extra/yassl/src/yassl_imp.cpp: Skip instead of reading data that is discarded. include/my_pthread.h: Variable is only used in debug builds. include/mysys_err.h: Add new error messages. mysys/errors.c: Add new error message for permission related functions. mysys/mf_iocache.c: Variable is only checked under THREAD. mysys/my_copy.c: Raise a error if chmod or chown fails. mysys/my_redel.c: Raise a error if chmod or chown fails. regex/engine.c: Use a equivalent variable for the assert. server-tools/instance-manager/instance_options.cc: Unused. sql/field.cc: Unused. sql/item.cc: Unused. sql/log.cc: Do not ignore the return value of freopen: only set buffer if reopening succeeds. Adjust doxygen comment to the right function. Pass message lenght to log function. sql/mysqld.cc: Do not ignore the return value of freopen: only set buffer if reopening succeeds. sql/partition_info.cc: Unused. sql/slave.cc: No need to set pointer to the address of '\0'. sql/spatial.cc: Unused. Left for historical purposes. sql/sql_acl.cc: Unused. sql/sql_base.cc: Pointers are always set to the same variables. sql/sql_parse.cc: End statement if reading fails. Store the buffer after it has actually been updated. sql/sql_repl.cc: No need to set pointer to the address of '\0'. sql/sql_show.cc: Put variable under the same ifdef block. sql/udf_example.c: Set null pointer flag appropriately. storage/csv/ha_tina.cc: Meaningless dereferences. storage/example/ha_example.cc: Return the error since it's available. storage/myisam/mi_locking.c: Remove unused and dead code.
2010-07-20 20:07:36 +02:00
/* + 1 to skip the byte order (stored in position SRID_SIZE). */
geom_type= uint4korr(data + SRID_SIZE + 1);
if (!(result= create_by_typeid(buffer, (int) geom_type)))
return NULL;
result->m_data= data+ SRID_SIZE + WKB_HEADER_SIZE;
result->m_data_end= data + data_len;
return result;
}
uint Geometry::get_key_image_itMBR(LEX_CSTRING &src, uchar *buff, uint length)
{
const char *dummy;
MBR mbr;
Geometry_buffer buffer;
Geometry *gobj;
const uint image_length= SIZEOF_STORED_DOUBLE*4;
if (src.length < SRID_SIZE)
{
bzero(buff, image_length);
return image_length;
}
gobj= Geometry::construct(&buffer, (char*) src.str, (uint32) src.length);
if (!gobj || gobj->get_mbr(&mbr, &dummy))
bzero(buff, image_length);
else
{
float8store(buff, mbr.xmin);
float8store(buff+8, mbr.xmax);
float8store(buff+16, mbr.ymin);
float8store(buff+24, mbr.ymax);
}
return image_length;
}
Geometry *Geometry::create_from_wkt(Geometry_buffer *buffer,
Gis_read_stream *trs, String *wkt,
bool init_stream)
{
LEX_STRING name;
Class_info *ci;
char next_sym;
if (trs->get_next_word(&name))
{
trs->set_error_msg("Geometry name expected");
return NULL;
}
if (!(ci= find_class(name.str, name.length)) ||
wkt->reserve(1 + 4, 512))
return NULL;
Bug#42733: Type-punning warnings when compiling MySQL -- strict aliasing violations. Another rather noisy violation of strict aliasing rules is the spatial code which makes use of stack-based memory (of type Geometry_buffer) to provide placement for Geometry objects. Although a placement new is allowed to dynamically change the type of a object, the object returned by the new placement was being ignored and the original stack-based object was being casted to the new type, thus violating strict aliasing rules. The solution is to reorganize the code so that the object returned by the new placement is used instead of casting the original object. Also, to ensure that the stack-based object is properly aligned with respect to the objects it provides placement for, a set of compiler-dependent macros and types are introduced so that the alignment of objects can be inquired and specified. include/Makefile.am: Add new header. include/my_compiler.h: Add new header. include/my_global.h: Remove now-unnecessary macros. sql/spatial.cc: Make object creation functions return the object whose type was dynamically changed by the new placement. Move static method from the header in order to avoid having to access a forward declaration. sql/spatial.h: Object creation callbacks now take a array of chars as the storage area. Move create_by_typeid to a source file as to not access the forward declaration of Geometry_buffer. Ensure that Geometry_buffer is properly aligned. sql/sql_show.cc: Use newly added aligned storage helper.
2010-07-14 14:27:13 +02:00
Geometry *result= (*ci->m_create_func)(buffer->data);
wkt->q_append((char) wkb_ndr);
wkt->q_append((uint32) result->get_class_info()->m_type_id);
if (!(next_sym= trs->next_symbol()))
return NULL;
if (!(next_sym= trs->next_symbol()))
return NULL;
if ((next_sym == '(' && trs->check_next_symbol('(')) ||
result->init_from_wkt(trs, wkt) ||
(next_sym == '(' && trs->check_next_symbol(')')))
return NULL;
if (init_stream)
{
result->set_data_ptr(wkt->ptr(), wkt->length());
result->shift_wkb_header();
}
return result;
}
int Geometry::as_wkt(String *wkt, const char **end)
{
uint32 len= (uint) get_class_info()->m_name.length;
if (wkt->reserve(len + 2, 512))
return 1;
wkt->qs_append(get_class_info()->m_name.str, len);
if (get_class_info() != &geometrycollection_class)
wkt->qs_append('(');
if (get_data_as_wkt(wkt, end))
return 1;
if (get_class_info() != &geometrycollection_class)
wkt->qs_append(')');
return 0;
}
static const uchar type_keyname[]= "type";
2019-03-28 12:07:20 +01:00
static const uint type_keyname_len= 4;
static const uchar coord_keyname[]= "coordinates";
2019-03-28 12:07:20 +01:00
static const uint coord_keyname_len= 11;
static const uchar geometries_keyname[]= "geometries";
2019-03-28 12:07:20 +01:00
static const uint geometries_keyname_len= 10;
static const uchar features_keyname[]= "features";
2019-03-28 12:07:20 +01:00
static const uint features_keyname_len= 8;
static const uchar geometry_keyname[]= "geometry";
2019-03-28 12:07:20 +01:00
static const uint geometry_keyname_len= 8;
2019-03-28 12:07:20 +01:00
static const uint max_keyname_len= 11; /*'coordinates' keyname is the longest.*/
static const uchar feature_type[]= "feature";
static const int feature_type_len= 7;
static const uchar feature_coll_type[]= "featurecollection";
static const int feature_coll_type_len= 17;
static const uchar bbox_keyname[]= "bbox";
static const int bbox_keyname_len= 4;
int Geometry::as_json(String *wkt, uint max_dec_digits, const char **end)
{
uint32 len= (uint) get_class_info()->m_geojson_name.length;
if (wkt->reserve(4 + type_keyname_len + 2 + len + 2 + 2 +
coord_keyname_len + 4, 512))
return 1;
wkt->qs_append("\"", 1);
wkt->qs_append((const char *) type_keyname, type_keyname_len);
wkt->qs_append("\": \"", 4);
wkt->qs_append(get_class_info()->m_geojson_name.str, len);
wkt->qs_append("\", \"", 4);
if (get_class_info() == &geometrycollection_class)
wkt->qs_append((const char *) geometries_keyname, geometries_keyname_len);
else
wkt->qs_append((const char *) coord_keyname, coord_keyname_len);
wkt->qs_append("\": ", 3);
if (get_data_as_json(wkt, max_dec_digits, end))
return 1;
return 0;
}
int Geometry::bbox_as_json(String *wkt)
{
MBR mbr;
const char *end;
if (wkt->reserve(5 + bbox_keyname_len + (FLOATING_POINT_DECIMALS+2)*4, 512))
return 1;
wkt->qs_append("\"", 1);
wkt->qs_append((const char *) bbox_keyname, bbox_keyname_len);
wkt->qs_append("\": [", 4);
if (get_mbr(&mbr, &end))
return 1;
wkt->qs_append(mbr.xmin);
wkt->qs_append(", ", 2);
wkt->qs_append(mbr.ymin);
wkt->qs_append(", ", 2);
wkt->qs_append(mbr.xmax);
wkt->qs_append(", ", 2);
wkt->qs_append(mbr.ymax);
wkt->qs_append("]", 1);
return 0;
}
static double wkb_get_double(const char *ptr, Geometry::wkbByteOrder bo)
{
double res;
if (bo != Geometry::wkb_xdr)
{
float8get(res, ptr);
}
else
{
char inv_array[8];
inv_array[0]= ptr[7];
inv_array[1]= ptr[6];
inv_array[2]= ptr[5];
inv_array[3]= ptr[4];
inv_array[4]= ptr[3];
inv_array[5]= ptr[2];
inv_array[6]= ptr[1];
inv_array[7]= ptr[0];
float8get(res, inv_array);
}
return res;
}
static uint32 wkb_get_uint(const char *ptr, Geometry::wkbByteOrder bo)
{
if (bo != Geometry::wkb_xdr)
return uint4korr(ptr);
/* else */
{
char inv_array[4];
inv_array[0]= ptr[3];
inv_array[1]= ptr[2];
inv_array[2]= ptr[1];
inv_array[3]= ptr[0];
return uint4korr(inv_array);
}
}
Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL Having maybe_null flag unset for geometry/spatial functions leads to wrong Item_func_isnull::val_int()'s results. Fix: set maybe_null flag and add is_null() methods. mysql-test/r/gis.result: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - test result. mysql-test/t/gis.test: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - test case. sql/item_geofunc.cc: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - set maybe_null flag for Item_geometry_func and Item_func_as_wkt. - moved length check to the beginnig of the Item_func_spatial_collection::val_str() to affect geometry collection objects at once. - changed Item_func_isempty::val_int() and Item_func_issimple::val_int() to properly handle null_value. sql/item_geofunc.h: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - set maybe_null flag for geometry/spatial functions. - added is_null() to Item_geometry_func and Item_func_spatial_rel classes. sql/spatial.cc: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - changed return type of Geometry::create_from_wkb() to be consistent with Geometry::create_from_wkt(), now it returns Geometry object or NULL in case of error. sql/spatial.h: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - changed return type of Geometry::create_from_wkb() to be consistent with Geometry::create_from_wkt(), now it returns Geometry object or NULL in case of error.
2007-02-21 11:45:19 +01:00
Geometry *Geometry::create_from_wkb(Geometry_buffer *buffer,
const char *wkb, uint32 len, String *res)
{
uint32 geom_type;
Geometry *geom;
if (len < WKB_HEADER_SIZE)
Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL Having maybe_null flag unset for geometry/spatial functions leads to wrong Item_func_isnull::val_int()'s results. Fix: set maybe_null flag and add is_null() methods. mysql-test/r/gis.result: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - test result. mysql-test/t/gis.test: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - test case. sql/item_geofunc.cc: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - set maybe_null flag for Item_geometry_func and Item_func_as_wkt. - moved length check to the beginnig of the Item_func_spatial_collection::val_str() to affect geometry collection objects at once. - changed Item_func_isempty::val_int() and Item_func_issimple::val_int() to properly handle null_value. sql/item_geofunc.h: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - set maybe_null flag for geometry/spatial functions. - added is_null() to Item_geometry_func and Item_func_spatial_rel classes. sql/spatial.cc: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - changed return type of Geometry::create_from_wkb() to be consistent with Geometry::create_from_wkt(), now it returns Geometry object or NULL in case of error. sql/spatial.h: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - changed return type of Geometry::create_from_wkb() to be consistent with Geometry::create_from_wkt(), now it returns Geometry object or NULL in case of error.
2007-02-21 11:45:19 +01:00
return NULL;
geom_type= wkb_get_uint(wkb+1, (wkbByteOrder)wkb[0]);
if (!(geom= create_by_typeid(buffer, (int) geom_type)) ||
res->reserve(WKB_HEADER_SIZE, 512))
Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL Having maybe_null flag unset for geometry/spatial functions leads to wrong Item_func_isnull::val_int()'s results. Fix: set maybe_null flag and add is_null() methods. mysql-test/r/gis.result: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - test result. mysql-test/t/gis.test: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - test case. sql/item_geofunc.cc: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - set maybe_null flag for Item_geometry_func and Item_func_as_wkt. - moved length check to the beginnig of the Item_func_spatial_collection::val_str() to affect geometry collection objects at once. - changed Item_func_isempty::val_int() and Item_func_issimple::val_int() to properly handle null_value. sql/item_geofunc.h: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - set maybe_null flag for geometry/spatial functions. - added is_null() to Item_geometry_func and Item_func_spatial_rel classes. sql/spatial.cc: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - changed return type of Geometry::create_from_wkb() to be consistent with Geometry::create_from_wkt(), now it returns Geometry object or NULL in case of error. sql/spatial.h: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - changed return type of Geometry::create_from_wkb() to be consistent with Geometry::create_from_wkt(), now it returns Geometry object or NULL in case of error.
2007-02-21 11:45:19 +01:00
return NULL;
res->q_append((char) wkb_ndr);
res->q_append(geom_type);
Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL Having maybe_null flag unset for geometry/spatial functions leads to wrong Item_func_isnull::val_int()'s results. Fix: set maybe_null flag and add is_null() methods. mysql-test/r/gis.result: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - test result. mysql-test/t/gis.test: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - test case. sql/item_geofunc.cc: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - set maybe_null flag for Item_geometry_func and Item_func_as_wkt. - moved length check to the beginnig of the Item_func_spatial_collection::val_str() to affect geometry collection objects at once. - changed Item_func_isempty::val_int() and Item_func_issimple::val_int() to properly handle null_value. sql/item_geofunc.h: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - set maybe_null flag for geometry/spatial functions. - added is_null() to Item_geometry_func and Item_func_spatial_rel classes. sql/spatial.cc: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - changed return type of Geometry::create_from_wkb() to be consistent with Geometry::create_from_wkt(), now it returns Geometry object or NULL in case of error. sql/spatial.h: Fix for bug #26038: X() value of empty NOT NULL POINT is neither NULL nor NOT NULL - changed return type of Geometry::create_from_wkb() to be consistent with Geometry::create_from_wkt(), now it returns Geometry object or NULL in case of error.
2007-02-21 11:45:19 +01:00
return geom->init_from_wkb(wkb + WKB_HEADER_SIZE, len - WKB_HEADER_SIZE,
(wkbByteOrder) wkb[0], res) ? geom : NULL;
}
Geometry *Geometry::create_from_json(Geometry_buffer *buffer,
json_engine_t *je, bool er_on_3D, String *res)
{
Class_info *ci= NULL;
const uchar *coord_start= NULL, *geom_start= NULL,
*features_start= NULL, *geometry_start= NULL;
Geometry *result;
uchar key_buf[max_keyname_len];
uint key_len;
int fcoll_type_found= 0, feature_type_found= 0;
if (json_read_value(je))
goto err_return;
if (je->value_type != JSON_VALUE_OBJECT)
{
je->s.error= GEOJ_INCORRECT_GEOJSON;
goto err_return;
}
while (json_scan_next(je) == 0 && je->state != JST_OBJ_END)
{
DBUG_ASSERT(je->state == JST_KEY);
key_len=0;
while (json_read_keyname_chr(je) == 0)
{
if (je->s.c_next > 127 || key_len >= max_keyname_len)
{
/* Symbol out of range, or keyname too long. No need to compare.. */
key_len=0;
break;
}
key_buf[key_len++]= (uchar)je->s.c_next | 0x20; /* make it lowercase. */
}
if (unlikely(je->s.error))
goto err_return;
if (key_len == type_keyname_len &&
memcmp(key_buf, type_keyname, type_keyname_len) == 0)
{
/*
Found the "type" key. Let's check it's a string and remember
the feature's type.
*/
if (json_read_value(je))
goto err_return;
if (je->value_type == JSON_VALUE_STRING)
{
if ((ci= find_class((const char *) je->value, je->value_len)))
{
if ((coord_start=
(ci == &geometrycollection_class) ? geom_start : coord_start))
goto create_geom;
}
else if (je->value_len == feature_coll_type_len &&
my_charset_latin1.strnncoll(je->value, je->value_len,
feature_coll_type, feature_coll_type_len) == 0)
{
/*
'FeatureCollection' type found. Handle the 'Featurecollection'/'features'
GeoJSON construction.
*/
if (features_start)
goto handle_feature_collection;
fcoll_type_found= 1;
}
else if (je->value_len == feature_type_len &&
my_charset_latin1.strnncoll(je->value, je->value_len,
feature_type, feature_type_len) == 0)
{
if (geometry_start)
goto handle_geometry_key;
feature_type_found= 1;
}
else /* can't understand the type. */
break;
}
else /* The "type" value can only be string. */
break;
}
else if (key_len == coord_keyname_len &&
memcmp(key_buf, coord_keyname, coord_keyname_len) == 0)
{
/*
Found the "coordinates" key. Let's check it's an array
and remember where it starts.
*/
if (json_read_value(je))
goto err_return;
if (je->value_type == JSON_VALUE_ARRAY)
{
coord_start= je->value_begin;
if (ci && ci != &geometrycollection_class)
goto create_geom;
if (json_skip_level(je))
goto err_return;
}
}
else if (key_len == geometries_keyname_len &&
memcmp(key_buf, geometries_keyname, geometries_keyname_len) == 0)
{
/*
Found the "geometries" key. Let's check it's an array
and remember where it starts.
*/
if (json_read_value(je))
goto err_return;
if (je->value_type == JSON_VALUE_ARRAY)
{
geom_start= je->value_begin;
if (ci == &geometrycollection_class)
{
coord_start= geom_start;
goto create_geom;
}
}
}
else if (key_len == features_keyname_len &&
memcmp(key_buf, features_keyname, features_keyname_len) == 0)
{
/*
'features' key found. Handle the 'Featurecollection'/'features'
GeoJSON construction.
*/
if (json_read_value(je))
goto err_return;
if (je->value_type == JSON_VALUE_ARRAY)
{
features_start= je->value_begin;
if (fcoll_type_found)
goto handle_feature_collection;
}
}
else if (key_len == geometry_keyname_len &&
memcmp(key_buf, geometry_keyname, geometry_keyname_len) == 0)
{
if (json_read_value(je))
goto err_return;
if (je->value_type == JSON_VALUE_OBJECT)
{
geometry_start= je->value_begin;
if (feature_type_found)
goto handle_geometry_key;
}
else
goto err_return;
}
else
{
if (json_skip_key(je))
goto err_return;
}
}
if (je->s.error == 0)
{
/*
We didn't find all the required keys. That are "type" and "coordinates"
or "geometries" for GeometryCollection.
*/
je->s.error= GEOJ_INCORRECT_GEOJSON;
}
goto err_return;
handle_feature_collection:
ci= &geometrycollection_class;
coord_start= features_start;
create_geom:
json_scan_start(je, je->s.cs, coord_start, je->s.str_end);
if (res->reserve(1 + 4, 512))
goto err_return;
result= (*ci->m_create_func)(buffer->data);
res->q_append((char) wkb_ndr);
res->q_append((uint32) result->get_class_info()->m_type_id);
if (result->init_from_json(je, er_on_3D, res))
goto err_return;
return result;
handle_geometry_key:
json_scan_start(je, je->s.cs, geometry_start, je->s.str_end);
return create_from_json(buffer, je, er_on_3D, res);
err_return:
return NULL;
}
Geometry *Geometry::create_from_opresult(Geometry_buffer *g_buf,
2011-05-04 20:20:17 +02:00
String *res, Gcalc_result_receiver &rr)
{
uint32 geom_type= rr.get_result_typeid();
Geometry *obj= create_by_typeid(g_buf, geom_type);
if (!obj || res->reserve(WKB_HEADER_SIZE, 512))
return NULL;
2011-05-04 20:20:17 +02:00
res->q_append((char) wkb_ndr);
res->q_append(geom_type);
return obj->init_from_opresult(res, rr.result(), rr.length()) ? obj : NULL;
2011-05-04 20:20:17 +02:00
}
bool Geometry::envelope(String *result) const
{
MBR mbr;
const char *end;
if (get_mbr(&mbr, &end))
return 1;
if (!mbr.valid())
{
/* Empty geometry */
if (result->reserve(1 + 4*2))
return 1;
result->q_append((char) wkb_ndr);
result->q_append((uint32) wkb_geometrycollection);
result->q_append((uint32) 0);
return 0;
}
if (result->reserve(1 + 4 * 3 + SIZEOF_STORED_DOUBLE * 10))
return 1;
result->q_append((char) wkb_ndr);
result->q_append((uint32) wkb_polygon);
result->q_append((uint32) 1);
result->q_append((uint32) 5);
result->q_append(mbr.xmin);
result->q_append(mbr.ymin);
result->q_append(mbr.xmax);
result->q_append(mbr.ymin);
result->q_append(mbr.xmax);
result->q_append(mbr.ymax);
result->q_append(mbr.xmin);
result->q_append(mbr.ymax);
result->q_append(mbr.xmin);
result->q_append(mbr.ymin);
return 0;
}
/*
Create a point from data.
SYNPOSIS
create_point()
result Put result here
data Data for point is here.
RETURN
0 ok
1 Can't reallocate 'result'
*/
bool Geometry::create_point(String *result, const char *data) const
{
2011-05-04 20:20:17 +02:00
if (no_data(data, POINT_DATA_SIZE) ||
result->reserve(1 + 4 + POINT_DATA_SIZE))
return 1;
result->q_append((char) wkb_ndr);
result->q_append((uint32) wkb_point);
/* Copy two double in same format */
2011-05-04 20:20:17 +02:00
result->q_append(data, POINT_DATA_SIZE);
return 0;
}
/*
Create a point from coordinates.
SYNPOSIS
create_point()
result Put result here
x x coordinate for point
y y coordinate for point
RETURN
0 ok
1 Can't reallocate 'result'
*/
bool Geometry::create_point(String *result, double x, double y)
{
2011-05-04 20:20:17 +02:00
if (result->reserve(1 + 4 + POINT_DATA_SIZE))
return 1;
result->q_append((char) wkb_ndr);
result->q_append((uint32) wkb_point);
result->q_append(x);
result->q_append(y);
return 0;
}
/*
Append N points from packed format to text
SYNOPSIS
append_points()
txt Append points here
n_points Number of points
data Packed data
offset Offset between points
RETURN
# end of data
*/
const char *Geometry::append_points(String *txt, uint32 n_points,
const char *data, uint32 offset) const
{
while (n_points--)
{
double x,y;
data+= offset;
get_point(&x, &y, data);
2011-05-04 20:20:17 +02:00
data+= POINT_DATA_SIZE;
txt->qs_append(x);
txt->qs_append(' ');
txt->qs_append(y);
txt->qs_append(',');
}
return data;
}
static void append_json_point(String *txt, uint max_dec, const char *data)
{
double x,y;
get_point(&x, &y, data);
if (max_dec < FLOATING_POINT_DECIMALS)
{
x= my_double_round(x, max_dec, FALSE, FALSE);
y= my_double_round(y, max_dec, FALSE, FALSE);
}
txt->qs_append('[');
txt->qs_append(x);
txt->qs_append(", ", 2);
txt->qs_append(y);
txt->qs_append(']');
}
/*
Append N points from packed format to json
SYNOPSIS
append_json_points()
txt Append points here
n_points Number of points
data Packed data
offset Offset between points
RETURN
# end of data
*/
static const char *append_json_points(String *txt, uint max_dec,
uint32 n_points, const char *data, uint32 offset)
{
txt->qs_append('[');
while (n_points--)
{
data+= offset;
append_json_point(txt, max_dec, data);
data+= POINT_DATA_SIZE;
txt->qs_append(", ", 2);
}
txt->length(txt->length() - 2);// Remove ending ', '
txt->qs_append(']');
return data;
}
/*
Get most bounding rectangle (mbr) for X points
SYNOPSIS
get_mbr_for_points()
mbr MBR (store rectangle here)
points Number of points
data Packed data
offset Offset between points
RETURN
0 Wrong data
# end of data
*/
const char *Geometry::get_mbr_for_points(MBR *mbr, const char *data,
uint offset) const
{
uint32 points;
/* read number of points */
if (no_data(data, 4))
return 0;
points= uint4korr(data);
data+= 4;
if (not_enough_points(data, points, offset))
return 0;
/* Calculate MBR for points */
while (points--)
{
data+= offset;
mbr->add_xy(data, data + SIZEOF_STORED_DOUBLE);
2011-05-04 20:20:17 +02:00
data+= POINT_DATA_SIZE;
}
return data;
}
/***************************** Point *******************************/
uint32 Gis_point::get_data_size() const
{
return POINT_DATA_SIZE;
}
bool Gis_point::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
double x, y;
if (trs->get_next_number(&x) || trs->get_next_number(&y) ||
wkb->reserve(POINT_DATA_SIZE, 512))
return 1;
wkb->q_append(x);
wkb->q_append(y);
return 0;
}
uint Gis_point::init_from_wkb(const char *wkb, uint len,
wkbByteOrder bo, String *res)
{
double x, y;
if (len < POINT_DATA_SIZE || res->reserve(POINT_DATA_SIZE))
return 0;
x= wkb_get_double(wkb, bo);
y= wkb_get_double(wkb + SIZEOF_STORED_DOUBLE, bo);
res->q_append(x);
res->q_append(y);
return POINT_DATA_SIZE;
}
static int read_point_from_json(json_engine_t *je, bool er_on_3D,
double *x, double *y)
{
int n_coord= 0, err;
double tmp, *d;
char *endptr;
while (json_scan_next(je) == 0 && je->state != JST_ARRAY_END)
{
DBUG_ASSERT(je->state == JST_VALUE);
if (json_read_value(je))
return 1;
if (je->value_type != JSON_VALUE_NUMBER)
goto bad_coordinates;
d= (n_coord == 0) ? x : ((n_coord == 1) ? y : &tmp);
*d= je->s.cs->strntod((char *) je->value, je->value_len, &endptr, &err);
if (err)
goto bad_coordinates;
n_coord++;
}
if (n_coord <= 2 || !er_on_3D)
return 0;
je->s.error= Geometry::GEOJ_DIMENSION_NOT_SUPPORTED;
return 1;
bad_coordinates:
je->s.error= Geometry::GEOJ_INCORRECT_GEOJSON;
return 1;
}
bool Gis_point::init_from_json(json_engine_t *je, bool er_on_3D, String *wkb)
{
double x, y;
if (json_read_value(je))
return TRUE;
if (je->value_type != JSON_VALUE_ARRAY)
{
je->s.error= GEOJ_INCORRECT_GEOJSON;
return TRUE;
}
if (read_point_from_json(je, er_on_3D, &x, &y) ||
wkb->reserve(POINT_DATA_SIZE))
return TRUE;
wkb->q_append(x);
wkb->q_append(y);
return FALSE;
}
bool Gis_point::get_data_as_wkt(String *txt, const char **end) const
{
double x, y;
if (get_xy(&x, &y))
return 1;
if (txt->reserve(MAX_DIGITS_IN_DOUBLE * 2 + 1))
return 1;
txt->qs_append(x);
txt->qs_append(' ');
txt->qs_append(y);
*end= m_data+ POINT_DATA_SIZE;
return 0;
}
bool Gis_point::get_data_as_json(String *txt, uint max_dec_digits,
const char **end) const
{
if (txt->reserve(MAX_DIGITS_IN_DOUBLE * 2 + 4))
return 1;
append_json_point(txt, max_dec_digits, m_data);
*end= m_data+ POINT_DATA_SIZE;
return 0;
}
bool Gis_point::get_mbr(MBR *mbr, const char **end) const
{
double x, y;
if (get_xy(&x, &y))
return 1;
mbr->add_xy(x, y);
*end= m_data+ POINT_DATA_SIZE;
return 0;
}
2011-05-04 20:20:17 +02:00
int Gis_point::area(double *ar, const char **end) const
{
*ar= 0;
*end= m_data+ POINT_DATA_SIZE;
return 0;
}
int Gis_point::geom_length(double *len, const char **end) const
{
*len= 0;
*end= m_data+ POINT_DATA_SIZE;
return 0;
}
2011-05-04 20:20:17 +02:00
int Gis_point::store_shapes(Gcalc_shape_transporter *trn) const
{
double x, y;
return get_xy(&x, &y) || trn->single_point(x, y);
}
const Geometry::Class_info *Gis_point::get_class_info() const
{
return &point_class;
}
/**
Function to calculate haversine.
Taking as arguments Point and Multipoint geometries.
Multipoint geometry has to be single point only.
It is up to caller to ensure valid input.
@param g pointer to the Geometry
@param r sphere radius
@param error pointer describing the error in case of the boundary conditions
@return distance in case without error, it is caclulcated distance (non-negative),
in case error exist, negative value.
*/
double Gis_point::calculate_haversine(const Geometry *g,
const double sphere_radius,
int *error)
{
DBUG_ASSERT(sphere_radius > 0);
double x1r, x2r, y1r, y2r;
// This check is done only for optimization purposes where we know it will
// be one and only one point in Multipoint
if (g->get_class_info()->m_type_id == Geometry::wkb_multipoint)
{
const char point_size= 4 + WKB_HEADER_SIZE + POINT_DATA_SIZE+1; //1 for the type
char point_temp[point_size];
memset(point_temp+4, Geometry::wkb_point, 1);
memcpy(point_temp+5, static_cast<const Gis_multi_point *>(g)->get_data_ptr()+5, 4);
memcpy(point_temp+4+WKB_HEADER_SIZE, g->get_data_ptr()+4+WKB_HEADER_SIZE,
POINT_DATA_SIZE);
point_temp[point_size-1]= '\0';
Geometry_buffer gbuff;
Geometry *gg= Geometry::construct(&gbuff, point_temp, point_size-1);
if (!gg || static_cast<Gis_point *>(gg)->get_xy_radian(&x2r, &y2r))
{
*error= 2;
return -1;
}
}
else
{
if (static_cast<const Gis_point *>(g)->get_xy_radian(&x2r, &y2r))
{
*error= 2;
return -1;
}
}
if (this->get_xy_radian(&x1r, &y1r))
{
*error= 2;
return -1;
}
//
// Check boundary conditions: longitude[-180,180]
if (!((x2r >= -M_PI && x2r <= M_PI) && (x1r >= -M_PI && x1r <= M_PI)))
{
*error=1;
return -1;
}
// Check boundary conditions: latitude[-90,90]
if (!((y2r >= -M_PI/2 && y2r <= M_PI/2) && (y1r >= -M_PI/2 && y1r <= M_PI/2)))
{
*error=-1;
return -1;
}
double dlat= sin((y2r - y1r)/2)*sin((y2r - y1r)/2);
double dlong= sin((x2r - x1r)/2)*sin((x2r - x1r)/2);
return 2*sphere_radius*asin((sqrt(dlat + cos(y1r)*cos(y2r)*dlong)));
}
/**
Function that calculate spherical distance of Point from Multipoint geometries.
In case there is single point in Multipoint geometries calculate_haversine()
can handle such case. Otherwise, new geometry (Point) has to be constructed.
@param g pointer to the Geometry
@param r sphere radius
@param result pointer to the result
@param err pointer to the error obtained from calculate_haversin()
@return state
@retval TRUE failed
@retval FALSE success
*/
int Gis_point::spherical_distance_multipoints(Geometry *g, const double r,
double *result, int *err)
{
uint32 num_of_points2;
// To find the minimum radius it cannot be greater than Earth radius
double res= 6370986.0;
double temp_res= 0.0;
const uint32 len= 4 + WKB_HEADER_SIZE + POINT_DATA_SIZE + 1;
char s[len];
g->num_geometries(&num_of_points2);
DBUG_ASSERT(num_of_points2 >= 1);
if (num_of_points2 == 1)
{
*result= this->calculate_haversine(g, r, err);
return 0;
}
for (uint32 i=1; i <= num_of_points2; i++)
{
Geometry_buffer buff_temp;
Geometry *temp;
const char *pt_ptr= g->get_data_ptr()+
4+WKB_HEADER_SIZE*i + POINT_DATA_SIZE*(i-1);
// First 4 bytes are handled already, make sure to create a Point
memset(s + 4, Geometry::wkb_point, 1);
if (g->no_data(pt_ptr, POINT_DATA_SIZE))
return 1;
memcpy(s + 5, g->get_data_ptr() + 5, 4);
memcpy(s + 4 + WKB_HEADER_SIZE, pt_ptr, POINT_DATA_SIZE);
s[len-1]= '\0';
temp= Geometry::construct(&buff_temp, s, len);
if (!temp)
return 1;
temp_res= this->calculate_haversine(temp, r, err);
if (res > temp_res)
res= temp_res;
}
*result= res;
return 0;
}
/***************************** LineString *******************************/
uint32 Gis_line_string::get_data_size() const
{
uint32 n_points;
if (no_data(m_data, 4))
return GET_SIZE_ERROR;
n_points= uint4korr(m_data);
if (not_enough_points(m_data + 4, n_points))
return GET_SIZE_ERROR;
return 4 + n_points * POINT_DATA_SIZE;
}
bool Gis_line_string::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
uint32 n_points= 0;
uint32 np_pos= wkb->length();
Gis_point p;
if (wkb->reserve(4, 512))
return 1;
wkb->length(wkb->length()+4); // Reserve space for points
for (;;)
{
if (p.init_from_wkt(trs, wkb))
return 1;
n_points++;
if (trs->skip_char(',')) // Didn't find ','
break;
}
if (n_points < 1)
{
trs->set_error_msg("Too few points in LINESTRING");
return 1;
}
wkb->write_at_position(np_pos, n_points);
return 0;
}
uint Gis_line_string::init_from_wkb(const char *wkb, uint len,
wkbByteOrder bo, String *res)
{
uint32 n_points, proper_length;
const char *wkb_end;
Gis_point p;
if (len < 4 || (n_points= wkb_get_uint(wkb, bo)) < 1 ||
((len - 4) / POINT_DATA_SIZE) < n_points)
return 0;
proper_length= 4 + n_points * POINT_DATA_SIZE;
2011-05-04 20:20:17 +02:00
if (len < proper_length || res->reserve(proper_length))
return 0;
res->q_append(n_points);
wkb_end= wkb + proper_length;
for (wkb+= 4; wkb<wkb_end; wkb+= POINT_DATA_SIZE)
{
if (!p.init_from_wkb(wkb, POINT_DATA_SIZE, bo, res))
return 0;
}
return proper_length;
}
bool Gis_line_string::init_from_json(json_engine_t *je, bool er_on_3D,
String *wkb)
{
uint32 n_points= 0;
uint32 np_pos= wkb->length();
Gis_point p;
if (json_read_value(je))
return TRUE;
if (je->value_type != JSON_VALUE_ARRAY)
{
je->s.error= GEOJ_INCORRECT_GEOJSON;
return TRUE;
}
if (wkb->reserve(4, 512))
return TRUE;
wkb->length(wkb->length()+4); // Reserve space for n_points
while (json_scan_next(je) == 0 && je->state != JST_ARRAY_END)
{
DBUG_ASSERT(je->state == JST_VALUE);
if (p.init_from_json(je, er_on_3D, wkb))
return TRUE;
n_points++;
}
if (n_points < 1)
{
je->s.error= Geometry::GEOJ_TOO_FEW_POINTS;
return TRUE;
}
wkb->write_at_position(np_pos, n_points);
return FALSE;
}
bool Gis_line_string::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_points;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
data += 4;
if (n_points < 1 ||
not_enough_points(data, n_points) ||
txt->reserve(((MAX_DIGITS_IN_DOUBLE + 1)*2 + 1) * n_points))
return 1;
while (n_points--)
{
double x, y;
get_point(&x, &y, data);
2011-05-04 20:20:17 +02:00
data+= POINT_DATA_SIZE;
txt->qs_append(x);
txt->qs_append(' ');
txt->qs_append(y);
txt->qs_append(',');
}
txt->length(txt->length() - 1); // Remove end ','
*end= data;
return 0;
}
bool Gis_line_string::get_data_as_json(String *txt, uint max_dec_digits,
const char **end) const
{
uint32 n_points;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
data += 4;
if (n_points < 1 ||
not_enough_points(data, n_points) ||
txt->reserve((MAX_DIGITS_IN_DOUBLE*2 + 6) * n_points + 2))
return 1;
*end= append_json_points(txt, max_dec_digits, n_points, data, 0);
return 0;
}
bool Gis_line_string::get_mbr(MBR *mbr, const char **end) const
{
return (*end=get_mbr_for_points(mbr, m_data, 0)) == 0;
}
int Gis_line_string::geom_length(double *len, const char **end) const
{
uint32 n_points;
double prev_x, prev_y;
const char *data= m_data;
*len= 0; // In case of errors
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
data+= 4;
if (n_points < 1 || not_enough_points(data, n_points))
return 1;
get_point(&prev_x, &prev_y, data);
2011-05-04 20:20:17 +02:00
data+= POINT_DATA_SIZE;
while (--n_points)
{
double x, y;
get_point(&x, &y, data);
2011-05-04 20:20:17 +02:00
data+= POINT_DATA_SIZE;
*len+= sqrt(pow(prev_x-x,2)+pow(prev_y-y,2));
prev_x= x;
prev_y= y;
}
*end= data;
return 0;
}
int Gis_line_string::area(double *ar, const char **end) const
{
uint32 n_points;
*ar= 0.0;
/* read number of points */
if (no_data(m_data, 4))
return 1;
n_points= uint4korr(m_data);
*end= m_data + 4 + POINT_DATA_SIZE * n_points;
return 0;
}
int Gis_line_string::is_closed(int *closed) const
{
uint32 n_points;
double x1, y1, x2, y2;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
if (n_points == 1)
{
*closed=1;
return 0;
}
data+= 4;
if (n_points == 0 || not_enough_points(data, n_points))
return 1;
/* Get first point */
get_point(&x1, &y1, data);
/* get last point */
2011-05-04 20:20:17 +02:00
data+= POINT_DATA_SIZE + (n_points-2)*POINT_DATA_SIZE;
get_point(&x2, &y2, data);
*closed= (x1==x2) && (y1==y2);
return 0;
}
int Gis_line_string::num_points(uint32 *n_points) const
{
*n_points= uint4korr(m_data);
return 0;
}
int Gis_line_string::start_point(String *result) const
{
/* +4 is for skipping over number of points */
return create_point(result, m_data + 4);
}
int Gis_line_string::end_point(String *result) const
{
uint32 n_points;
if (no_data(m_data, 4))
return 1;
n_points= uint4korr(m_data);
if (n_points == 0 || not_enough_points(m_data+4, n_points))
return 1;
return create_point(result, m_data + 4 + (n_points - 1) * POINT_DATA_SIZE);
}
int Gis_line_string::point_n(uint32 num, String *result) const
{
uint32 n_points;
if (no_data(m_data, 4))
return 1;
num--;
n_points= uint4korr(m_data);
if (num >= n_points || not_enough_points(m_data+4, n_points))
return 1;
return create_point(result, m_data + 4 + num*POINT_DATA_SIZE);
}
2011-05-04 20:20:17 +02:00
int Gis_line_string::store_shapes(Gcalc_shape_transporter *trn) const
{
uint32 n_points;
double x, y;
2011-11-27 17:46:20 +01:00
double UNINIT_VAR(prev_x), UNINIT_VAR(prev_y);
2011-09-01 08:44:56 +02:00
int first_point= 1;
2011-05-04 20:20:17 +02:00
const char *data= m_data;
if (no_data(m_data, 4))
return 1;
n_points= uint4korr(data);
data+= 4;
if (n_points < 1 || not_enough_points(data, n_points))
2011-05-04 20:20:17 +02:00
return 1;
trn->start_line();
while (n_points--)
{
get_point(&x, &y, data);
data+= POINT_DATA_SIZE;
2011-09-01 08:44:56 +02:00
if (!first_point && x == prev_x && y == prev_y)
continue;
2011-05-04 20:20:17 +02:00
if (trn->add_point(x, y))
return 1;
2011-09-01 08:44:56 +02:00
first_point= 0;
prev_x= x;
prev_y= y;
2011-05-04 20:20:17 +02:00
}
return trn->complete_line();
}
const Geometry::Class_info *Gis_line_string::get_class_info() const
{
return &linestring_class;
}
/***************************** Polygon *******************************/
uint32 Gis_polygon::get_data_size() const
{
uint32 n_linear_rings;
uint32 n_points;
const char *data= m_data;
if (no_data(data, 4))
return GET_SIZE_ERROR;
n_linear_rings= uint4korr(data);
data+= 4;
while (n_linear_rings--)
{
if (no_data(data, 4) ||
not_enough_points(data+4, n_points= uint4korr(data)))
return GET_SIZE_ERROR;
data+= 4 + n_points*POINT_DATA_SIZE;
}
if (no_data(data, 0))
return GET_SIZE_ERROR;
return (uint32) (data - m_data);
}
bool Gis_polygon::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
uint32 n_linear_rings= 0;
uint32 lr_pos= wkb->length();
int closed;
if (wkb->reserve(4, 512))
return 1;
wkb->length(wkb->length()+4); // Reserve space for n_rings
for (;;)
{
Gis_line_string ls;
uint32 ls_pos=wkb->length();
if (trs->check_next_symbol('(') ||
ls.init_from_wkt(trs, wkb) ||
trs->check_next_symbol(')'))
return 1;
ls.set_data_ptr(wkb->ptr() + ls_pos, wkb->length() - ls_pos);
if (ls.is_closed(&closed) || !closed)
{
trs->set_error_msg("POLYGON's linear ring isn't closed");
return 1;
}
n_linear_rings++;
if (trs->skip_char(',')) // Didn't find ','
break;
}
wkb->write_at_position(lr_pos, n_linear_rings);
return 0;
}
uint Gis_polygon::init_from_opresult(String *bin,
const char *opres, uint res_len)
2011-05-04 20:20:17 +02:00
{
const char *opres_orig= opres;
uint32 position= bin->length();
uint32 poly_shapes= 0;
2011-05-04 20:20:17 +02:00
if (bin->reserve(4, 512))
return 0;
bin->q_append(poly_shapes);
2011-05-04 20:20:17 +02:00
while (opres_orig + res_len > opres)
2011-05-04 20:20:17 +02:00
{
uint32 n_points, proper_length;
const char *op_end, *p1_position;
Gis_point p;
Gcalc_function::shape_type st;
st= (Gcalc_function::shape_type) uint4korr(opres);
if (poly_shapes && st != Gcalc_function::shape_hole)
2011-05-04 20:20:17 +02:00
break;
poly_shapes++;
2011-05-04 20:20:17 +02:00
n_points= uint4korr(opres + 4) + 1; /* skip shape type id */
proper_length= 4 + n_points * POINT_DATA_SIZE;
if (bin->reserve(proper_length, 512))
return 0;
bin->q_append(n_points);
op_end= opres + 8 + (n_points-1) * 8 * 2;
p1_position= (opres+= 8);
for (; opres<op_end; opres+= POINT_DATA_SIZE)
{
if (!p.init_from_wkb(opres, POINT_DATA_SIZE, wkb_ndr, bin))
return 0;
}
if (!p.init_from_wkb(p1_position, POINT_DATA_SIZE, wkb_ndr, bin))
return 0;
}
bin->write_at_position(position, poly_shapes);
2011-05-04 20:20:17 +02:00
return (uint) (opres - opres_orig);
}
uint Gis_polygon::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
String *res)
{
uint32 n_linear_rings;
const char *wkb_orig= wkb;
if (len < 4)
return 0;
if (!(n_linear_rings= wkb_get_uint(wkb, bo)))
return 0;
if (res->reserve(4, 512))
return 0;
wkb+= 4;
len-= 4;
res->q_append(n_linear_rings);
while (n_linear_rings--)
{
Gis_line_string ls;
uint32 ls_pos= res->length();
int ls_len;
int closed;
if (!(ls_len= ls.init_from_wkb(wkb, len, bo, res)))
return 0;
ls.set_data_ptr(res->ptr() + ls_pos, res->length() - ls_pos);
if (ls.is_closed(&closed) || !closed)
return 0;
wkb+= ls_len;
}
return (uint) (wkb - wkb_orig);
}
bool Gis_polygon::init_from_json(json_engine_t *je, bool er_on_3D, String *wkb)
{
uint32 n_linear_rings= 0;
uint32 lr_pos= wkb->length();
int closed;
if (json_read_value(je))
return TRUE;
if (je->value_type != JSON_VALUE_ARRAY)
{
je->s.error= GEOJ_INCORRECT_GEOJSON;
return TRUE;
}
if (wkb->reserve(4, 512))
return TRUE;
wkb->length(wkb->length()+4); // Reserve space for n_rings
while (json_scan_next(je) == 0 && je->state != JST_ARRAY_END)
{
Gis_line_string ls;
DBUG_ASSERT(je->state == JST_VALUE);
uint32 ls_pos=wkb->length();
if (ls.init_from_json(je, er_on_3D, wkb))
return TRUE;
ls.set_data_ptr(wkb->ptr() + ls_pos, wkb->length() - ls_pos);
if (ls.is_closed(&closed) || !closed)
{
je->s.error= GEOJ_POLYGON_NOT_CLOSED;
return TRUE;
}
n_linear_rings++;
}
if (je->s.error)
return TRUE;
if (n_linear_rings == 0)
{
je->s.error= Geometry::GEOJ_EMPTY_COORDINATES;
return TRUE;
}
wkb->write_at_position(lr_pos, n_linear_rings);
return FALSE;
}
bool Gis_polygon::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_linear_rings;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_linear_rings= uint4korr(data);
data+= 4;
while (n_linear_rings--)
{
uint32 n_points;
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
data+= 4;
if (not_enough_points(data, n_points) ||
txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
return 1;
txt->qs_append('(');
data= append_points(txt, n_points, data, 0);
(*txt) [txt->length() - 1]= ')'; // Replace end ','
txt->qs_append(',');
}
txt->length(txt->length() - 1); // Remove end ','
*end= data;
return 0;
}
bool Gis_polygon::get_data_as_json(String *txt, uint max_dec_digits,
const char **end) const
{
uint32 n_linear_rings;
const char *data= m_data;
if (no_data(data, 4) || txt->reserve(1, 512))
return 1;
n_linear_rings= uint4korr(data);
data+= 4;
txt->qs_append('[');
while (n_linear_rings--)
{
uint32 n_points;
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
data+= 4;
if (not_enough_points(data, n_points) ||
txt->reserve(4 + (MAX_DIGITS_IN_DOUBLE * 2 + 6) * n_points))
return 1;
data= append_json_points(txt, max_dec_digits, n_points, data, 0);
txt->qs_append(", ", 2);
}
txt->length(txt->length() - 2);// Remove ending ', '
txt->qs_append(']');
*end= data;
return 0;
}
bool Gis_polygon::get_mbr(MBR *mbr, const char **end) const
{
uint32 n_linear_rings;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_linear_rings= uint4korr(data);
data+= 4;
while (n_linear_rings--)
{
if (!(data= get_mbr_for_points(mbr, data, 0)))
return 1;
}
*end= data;
return 0;
}
int Gis_polygon::area(double *ar, const char **end_of_data) const
{
uint32 n_linear_rings;
double result= -1.0;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_linear_rings= uint4korr(data);
data+= 4;
while (n_linear_rings--)
{
double prev_x, prev_y;
double lr_area= 0;
uint32 n_points;
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
if (n_points == 0 ||
not_enough_points(data, n_points))
return 1;
get_point(&prev_x, &prev_y, data+4);
2011-05-04 20:20:17 +02:00
data+= (4+POINT_DATA_SIZE);
while (--n_points) // One point is already read
{
double x, y;
get_point(&x, &y, data);
2011-05-04 20:20:17 +02:00
data+= POINT_DATA_SIZE;
lr_area+= (prev_x + x)* (prev_y - y);
prev_x= x;
prev_y= y;
}
lr_area= fabs(lr_area)/2;
if (result == -1.0)
result= lr_area;
else
result-= lr_area;
}
*ar= fabs(result);
*end_of_data= data;
return 0;
}
int Gis_polygon::exterior_ring(String *result) const
{
uint32 n_points, length;
const char *data= m_data + 4; // skip n_linerings
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
data+= 4;
length= n_points * POINT_DATA_SIZE;
if (not_enough_points(data, n_points) || result->reserve(1+4+4+ length))
return 1;
result->q_append((char) wkb_ndr);
result->q_append((uint32) wkb_linestring);
result->q_append(n_points);
result->q_append(data, n_points * POINT_DATA_SIZE);
return 0;
}
int Gis_polygon::num_interior_ring(uint32 *n_int_rings) const
{
if (no_data(m_data, 4))
return 1;
*n_int_rings= uint4korr(m_data)-1;
return 0;
}
int Gis_polygon::interior_ring_n(uint32 num, String *result) const
{
const char *data= m_data;
uint32 n_linear_rings;
uint32 n_points;
uint32 points_size;
if (no_data(data, 4))
return 1;
n_linear_rings= uint4korr(data);
data+= 4;
if (num >= n_linear_rings || num < 1)
return 1;
while (num--)
{
if (no_data(data, 4))
return 1;
data+= 4 + uint4korr(data) * POINT_DATA_SIZE;
}
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
points_size= n_points * POINT_DATA_SIZE;
data+= 4;
if (not_enough_points(data, n_points) || result->reserve(1+4+4+ points_size))
return 1;
result->q_append((char) wkb_ndr);
result->q_append((uint32) wkb_linestring);
result->q_append(n_points);
result->q_append(data, points_size);
return 0;
}
int Gis_polygon::centroid_xy(double *x, double *y) const
{
uint32 n_linear_rings;
double UNINIT_VAR(res_area);
double UNINIT_VAR(res_cx), UNINIT_VAR(res_cy);
const char *data= m_data;
bool first_loop= 1;
if (no_data(data, 4) ||
(n_linear_rings= uint4korr(data)) == 0)
return 1;
data+= 4;
while (n_linear_rings--)
{
uint32 n_points, org_n_points;
double prev_x, prev_y;
double cur_area= 0;
double cur_cx= 0, cur_cy= 0;
double sum_cx= 0, sum_cy= 0;
if (no_data(data, 4))
return 1;
org_n_points= n_points= uint4korr(data);
data+= 4;
if (n_points == 0 || not_enough_points(data, n_points))
return 1;
get_point(&prev_x, &prev_y, data);
2011-05-04 20:20:17 +02:00
data+= POINT_DATA_SIZE;
while (--n_points) // One point is already read
{
Fixed compiler warnings detected by option -Wshadow and -Wunused: - Removed not used variables and functions - Added #ifdef around code that is not used - Renamed variables and functions to avoid conflicts - Removed some not used arguments Fixed some class/struct warnings in ndb Added define IS_LONGDATA() to simplify code in libmysql.c I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes BUILD/SETUP.sh: Added printing of unused functions and variables. Made it easy to test compiling with -Wshadow BUILD/compile-pentium-gcov: Added warnings Mark binary with -gcov client/mysql.cc: Fixed warnings found with gcc -Wshadow client/mysql_upgrade.c: Fixed warnings found with gcc -Wshadow client/mysqlbinlog.cc: Fixed warnings found with gcc -Wshadow client/mysqldump.c: Fixed warnings found with gcc -Wshadow client/mysqltest.c: Fixed warnings found with gcc -Wshadow client/sql_string.cc: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.cc client/sql_string.h: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.h cmd-line-utils/readline/display.c: Fixed compiler warning cmd-line-utils/readline/histexpand.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/input.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/text.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/vi_mode.c: Fixed warnings found with gcc -Wshadow dbug/dbug_analyze.c: Fixed warnings found with gcc -Wshadow extra/my_print_defaults.c: Prefixed defaults_extra_file and defaults_group_suffix with 'my' to avoid conflicts with similar named local variables extra/yassl/include/buffer.hpp: Fixed compiler warnings extra/yassl/include/crypto_wrapper.hpp: Fixed compiler warnings extra/yassl/include/yassl_imp.hpp: Fixed compiler warnings extra/yassl/include/yassl_int.hpp: Fixed compiler warnings extra/yassl/src/crypto_wrapper.cpp: Fixed compiler warnings extra/yassl/taocrypt/benchmark/benchmark.cpp: Fixed warnings found with gcc -Wshadow extra/yassl/taocrypt/include/algebra.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/des.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hash.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hmac.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modarith.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modes.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/rsa.hpp: Fixed compiler warnings extra/yassl/taocrypt/mySTL/list.hpp: Fixed compiler warnings extra/yassl/taocrypt/src/aes.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/algebra.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/asn.cpp: Fixed compiler warnings extra/yassl/taocrypt/test/test.cpp: Fixed compiler warnings extra/yassl/testsuite/testsuite.cpp: Fixed compiler warnings include/m_ctype.h: Fixed warnings found with gcc -Wshadow include/my_pthread.h: Fixed warnings found with gcc -Wshadow include/my_sys.h: Fixed warnings found with gcc -Wshadow include/my_time.h: Fixed warnings found with gcc -Wshadow include/mysql.h: Fixed warnings found with gcc -Wshadow Added define IS_LONGDATA() to simplify code in libmysql.c libmysql/libmysql.c: Fixed warnings found with gcc -Wshadow (Mostly replaced bind -> my_bind and time -> my_time) libmysqld/lib_sql.cc: Removed not used variables and labels myisam/ft_boolean_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_open.c: Fixed warnings found with gcc -Wshadow myisam/mi_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_unique.c: Fixed compiler warning myisam/myisampack.c: Fixed warnings found with gcc -Wshadow myisam/rt_index.c: Remove not used variables myisam/sort.c: Fixed warnings found with gcc -Wshadow mysql-test/r/mysqlcheck.result: Remove databases and tables possible left by previous test mysql-test/r/mysqltest.result: New test results mysql-test/t/mysql.test: Coverage tests mysql-test/t/mysqlbinlog.test: Coverage tests mysql-test/t/mysqlcheck.test: Remove databases and tables possible left by previous test mysql-test/t/mysqltest.test: Coverage tests mysys/default.c: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions mysys/mf_iocache2.c: Fixed warnings found with gcc -Wshadow mysys/mf_keycache.c: Fixed warnings found with gcc -Wshadow mysys/my_bitmap.c: Fixed warnings found with gcc -Wshadow mysys/sha1.c: Fixed warnings found with gcc -Wshadow ndb/include/kernel/signaldata/ArbitSignalData.hpp: Fixed compiler warning ndb/include/kernel/signaldata/DictTabInfo.hpp: Fixed compiler warnings ndb/include/ndbapi/NdbReceiver.hpp: Fixed warnings found with gcc -Wshadow ndb/include/transporter/TransporterDefinitions.hpp: Fixed compiler warning ndb/include/util/InputStream.hpp: Fixed compiler warning ndb/include/util/OutputStream.hpp: Fixed compiler warning ndb/include/util/SimpleProperties.hpp: Fixed compiler warning ndb/include/util/SocketAuthenticator.hpp: Fixed compiler warning ndb/include/util/SocketServer.hpp: Fixed compiler warning ndb/src/common/mgmcommon/ConfigRetriever.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/portlib/NdbTick.c: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/SHM_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.hpp: Fixed compiler warning ndb/src/common/transporter/Transporter.cpp: Removed not used variable ndb/src/common/transporter/TransporterRegistry.cpp: Removed not used variable ndb/src/common/util/Bitmask.cpp: Moved function to avoid warnings of not used function ndb/src/common/util/ConfigValues.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/File.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/Properties.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/SocketClient.cpp: Fixed wrong return value ndb/src/common/util/random.c: Fixed warnings found with gcc -Wshadow ndb/src/common/util/socket_io.cpp: Fixed warnings found with gcc -Wshadow ndb/src/cw/cpcd/APIService.cpp: Removed not used variable ndb/src/cw/cpcd/main.cpp: Removed not used variables ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Removed not used variables ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Removed not used variables ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: Removed not used variable ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: Removed not used variables ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Removed not used variables ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/Qmgr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.hpp: Fixed compiler warnings ndb/src/kernel/vm/MetaData.hpp: Fixed compiler warnings ndb/src/mgmapi/LocalConfig.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmapi/mgmapi.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmclient/CommandInterpreter.cpp: Removed not used variables ndb/src/mgmsrv/ConfigInfo.cpp: Fixed warnings found with gcc -Wshadow Removed not used variables ndb/src/mgmsrv/ConfigInfo.hpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmsrv/InitConfigFileParser.cpp: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions ndb/src/mgmsrv/MgmtSrvr.cpp: Removed not used variables and functions ndb/src/mgmsrv/MgmtSrvr.hpp: Fixed compiler warnings ndb/src/mgmsrv/Services.cpp: Removed not used variables and functions ndb/src/mgmsrv/main.cpp: Removed not used variable ndb/src/ndbapi/ClusterMgr.hpp: Fixed compiler warnings ndb/src/ndbapi/Ndb.cpp: Removed not used variables ndb/src/ndbapi/NdbBlob.cpp: Removed not used variables ndb/src/ndbapi/NdbDictionaryImpl.cpp: Removed not used variables ndb/src/ndbapi/NdbIndexOperation.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationDefine.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationExec.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationSearch.cpp: Removed not used variables ndb/src/ndbapi/NdbScanFilter.cpp: Fixed compiler warning ndb/src/ndbapi/NdbScanOperation.cpp: Removed not used variables ndb/src/ndbapi/SignalSender.cpp: Removed not used variables ndb/src/ndbapi/ndb_cluster_connection.cpp: Removed not used variable ndb/tools/delete_all.cpp: Removed not used variable ndb/tools/desc.cpp: Removed not used variable ndb/tools/drop_index.cpp: Removed not used variable ndb/tools/drop_tab.cpp: Removed not used variable ndb/tools/listTables.cpp: Removed not used variable ndb/tools/ndb_config.cpp: Fixed warnings found with gcc -Wshadow Added missing puts(desc) ndb/tools/restore/Restore.hpp: Changed delimiter to define instead of static variable, as the static variable caused a LOT of compiler warnings Fixed compiler warning ndb/tools/restore/consumer.hpp: Fixed compiler warning ndb/tools/restore/restore_main.cpp: Fixed compiler warnings ndb/tools/select_all.cpp: Removed not used variables ndb/tools/select_count.cpp: Removed not used variable server-tools/instance-manager/commands.h: Fixed compiler warnings server-tools/instance-manager/guardian.cc: Fixed compiler warnings server-tools/instance-manager/instance_options.cc: Removed not used variables server-tools/instance-manager/mysql_connection.cc: Fixed compiler warnings server-tools/instance-manager/options.cc: Fixed compiler warnings server-tools/instance-manager/options.h: Fixed compiler warnings server-tools/instance-manager/parse.cc: Removed not used variable server-tools/instance-manager/user_map.cc: Fixed compiler warnings server-tools/instance-manager/user_map.h: Fixed compiler warnings sql/field.cc: Fixed compiler warnings sql/field.h: Fixed compiler warnings sql/filesort.cc: Fixed compiler warnings sql/ha_archive.cc: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_archive.h: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_federated.cc: Fixed compiler warnings sql/ha_heap.cc: Fixed compiler warnings sql/ha_myisam.cc: Fixed compiler warnings sql/ha_myisammrg.cc: Fixed compiler warnings sql/ha_ndbcluster.cc: Fixed compiler warnings sql/handler.cc: Fixed compiler warnings sql/item.cc: Fixed compiler warnings sql/item.h: Fixed compiler warnings new_item() -> clone_item(), to avoid a lot of warnings with variable 'new_item' el() -> element_index() sql/item_cmpfunc.cc: Fixed compiler warnings sql/item_cmpfunc.h: Fixed compiler warnings sql/item_func.cc: Fixed compiler warnings sql/item_geofunc.cc: Fixed compiler warnings sql/item_row.h: Fixed compiler warnings sql/item_strfunc.cc: Fixed compiler warnings sql/item_subselect.cc: Fixed compiler warnings sql/item_subselect.h: Fixed compiler warnings sql/item_sum.cc: Fixed compiler warnings sql/item_timefunc.cc: Fixed compiler warnings sql/log.cc: Fixed compiler warnings More comments Added #ifdef HAVE_REPLICATION sql/log_event.cc: Fixed compiler warnings sql/log_event.h: Fixed compiler warnings sql/mysql_priv.h: query_id -> global_query_id, to avoid a lot of clashes with function and class variables start_time -> server_start_time sql/mysqld.cc: Fixed compiler warnings: - Removed not used variables - Added #ifndef EMBEDDED_LIBRARY - Fixed shadow warnings sql/net_serv.cc: Fixed compiler warnings sql/opt_range.cc: range -> last_range to avoid shadow warnings Removed not used function print_rowid() sql/opt_range.h: range -> last_range to avoid shadow warnings sql/password.c: Fixed compiler warnings sql/protocol.cc: Fixed compiler warnings sql/repl_failsafe.cc: Fixed compiler warnings sql/set_var.cc: Fixed compiler warnings sql/set_var.h: type() -> show_type() Fixed compiler warnings sql/slave.cc: Fixed compiler warnings sql/sp_head.cc: Fixed compiler warnings sql/sp_head.h: Fixed compiler warnings sql/spatial.cc: Fixed compiler warnings sql/spatial.h: length() -> geom_length() to avoid compiler warnings wkb_end -> wkb_last to avoid compiler warnings with local variables named 'wkb_end' sql/sql_cache.h: Fixed compiler warnings sql/sql_class.cc: Fixed compiler warnings sql/sql_class.h: log -> log_xid() to avoid compiler warnings Fixed shadow compiler warnings sql/sql_derived.cc: Removed not used variable sql/sql_insert.cc: Fixed compiler warnings sql/sql_lex.cc: Fixed compiler warnings sql/sql_lex.h: res -> saved_error to make the meaning of the variable clear and avoid shadow warnings sql/sql_load.cc: Fixed compiler warnings sql/sql_parse.cc: Fixed compiler warnings sql/sql_prepare.cc: Fixed compiler warnings sql/sql_select.cc: Fixed compiler warnings sql/sql_show.cc: Fixed compiler warnings sql/sql_string.cc: Fixed compiler warnings sql/sql_string.h: Fixed compiler warnings sql/sql_table.cc: Fixed compiler warnings sql/sql_trigger.cc: Fixed compiler warnings sql/sql_trigger.h: table -> trigger_table to avoid warnings from local variables sql/sql_union.cc: Fixed compiler warnings (mainly res -> saved_error) sql-common/client.c: Removed not used variable sql-common/my_time.c: Removed not used variable time -> my_time sql/sql_update.cc: Removed not used variable sql/sql_view.cc: Removed not used variable sql/sql_yacc.yy: Removed not used variable sql/table.cc: Removed not used variable sql/tztime.cc: Removed not used variable sql/unireg.cc: Removed not used variable strings/ctype-bin.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-cp932.c: Fixed compiler warnings strings/ctype-eucjpms.c: Fixed compiler warnings strings/ctype-mb.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-simple.c: mblen -> mb_len to avoid compiler warnings with local variable mblen exp -> exponent strings/ctype-sjis.c: Fixed compiler warnings strings/ctype-uca.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-ujis.c: Fixed compiler warnings strings/ctype-utf8.c: Fixed compiler warnings strings/decimal.c: Fixed compiler warnings strings/my_vsnprintf.c: Added comment strings/strtod.c: Fixed compiler warnings tests/mysql_client_test.c: Fixed compiler warnings (Biggest part of patch is to not get a conflict with global function 'bind')
2006-12-14 23:51:37 +01:00
double tmp_x, tmp_y;
double loc_area;
Fixed compiler warnings detected by option -Wshadow and -Wunused: - Removed not used variables and functions - Added #ifdef around code that is not used - Renamed variables and functions to avoid conflicts - Removed some not used arguments Fixed some class/struct warnings in ndb Added define IS_LONGDATA() to simplify code in libmysql.c I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes BUILD/SETUP.sh: Added printing of unused functions and variables. Made it easy to test compiling with -Wshadow BUILD/compile-pentium-gcov: Added warnings Mark binary with -gcov client/mysql.cc: Fixed warnings found with gcc -Wshadow client/mysql_upgrade.c: Fixed warnings found with gcc -Wshadow client/mysqlbinlog.cc: Fixed warnings found with gcc -Wshadow client/mysqldump.c: Fixed warnings found with gcc -Wshadow client/mysqltest.c: Fixed warnings found with gcc -Wshadow client/sql_string.cc: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.cc client/sql_string.h: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.h cmd-line-utils/readline/display.c: Fixed compiler warning cmd-line-utils/readline/histexpand.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/input.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/text.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/vi_mode.c: Fixed warnings found with gcc -Wshadow dbug/dbug_analyze.c: Fixed warnings found with gcc -Wshadow extra/my_print_defaults.c: Prefixed defaults_extra_file and defaults_group_suffix with 'my' to avoid conflicts with similar named local variables extra/yassl/include/buffer.hpp: Fixed compiler warnings extra/yassl/include/crypto_wrapper.hpp: Fixed compiler warnings extra/yassl/include/yassl_imp.hpp: Fixed compiler warnings extra/yassl/include/yassl_int.hpp: Fixed compiler warnings extra/yassl/src/crypto_wrapper.cpp: Fixed compiler warnings extra/yassl/taocrypt/benchmark/benchmark.cpp: Fixed warnings found with gcc -Wshadow extra/yassl/taocrypt/include/algebra.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/des.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hash.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hmac.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modarith.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modes.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/rsa.hpp: Fixed compiler warnings extra/yassl/taocrypt/mySTL/list.hpp: Fixed compiler warnings extra/yassl/taocrypt/src/aes.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/algebra.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/asn.cpp: Fixed compiler warnings extra/yassl/taocrypt/test/test.cpp: Fixed compiler warnings extra/yassl/testsuite/testsuite.cpp: Fixed compiler warnings include/m_ctype.h: Fixed warnings found with gcc -Wshadow include/my_pthread.h: Fixed warnings found with gcc -Wshadow include/my_sys.h: Fixed warnings found with gcc -Wshadow include/my_time.h: Fixed warnings found with gcc -Wshadow include/mysql.h: Fixed warnings found with gcc -Wshadow Added define IS_LONGDATA() to simplify code in libmysql.c libmysql/libmysql.c: Fixed warnings found with gcc -Wshadow (Mostly replaced bind -> my_bind and time -> my_time) libmysqld/lib_sql.cc: Removed not used variables and labels myisam/ft_boolean_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_open.c: Fixed warnings found with gcc -Wshadow myisam/mi_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_unique.c: Fixed compiler warning myisam/myisampack.c: Fixed warnings found with gcc -Wshadow myisam/rt_index.c: Remove not used variables myisam/sort.c: Fixed warnings found with gcc -Wshadow mysql-test/r/mysqlcheck.result: Remove databases and tables possible left by previous test mysql-test/r/mysqltest.result: New test results mysql-test/t/mysql.test: Coverage tests mysql-test/t/mysqlbinlog.test: Coverage tests mysql-test/t/mysqlcheck.test: Remove databases and tables possible left by previous test mysql-test/t/mysqltest.test: Coverage tests mysys/default.c: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions mysys/mf_iocache2.c: Fixed warnings found with gcc -Wshadow mysys/mf_keycache.c: Fixed warnings found with gcc -Wshadow mysys/my_bitmap.c: Fixed warnings found with gcc -Wshadow mysys/sha1.c: Fixed warnings found with gcc -Wshadow ndb/include/kernel/signaldata/ArbitSignalData.hpp: Fixed compiler warning ndb/include/kernel/signaldata/DictTabInfo.hpp: Fixed compiler warnings ndb/include/ndbapi/NdbReceiver.hpp: Fixed warnings found with gcc -Wshadow ndb/include/transporter/TransporterDefinitions.hpp: Fixed compiler warning ndb/include/util/InputStream.hpp: Fixed compiler warning ndb/include/util/OutputStream.hpp: Fixed compiler warning ndb/include/util/SimpleProperties.hpp: Fixed compiler warning ndb/include/util/SocketAuthenticator.hpp: Fixed compiler warning ndb/include/util/SocketServer.hpp: Fixed compiler warning ndb/src/common/mgmcommon/ConfigRetriever.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/portlib/NdbTick.c: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/SHM_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.hpp: Fixed compiler warning ndb/src/common/transporter/Transporter.cpp: Removed not used variable ndb/src/common/transporter/TransporterRegistry.cpp: Removed not used variable ndb/src/common/util/Bitmask.cpp: Moved function to avoid warnings of not used function ndb/src/common/util/ConfigValues.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/File.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/Properties.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/SocketClient.cpp: Fixed wrong return value ndb/src/common/util/random.c: Fixed warnings found with gcc -Wshadow ndb/src/common/util/socket_io.cpp: Fixed warnings found with gcc -Wshadow ndb/src/cw/cpcd/APIService.cpp: Removed not used variable ndb/src/cw/cpcd/main.cpp: Removed not used variables ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Removed not used variables ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Removed not used variables ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: Removed not used variable ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: Removed not used variables ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Removed not used variables ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/Qmgr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.hpp: Fixed compiler warnings ndb/src/kernel/vm/MetaData.hpp: Fixed compiler warnings ndb/src/mgmapi/LocalConfig.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmapi/mgmapi.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmclient/CommandInterpreter.cpp: Removed not used variables ndb/src/mgmsrv/ConfigInfo.cpp: Fixed warnings found with gcc -Wshadow Removed not used variables ndb/src/mgmsrv/ConfigInfo.hpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmsrv/InitConfigFileParser.cpp: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions ndb/src/mgmsrv/MgmtSrvr.cpp: Removed not used variables and functions ndb/src/mgmsrv/MgmtSrvr.hpp: Fixed compiler warnings ndb/src/mgmsrv/Services.cpp: Removed not used variables and functions ndb/src/mgmsrv/main.cpp: Removed not used variable ndb/src/ndbapi/ClusterMgr.hpp: Fixed compiler warnings ndb/src/ndbapi/Ndb.cpp: Removed not used variables ndb/src/ndbapi/NdbBlob.cpp: Removed not used variables ndb/src/ndbapi/NdbDictionaryImpl.cpp: Removed not used variables ndb/src/ndbapi/NdbIndexOperation.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationDefine.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationExec.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationSearch.cpp: Removed not used variables ndb/src/ndbapi/NdbScanFilter.cpp: Fixed compiler warning ndb/src/ndbapi/NdbScanOperation.cpp: Removed not used variables ndb/src/ndbapi/SignalSender.cpp: Removed not used variables ndb/src/ndbapi/ndb_cluster_connection.cpp: Removed not used variable ndb/tools/delete_all.cpp: Removed not used variable ndb/tools/desc.cpp: Removed not used variable ndb/tools/drop_index.cpp: Removed not used variable ndb/tools/drop_tab.cpp: Removed not used variable ndb/tools/listTables.cpp: Removed not used variable ndb/tools/ndb_config.cpp: Fixed warnings found with gcc -Wshadow Added missing puts(desc) ndb/tools/restore/Restore.hpp: Changed delimiter to define instead of static variable, as the static variable caused a LOT of compiler warnings Fixed compiler warning ndb/tools/restore/consumer.hpp: Fixed compiler warning ndb/tools/restore/restore_main.cpp: Fixed compiler warnings ndb/tools/select_all.cpp: Removed not used variables ndb/tools/select_count.cpp: Removed not used variable server-tools/instance-manager/commands.h: Fixed compiler warnings server-tools/instance-manager/guardian.cc: Fixed compiler warnings server-tools/instance-manager/instance_options.cc: Removed not used variables server-tools/instance-manager/mysql_connection.cc: Fixed compiler warnings server-tools/instance-manager/options.cc: Fixed compiler warnings server-tools/instance-manager/options.h: Fixed compiler warnings server-tools/instance-manager/parse.cc: Removed not used variable server-tools/instance-manager/user_map.cc: Fixed compiler warnings server-tools/instance-manager/user_map.h: Fixed compiler warnings sql/field.cc: Fixed compiler warnings sql/field.h: Fixed compiler warnings sql/filesort.cc: Fixed compiler warnings sql/ha_archive.cc: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_archive.h: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_federated.cc: Fixed compiler warnings sql/ha_heap.cc: Fixed compiler warnings sql/ha_myisam.cc: Fixed compiler warnings sql/ha_myisammrg.cc: Fixed compiler warnings sql/ha_ndbcluster.cc: Fixed compiler warnings sql/handler.cc: Fixed compiler warnings sql/item.cc: Fixed compiler warnings sql/item.h: Fixed compiler warnings new_item() -> clone_item(), to avoid a lot of warnings with variable 'new_item' el() -> element_index() sql/item_cmpfunc.cc: Fixed compiler warnings sql/item_cmpfunc.h: Fixed compiler warnings sql/item_func.cc: Fixed compiler warnings sql/item_geofunc.cc: Fixed compiler warnings sql/item_row.h: Fixed compiler warnings sql/item_strfunc.cc: Fixed compiler warnings sql/item_subselect.cc: Fixed compiler warnings sql/item_subselect.h: Fixed compiler warnings sql/item_sum.cc: Fixed compiler warnings sql/item_timefunc.cc: Fixed compiler warnings sql/log.cc: Fixed compiler warnings More comments Added #ifdef HAVE_REPLICATION sql/log_event.cc: Fixed compiler warnings sql/log_event.h: Fixed compiler warnings sql/mysql_priv.h: query_id -> global_query_id, to avoid a lot of clashes with function and class variables start_time -> server_start_time sql/mysqld.cc: Fixed compiler warnings: - Removed not used variables - Added #ifndef EMBEDDED_LIBRARY - Fixed shadow warnings sql/net_serv.cc: Fixed compiler warnings sql/opt_range.cc: range -> last_range to avoid shadow warnings Removed not used function print_rowid() sql/opt_range.h: range -> last_range to avoid shadow warnings sql/password.c: Fixed compiler warnings sql/protocol.cc: Fixed compiler warnings sql/repl_failsafe.cc: Fixed compiler warnings sql/set_var.cc: Fixed compiler warnings sql/set_var.h: type() -> show_type() Fixed compiler warnings sql/slave.cc: Fixed compiler warnings sql/sp_head.cc: Fixed compiler warnings sql/sp_head.h: Fixed compiler warnings sql/spatial.cc: Fixed compiler warnings sql/spatial.h: length() -> geom_length() to avoid compiler warnings wkb_end -> wkb_last to avoid compiler warnings with local variables named 'wkb_end' sql/sql_cache.h: Fixed compiler warnings sql/sql_class.cc: Fixed compiler warnings sql/sql_class.h: log -> log_xid() to avoid compiler warnings Fixed shadow compiler warnings sql/sql_derived.cc: Removed not used variable sql/sql_insert.cc: Fixed compiler warnings sql/sql_lex.cc: Fixed compiler warnings sql/sql_lex.h: res -> saved_error to make the meaning of the variable clear and avoid shadow warnings sql/sql_load.cc: Fixed compiler warnings sql/sql_parse.cc: Fixed compiler warnings sql/sql_prepare.cc: Fixed compiler warnings sql/sql_select.cc: Fixed compiler warnings sql/sql_show.cc: Fixed compiler warnings sql/sql_string.cc: Fixed compiler warnings sql/sql_string.h: Fixed compiler warnings sql/sql_table.cc: Fixed compiler warnings sql/sql_trigger.cc: Fixed compiler warnings sql/sql_trigger.h: table -> trigger_table to avoid warnings from local variables sql/sql_union.cc: Fixed compiler warnings (mainly res -> saved_error) sql-common/client.c: Removed not used variable sql-common/my_time.c: Removed not used variable time -> my_time sql/sql_update.cc: Removed not used variable sql/sql_view.cc: Removed not used variable sql/sql_yacc.yy: Removed not used variable sql/table.cc: Removed not used variable sql/tztime.cc: Removed not used variable sql/unireg.cc: Removed not used variable strings/ctype-bin.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-cp932.c: Fixed compiler warnings strings/ctype-eucjpms.c: Fixed compiler warnings strings/ctype-mb.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-simple.c: mblen -> mb_len to avoid compiler warnings with local variable mblen exp -> exponent strings/ctype-sjis.c: Fixed compiler warnings strings/ctype-uca.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-ujis.c: Fixed compiler warnings strings/ctype-utf8.c: Fixed compiler warnings strings/decimal.c: Fixed compiler warnings strings/my_vsnprintf.c: Added comment strings/strtod.c: Fixed compiler warnings tests/mysql_client_test.c: Fixed compiler warnings (Biggest part of patch is to not get a conflict with global function 'bind')
2006-12-14 23:51:37 +01:00
get_point(&tmp_x, &tmp_y, data);
2011-05-04 20:20:17 +02:00
data+= POINT_DATA_SIZE;
loc_area= prev_x * tmp_y - tmp_x * prev_y;
cur_area+= loc_area;
Fixed compiler warnings detected by option -Wshadow and -Wunused: - Removed not used variables and functions - Added #ifdef around code that is not used - Renamed variables and functions to avoid conflicts - Removed some not used arguments Fixed some class/struct warnings in ndb Added define IS_LONGDATA() to simplify code in libmysql.c I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes BUILD/SETUP.sh: Added printing of unused functions and variables. Made it easy to test compiling with -Wshadow BUILD/compile-pentium-gcov: Added warnings Mark binary with -gcov client/mysql.cc: Fixed warnings found with gcc -Wshadow client/mysql_upgrade.c: Fixed warnings found with gcc -Wshadow client/mysqlbinlog.cc: Fixed warnings found with gcc -Wshadow client/mysqldump.c: Fixed warnings found with gcc -Wshadow client/mysqltest.c: Fixed warnings found with gcc -Wshadow client/sql_string.cc: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.cc client/sql_string.h: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.h cmd-line-utils/readline/display.c: Fixed compiler warning cmd-line-utils/readline/histexpand.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/input.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/text.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/vi_mode.c: Fixed warnings found with gcc -Wshadow dbug/dbug_analyze.c: Fixed warnings found with gcc -Wshadow extra/my_print_defaults.c: Prefixed defaults_extra_file and defaults_group_suffix with 'my' to avoid conflicts with similar named local variables extra/yassl/include/buffer.hpp: Fixed compiler warnings extra/yassl/include/crypto_wrapper.hpp: Fixed compiler warnings extra/yassl/include/yassl_imp.hpp: Fixed compiler warnings extra/yassl/include/yassl_int.hpp: Fixed compiler warnings extra/yassl/src/crypto_wrapper.cpp: Fixed compiler warnings extra/yassl/taocrypt/benchmark/benchmark.cpp: Fixed warnings found with gcc -Wshadow extra/yassl/taocrypt/include/algebra.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/des.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hash.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hmac.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modarith.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modes.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/rsa.hpp: Fixed compiler warnings extra/yassl/taocrypt/mySTL/list.hpp: Fixed compiler warnings extra/yassl/taocrypt/src/aes.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/algebra.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/asn.cpp: Fixed compiler warnings extra/yassl/taocrypt/test/test.cpp: Fixed compiler warnings extra/yassl/testsuite/testsuite.cpp: Fixed compiler warnings include/m_ctype.h: Fixed warnings found with gcc -Wshadow include/my_pthread.h: Fixed warnings found with gcc -Wshadow include/my_sys.h: Fixed warnings found with gcc -Wshadow include/my_time.h: Fixed warnings found with gcc -Wshadow include/mysql.h: Fixed warnings found with gcc -Wshadow Added define IS_LONGDATA() to simplify code in libmysql.c libmysql/libmysql.c: Fixed warnings found with gcc -Wshadow (Mostly replaced bind -> my_bind and time -> my_time) libmysqld/lib_sql.cc: Removed not used variables and labels myisam/ft_boolean_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_open.c: Fixed warnings found with gcc -Wshadow myisam/mi_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_unique.c: Fixed compiler warning myisam/myisampack.c: Fixed warnings found with gcc -Wshadow myisam/rt_index.c: Remove not used variables myisam/sort.c: Fixed warnings found with gcc -Wshadow mysql-test/r/mysqlcheck.result: Remove databases and tables possible left by previous test mysql-test/r/mysqltest.result: New test results mysql-test/t/mysql.test: Coverage tests mysql-test/t/mysqlbinlog.test: Coverage tests mysql-test/t/mysqlcheck.test: Remove databases and tables possible left by previous test mysql-test/t/mysqltest.test: Coverage tests mysys/default.c: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions mysys/mf_iocache2.c: Fixed warnings found with gcc -Wshadow mysys/mf_keycache.c: Fixed warnings found with gcc -Wshadow mysys/my_bitmap.c: Fixed warnings found with gcc -Wshadow mysys/sha1.c: Fixed warnings found with gcc -Wshadow ndb/include/kernel/signaldata/ArbitSignalData.hpp: Fixed compiler warning ndb/include/kernel/signaldata/DictTabInfo.hpp: Fixed compiler warnings ndb/include/ndbapi/NdbReceiver.hpp: Fixed warnings found with gcc -Wshadow ndb/include/transporter/TransporterDefinitions.hpp: Fixed compiler warning ndb/include/util/InputStream.hpp: Fixed compiler warning ndb/include/util/OutputStream.hpp: Fixed compiler warning ndb/include/util/SimpleProperties.hpp: Fixed compiler warning ndb/include/util/SocketAuthenticator.hpp: Fixed compiler warning ndb/include/util/SocketServer.hpp: Fixed compiler warning ndb/src/common/mgmcommon/ConfigRetriever.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/portlib/NdbTick.c: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/SHM_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.hpp: Fixed compiler warning ndb/src/common/transporter/Transporter.cpp: Removed not used variable ndb/src/common/transporter/TransporterRegistry.cpp: Removed not used variable ndb/src/common/util/Bitmask.cpp: Moved function to avoid warnings of not used function ndb/src/common/util/ConfigValues.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/File.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/Properties.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/SocketClient.cpp: Fixed wrong return value ndb/src/common/util/random.c: Fixed warnings found with gcc -Wshadow ndb/src/common/util/socket_io.cpp: Fixed warnings found with gcc -Wshadow ndb/src/cw/cpcd/APIService.cpp: Removed not used variable ndb/src/cw/cpcd/main.cpp: Removed not used variables ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Removed not used variables ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Removed not used variables ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: Removed not used variable ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: Removed not used variables ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Removed not used variables ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/Qmgr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.hpp: Fixed compiler warnings ndb/src/kernel/vm/MetaData.hpp: Fixed compiler warnings ndb/src/mgmapi/LocalConfig.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmapi/mgmapi.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmclient/CommandInterpreter.cpp: Removed not used variables ndb/src/mgmsrv/ConfigInfo.cpp: Fixed warnings found with gcc -Wshadow Removed not used variables ndb/src/mgmsrv/ConfigInfo.hpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmsrv/InitConfigFileParser.cpp: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions ndb/src/mgmsrv/MgmtSrvr.cpp: Removed not used variables and functions ndb/src/mgmsrv/MgmtSrvr.hpp: Fixed compiler warnings ndb/src/mgmsrv/Services.cpp: Removed not used variables and functions ndb/src/mgmsrv/main.cpp: Removed not used variable ndb/src/ndbapi/ClusterMgr.hpp: Fixed compiler warnings ndb/src/ndbapi/Ndb.cpp: Removed not used variables ndb/src/ndbapi/NdbBlob.cpp: Removed not used variables ndb/src/ndbapi/NdbDictionaryImpl.cpp: Removed not used variables ndb/src/ndbapi/NdbIndexOperation.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationDefine.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationExec.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationSearch.cpp: Removed not used variables ndb/src/ndbapi/NdbScanFilter.cpp: Fixed compiler warning ndb/src/ndbapi/NdbScanOperation.cpp: Removed not used variables ndb/src/ndbapi/SignalSender.cpp: Removed not used variables ndb/src/ndbapi/ndb_cluster_connection.cpp: Removed not used variable ndb/tools/delete_all.cpp: Removed not used variable ndb/tools/desc.cpp: Removed not used variable ndb/tools/drop_index.cpp: Removed not used variable ndb/tools/drop_tab.cpp: Removed not used variable ndb/tools/listTables.cpp: Removed not used variable ndb/tools/ndb_config.cpp: Fixed warnings found with gcc -Wshadow Added missing puts(desc) ndb/tools/restore/Restore.hpp: Changed delimiter to define instead of static variable, as the static variable caused a LOT of compiler warnings Fixed compiler warning ndb/tools/restore/consumer.hpp: Fixed compiler warning ndb/tools/restore/restore_main.cpp: Fixed compiler warnings ndb/tools/select_all.cpp: Removed not used variables ndb/tools/select_count.cpp: Removed not used variable server-tools/instance-manager/commands.h: Fixed compiler warnings server-tools/instance-manager/guardian.cc: Fixed compiler warnings server-tools/instance-manager/instance_options.cc: Removed not used variables server-tools/instance-manager/mysql_connection.cc: Fixed compiler warnings server-tools/instance-manager/options.cc: Fixed compiler warnings server-tools/instance-manager/options.h: Fixed compiler warnings server-tools/instance-manager/parse.cc: Removed not used variable server-tools/instance-manager/user_map.cc: Fixed compiler warnings server-tools/instance-manager/user_map.h: Fixed compiler warnings sql/field.cc: Fixed compiler warnings sql/field.h: Fixed compiler warnings sql/filesort.cc: Fixed compiler warnings sql/ha_archive.cc: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_archive.h: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_federated.cc: Fixed compiler warnings sql/ha_heap.cc: Fixed compiler warnings sql/ha_myisam.cc: Fixed compiler warnings sql/ha_myisammrg.cc: Fixed compiler warnings sql/ha_ndbcluster.cc: Fixed compiler warnings sql/handler.cc: Fixed compiler warnings sql/item.cc: Fixed compiler warnings sql/item.h: Fixed compiler warnings new_item() -> clone_item(), to avoid a lot of warnings with variable 'new_item' el() -> element_index() sql/item_cmpfunc.cc: Fixed compiler warnings sql/item_cmpfunc.h: Fixed compiler warnings sql/item_func.cc: Fixed compiler warnings sql/item_geofunc.cc: Fixed compiler warnings sql/item_row.h: Fixed compiler warnings sql/item_strfunc.cc: Fixed compiler warnings sql/item_subselect.cc: Fixed compiler warnings sql/item_subselect.h: Fixed compiler warnings sql/item_sum.cc: Fixed compiler warnings sql/item_timefunc.cc: Fixed compiler warnings sql/log.cc: Fixed compiler warnings More comments Added #ifdef HAVE_REPLICATION sql/log_event.cc: Fixed compiler warnings sql/log_event.h: Fixed compiler warnings sql/mysql_priv.h: query_id -> global_query_id, to avoid a lot of clashes with function and class variables start_time -> server_start_time sql/mysqld.cc: Fixed compiler warnings: - Removed not used variables - Added #ifndef EMBEDDED_LIBRARY - Fixed shadow warnings sql/net_serv.cc: Fixed compiler warnings sql/opt_range.cc: range -> last_range to avoid shadow warnings Removed not used function print_rowid() sql/opt_range.h: range -> last_range to avoid shadow warnings sql/password.c: Fixed compiler warnings sql/protocol.cc: Fixed compiler warnings sql/repl_failsafe.cc: Fixed compiler warnings sql/set_var.cc: Fixed compiler warnings sql/set_var.h: type() -> show_type() Fixed compiler warnings sql/slave.cc: Fixed compiler warnings sql/sp_head.cc: Fixed compiler warnings sql/sp_head.h: Fixed compiler warnings sql/spatial.cc: Fixed compiler warnings sql/spatial.h: length() -> geom_length() to avoid compiler warnings wkb_end -> wkb_last to avoid compiler warnings with local variables named 'wkb_end' sql/sql_cache.h: Fixed compiler warnings sql/sql_class.cc: Fixed compiler warnings sql/sql_class.h: log -> log_xid() to avoid compiler warnings Fixed shadow compiler warnings sql/sql_derived.cc: Removed not used variable sql/sql_insert.cc: Fixed compiler warnings sql/sql_lex.cc: Fixed compiler warnings sql/sql_lex.h: res -> saved_error to make the meaning of the variable clear and avoid shadow warnings sql/sql_load.cc: Fixed compiler warnings sql/sql_parse.cc: Fixed compiler warnings sql/sql_prepare.cc: Fixed compiler warnings sql/sql_select.cc: Fixed compiler warnings sql/sql_show.cc: Fixed compiler warnings sql/sql_string.cc: Fixed compiler warnings sql/sql_string.h: Fixed compiler warnings sql/sql_table.cc: Fixed compiler warnings sql/sql_trigger.cc: Fixed compiler warnings sql/sql_trigger.h: table -> trigger_table to avoid warnings from local variables sql/sql_union.cc: Fixed compiler warnings (mainly res -> saved_error) sql-common/client.c: Removed not used variable sql-common/my_time.c: Removed not used variable time -> my_time sql/sql_update.cc: Removed not used variable sql/sql_view.cc: Removed not used variable sql/sql_yacc.yy: Removed not used variable sql/table.cc: Removed not used variable sql/tztime.cc: Removed not used variable sql/unireg.cc: Removed not used variable strings/ctype-bin.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-cp932.c: Fixed compiler warnings strings/ctype-eucjpms.c: Fixed compiler warnings strings/ctype-mb.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-simple.c: mblen -> mb_len to avoid compiler warnings with local variable mblen exp -> exponent strings/ctype-sjis.c: Fixed compiler warnings strings/ctype-uca.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-ujis.c: Fixed compiler warnings strings/ctype-utf8.c: Fixed compiler warnings strings/decimal.c: Fixed compiler warnings strings/my_vsnprintf.c: Added comment strings/strtod.c: Fixed compiler warnings tests/mysql_client_test.c: Fixed compiler warnings (Biggest part of patch is to not get a conflict with global function 'bind')
2006-12-14 23:51:37 +01:00
cur_cx+= tmp_x;
cur_cy+= tmp_y;
sum_cx+= (prev_x + tmp_x) * loc_area;
sum_cy+= (prev_y + tmp_y) * loc_area;
Fixed compiler warnings detected by option -Wshadow and -Wunused: - Removed not used variables and functions - Added #ifdef around code that is not used - Renamed variables and functions to avoid conflicts - Removed some not used arguments Fixed some class/struct warnings in ndb Added define IS_LONGDATA() to simplify code in libmysql.c I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes BUILD/SETUP.sh: Added printing of unused functions and variables. Made it easy to test compiling with -Wshadow BUILD/compile-pentium-gcov: Added warnings Mark binary with -gcov client/mysql.cc: Fixed warnings found with gcc -Wshadow client/mysql_upgrade.c: Fixed warnings found with gcc -Wshadow client/mysqlbinlog.cc: Fixed warnings found with gcc -Wshadow client/mysqldump.c: Fixed warnings found with gcc -Wshadow client/mysqltest.c: Fixed warnings found with gcc -Wshadow client/sql_string.cc: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.cc client/sql_string.h: Fixed warnings found with gcc -Wshadow Merged with sql/sql_string.h cmd-line-utils/readline/display.c: Fixed compiler warning cmd-line-utils/readline/histexpand.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/input.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/text.c: Fixed warnings found with gcc -Wshadow cmd-line-utils/readline/vi_mode.c: Fixed warnings found with gcc -Wshadow dbug/dbug_analyze.c: Fixed warnings found with gcc -Wshadow extra/my_print_defaults.c: Prefixed defaults_extra_file and defaults_group_suffix with 'my' to avoid conflicts with similar named local variables extra/yassl/include/buffer.hpp: Fixed compiler warnings extra/yassl/include/crypto_wrapper.hpp: Fixed compiler warnings extra/yassl/include/yassl_imp.hpp: Fixed compiler warnings extra/yassl/include/yassl_int.hpp: Fixed compiler warnings extra/yassl/src/crypto_wrapper.cpp: Fixed compiler warnings extra/yassl/taocrypt/benchmark/benchmark.cpp: Fixed warnings found with gcc -Wshadow extra/yassl/taocrypt/include/algebra.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/des.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hash.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/hmac.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modarith.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/modes.hpp: Fixed compiler warnings extra/yassl/taocrypt/include/rsa.hpp: Fixed compiler warnings extra/yassl/taocrypt/mySTL/list.hpp: Fixed compiler warnings extra/yassl/taocrypt/src/aes.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/algebra.cpp: Fixed compiler warnings extra/yassl/taocrypt/src/asn.cpp: Fixed compiler warnings extra/yassl/taocrypt/test/test.cpp: Fixed compiler warnings extra/yassl/testsuite/testsuite.cpp: Fixed compiler warnings include/m_ctype.h: Fixed warnings found with gcc -Wshadow include/my_pthread.h: Fixed warnings found with gcc -Wshadow include/my_sys.h: Fixed warnings found with gcc -Wshadow include/my_time.h: Fixed warnings found with gcc -Wshadow include/mysql.h: Fixed warnings found with gcc -Wshadow Added define IS_LONGDATA() to simplify code in libmysql.c libmysql/libmysql.c: Fixed warnings found with gcc -Wshadow (Mostly replaced bind -> my_bind and time -> my_time) libmysqld/lib_sql.cc: Removed not used variables and labels myisam/ft_boolean_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_open.c: Fixed warnings found with gcc -Wshadow myisam/mi_search.c: Fixed warnings found with gcc -Wshadow myisam/mi_unique.c: Fixed compiler warning myisam/myisampack.c: Fixed warnings found with gcc -Wshadow myisam/rt_index.c: Remove not used variables myisam/sort.c: Fixed warnings found with gcc -Wshadow mysql-test/r/mysqlcheck.result: Remove databases and tables possible left by previous test mysql-test/r/mysqltest.result: New test results mysql-test/t/mysql.test: Coverage tests mysql-test/t/mysqlbinlog.test: Coverage tests mysql-test/t/mysqlcheck.test: Remove databases and tables possible left by previous test mysql-test/t/mysqltest.test: Coverage tests mysys/default.c: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions mysys/mf_iocache2.c: Fixed warnings found with gcc -Wshadow mysys/mf_keycache.c: Fixed warnings found with gcc -Wshadow mysys/my_bitmap.c: Fixed warnings found with gcc -Wshadow mysys/sha1.c: Fixed warnings found with gcc -Wshadow ndb/include/kernel/signaldata/ArbitSignalData.hpp: Fixed compiler warning ndb/include/kernel/signaldata/DictTabInfo.hpp: Fixed compiler warnings ndb/include/ndbapi/NdbReceiver.hpp: Fixed warnings found with gcc -Wshadow ndb/include/transporter/TransporterDefinitions.hpp: Fixed compiler warning ndb/include/util/InputStream.hpp: Fixed compiler warning ndb/include/util/OutputStream.hpp: Fixed compiler warning ndb/include/util/SimpleProperties.hpp: Fixed compiler warning ndb/include/util/SocketAuthenticator.hpp: Fixed compiler warning ndb/include/util/SocketServer.hpp: Fixed compiler warning ndb/src/common/mgmcommon/ConfigRetriever.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/portlib/NdbTick.c: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/SHM_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/transporter/TCP_Transporter.hpp: Fixed compiler warning ndb/src/common/transporter/Transporter.cpp: Removed not used variable ndb/src/common/transporter/TransporterRegistry.cpp: Removed not used variable ndb/src/common/util/Bitmask.cpp: Moved function to avoid warnings of not used function ndb/src/common/util/ConfigValues.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/File.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/Properties.cpp: Fixed warnings found with gcc -Wshadow ndb/src/common/util/SocketClient.cpp: Fixed wrong return value ndb/src/common/util/random.c: Fixed warnings found with gcc -Wshadow ndb/src/common/util/socket_io.cpp: Fixed warnings found with gcc -Wshadow ndb/src/cw/cpcd/APIService.cpp: Removed not used variable ndb/src/cw/cpcd/main.cpp: Removed not used variables ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Removed not used variables ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Removed not used variables ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Fixed compiler warnings ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: Removed not used variable ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: Removed not used variables ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: Removed not used variables ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Removed not used variables ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/Qmgr.hpp: Fixed compiler warnings ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.cpp: Removed not used variables ndb/src/kernel/blocks/suma/Suma.hpp: Fixed compiler warnings ndb/src/kernel/vm/MetaData.hpp: Fixed compiler warnings ndb/src/mgmapi/LocalConfig.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmapi/mgmapi.cpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmclient/CommandInterpreter.cpp: Removed not used variables ndb/src/mgmsrv/ConfigInfo.cpp: Fixed warnings found with gcc -Wshadow Removed not used variables ndb/src/mgmsrv/ConfigInfo.hpp: Fixed warnings found with gcc -Wshadow ndb/src/mgmsrv/InitConfigFileParser.cpp: Prefixed defaults_file, defaults_group_suffix and defaults_extra_file with 'my' to avoid conflicts with local variables in some functions ndb/src/mgmsrv/MgmtSrvr.cpp: Removed not used variables and functions ndb/src/mgmsrv/MgmtSrvr.hpp: Fixed compiler warnings ndb/src/mgmsrv/Services.cpp: Removed not used variables and functions ndb/src/mgmsrv/main.cpp: Removed not used variable ndb/src/ndbapi/ClusterMgr.hpp: Fixed compiler warnings ndb/src/ndbapi/Ndb.cpp: Removed not used variables ndb/src/ndbapi/NdbBlob.cpp: Removed not used variables ndb/src/ndbapi/NdbDictionaryImpl.cpp: Removed not used variables ndb/src/ndbapi/NdbIndexOperation.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationDefine.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationExec.cpp: Removed not used variables ndb/src/ndbapi/NdbOperationSearch.cpp: Removed not used variables ndb/src/ndbapi/NdbScanFilter.cpp: Fixed compiler warning ndb/src/ndbapi/NdbScanOperation.cpp: Removed not used variables ndb/src/ndbapi/SignalSender.cpp: Removed not used variables ndb/src/ndbapi/ndb_cluster_connection.cpp: Removed not used variable ndb/tools/delete_all.cpp: Removed not used variable ndb/tools/desc.cpp: Removed not used variable ndb/tools/drop_index.cpp: Removed not used variable ndb/tools/drop_tab.cpp: Removed not used variable ndb/tools/listTables.cpp: Removed not used variable ndb/tools/ndb_config.cpp: Fixed warnings found with gcc -Wshadow Added missing puts(desc) ndb/tools/restore/Restore.hpp: Changed delimiter to define instead of static variable, as the static variable caused a LOT of compiler warnings Fixed compiler warning ndb/tools/restore/consumer.hpp: Fixed compiler warning ndb/tools/restore/restore_main.cpp: Fixed compiler warnings ndb/tools/select_all.cpp: Removed not used variables ndb/tools/select_count.cpp: Removed not used variable server-tools/instance-manager/commands.h: Fixed compiler warnings server-tools/instance-manager/guardian.cc: Fixed compiler warnings server-tools/instance-manager/instance_options.cc: Removed not used variables server-tools/instance-manager/mysql_connection.cc: Fixed compiler warnings server-tools/instance-manager/options.cc: Fixed compiler warnings server-tools/instance-manager/options.h: Fixed compiler warnings server-tools/instance-manager/parse.cc: Removed not used variable server-tools/instance-manager/user_map.cc: Fixed compiler warnings server-tools/instance-manager/user_map.h: Fixed compiler warnings sql/field.cc: Fixed compiler warnings sql/field.h: Fixed compiler warnings sql/filesort.cc: Fixed compiler warnings sql/ha_archive.cc: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_archive.h: Removed table and share arguments from get_share() / free_share() to get rid of compiler warnings sql/ha_federated.cc: Fixed compiler warnings sql/ha_heap.cc: Fixed compiler warnings sql/ha_myisam.cc: Fixed compiler warnings sql/ha_myisammrg.cc: Fixed compiler warnings sql/ha_ndbcluster.cc: Fixed compiler warnings sql/handler.cc: Fixed compiler warnings sql/item.cc: Fixed compiler warnings sql/item.h: Fixed compiler warnings new_item() -> clone_item(), to avoid a lot of warnings with variable 'new_item' el() -> element_index() sql/item_cmpfunc.cc: Fixed compiler warnings sql/item_cmpfunc.h: Fixed compiler warnings sql/item_func.cc: Fixed compiler warnings sql/item_geofunc.cc: Fixed compiler warnings sql/item_row.h: Fixed compiler warnings sql/item_strfunc.cc: Fixed compiler warnings sql/item_subselect.cc: Fixed compiler warnings sql/item_subselect.h: Fixed compiler warnings sql/item_sum.cc: Fixed compiler warnings sql/item_timefunc.cc: Fixed compiler warnings sql/log.cc: Fixed compiler warnings More comments Added #ifdef HAVE_REPLICATION sql/log_event.cc: Fixed compiler warnings sql/log_event.h: Fixed compiler warnings sql/mysql_priv.h: query_id -> global_query_id, to avoid a lot of clashes with function and class variables start_time -> server_start_time sql/mysqld.cc: Fixed compiler warnings: - Removed not used variables - Added #ifndef EMBEDDED_LIBRARY - Fixed shadow warnings sql/net_serv.cc: Fixed compiler warnings sql/opt_range.cc: range -> last_range to avoid shadow warnings Removed not used function print_rowid() sql/opt_range.h: range -> last_range to avoid shadow warnings sql/password.c: Fixed compiler warnings sql/protocol.cc: Fixed compiler warnings sql/repl_failsafe.cc: Fixed compiler warnings sql/set_var.cc: Fixed compiler warnings sql/set_var.h: type() -> show_type() Fixed compiler warnings sql/slave.cc: Fixed compiler warnings sql/sp_head.cc: Fixed compiler warnings sql/sp_head.h: Fixed compiler warnings sql/spatial.cc: Fixed compiler warnings sql/spatial.h: length() -> geom_length() to avoid compiler warnings wkb_end -> wkb_last to avoid compiler warnings with local variables named 'wkb_end' sql/sql_cache.h: Fixed compiler warnings sql/sql_class.cc: Fixed compiler warnings sql/sql_class.h: log -> log_xid() to avoid compiler warnings Fixed shadow compiler warnings sql/sql_derived.cc: Removed not used variable sql/sql_insert.cc: Fixed compiler warnings sql/sql_lex.cc: Fixed compiler warnings sql/sql_lex.h: res -> saved_error to make the meaning of the variable clear and avoid shadow warnings sql/sql_load.cc: Fixed compiler warnings sql/sql_parse.cc: Fixed compiler warnings sql/sql_prepare.cc: Fixed compiler warnings sql/sql_select.cc: Fixed compiler warnings sql/sql_show.cc: Fixed compiler warnings sql/sql_string.cc: Fixed compiler warnings sql/sql_string.h: Fixed compiler warnings sql/sql_table.cc: Fixed compiler warnings sql/sql_trigger.cc: Fixed compiler warnings sql/sql_trigger.h: table -> trigger_table to avoid warnings from local variables sql/sql_union.cc: Fixed compiler warnings (mainly res -> saved_error) sql-common/client.c: Removed not used variable sql-common/my_time.c: Removed not used variable time -> my_time sql/sql_update.cc: Removed not used variable sql/sql_view.cc: Removed not used variable sql/sql_yacc.yy: Removed not used variable sql/table.cc: Removed not used variable sql/tztime.cc: Removed not used variable sql/unireg.cc: Removed not used variable strings/ctype-bin.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-cp932.c: Fixed compiler warnings strings/ctype-eucjpms.c: Fixed compiler warnings strings/ctype-mb.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-simple.c: mblen -> mb_len to avoid compiler warnings with local variable mblen exp -> exponent strings/ctype-sjis.c: Fixed compiler warnings strings/ctype-uca.c: mblen -> mb_len to avoid compiler warnings with local variable mblen strings/ctype-ujis.c: Fixed compiler warnings strings/ctype-utf8.c: Fixed compiler warnings strings/decimal.c: Fixed compiler warnings strings/my_vsnprintf.c: Added comment strings/strtod.c: Fixed compiler warnings tests/mysql_client_test.c: Fixed compiler warnings (Biggest part of patch is to not get a conflict with global function 'bind')
2006-12-14 23:51:37 +01:00
prev_x= tmp_x;
prev_y= tmp_y;
}
if (fabs(cur_area) > 1e-10)
{
cur_cx= sum_cx / cur_area / 3.0;
cur_cy= sum_cy / cur_area / 3.0;
}
else
{
cur_cx= cur_cx / (org_n_points - 1);
cur_cy= cur_cy / (org_n_points - 1);
}
cur_area= fabs(cur_area);
if (!first_loop)
{
double d_area= fabs(res_area - cur_area);
res_cx= (res_area * res_cx - cur_area * cur_cx) / d_area;
res_cy= (res_area * res_cy - cur_area * cur_cy) / d_area;
}
else
{
first_loop= 0;
res_area= cur_area;
res_cx= cur_cx;
res_cy= cur_cy;
}
}
*x= res_cx;
*y= res_cy;
return 0;
}
int Gis_polygon::centroid(String *result) const
{
double x, y;
if (centroid_xy(&x, &y))
return 1;
return create_point(result, x, y);
}
2011-05-04 20:20:17 +02:00
int Gis_polygon::store_shapes(Gcalc_shape_transporter *trn) const
{
uint32 n_linear_rings;
const char *data= m_data;
2011-09-01 08:44:56 +02:00
double first_x, first_y;
double prev_x, prev_y;
int was_equal_first= 0;
2011-05-04 20:20:17 +02:00
if (trn->start_poly())
return 1;
if (no_data(data, 4))
return 1;
n_linear_rings= uint4korr(data);
data+= 4;
while (n_linear_rings--)
{
uint32 n_points;
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
data+= 4;
if (!n_points || not_enough_points(data, n_points))
2011-05-04 20:20:17 +02:00
return 1;
trn->start_ring();
2011-09-01 08:44:56 +02:00
get_point(&first_x, &first_y, data);
data+= POINT_DATA_SIZE;
2011-09-01 08:44:56 +02:00
prev_x= first_x;
prev_y= first_y;
if (trn->add_point(first_x, first_y))
return 1;
if (--n_points == 0)
goto single_point_ring;
2011-05-04 20:20:17 +02:00
while (--n_points)
{
double x, y;
get_point(&x, &y, data);
data+= POINT_DATA_SIZE;
2011-09-01 08:44:56 +02:00
if (x == prev_x && y == prev_y)
continue;
prev_x= x;
prev_y= y;
if (was_equal_first)
{
if (trn->add_point(first_x, first_y))
return 1;
was_equal_first= 0;
}
if (x == first_x && y == first_y)
{
was_equal_first= 1;
continue;
}
2011-05-04 20:20:17 +02:00
if (trn->add_point(x, y))
return 1;
}
data+= POINT_DATA_SIZE;
single_point_ring:
2011-05-04 20:20:17 +02:00
trn->complete_ring();
}
trn->complete_poly();
return 0;
}
const Geometry::Class_info *Gis_polygon::get_class_info() const
{
return &polygon_class;
}
/***************************** MultiPoint *******************************/
uint32 Gis_multi_point::get_data_size() const
{
uint32 n_points;
if (no_data(m_data, 4) ||
not_enough_points(m_data+4, (n_points= uint4korr(m_data)),
WKB_HEADER_SIZE))
return GET_SIZE_ERROR;
return 4 + n_points * (POINT_DATA_SIZE + WKB_HEADER_SIZE);
}
bool Gis_multi_point::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
uint32 n_points= 0;
uint32 np_pos= wkb->length();
Gis_point p;
if (wkb->reserve(4, 512))
return 1;
wkb->length(wkb->length()+4); // Reserve space for points
for (;;)
{
2011-05-04 20:20:17 +02:00
if (wkb->reserve(1 + 4, 512))
return 1;
wkb->q_append((char) wkb_ndr);
wkb->q_append((uint32) wkb_point);
if (p.init_from_wkt(trs, wkb))
return 1;
n_points++;
if (trs->skip_char(',')) // Didn't find ','
break;
}
wkb->write_at_position(np_pos, n_points); // Store number of found points
return 0;
}
2011-05-04 20:20:17 +02:00
uint Gis_multi_point::init_from_opresult(String *bin,
const char *opres, uint res_len)
2011-05-04 20:20:17 +02:00
{
uint bin_size, n_points;
2011-05-04 20:20:17 +02:00
Gis_point p;
const char *opres_end;
n_points= res_len/(4+8*2);
bin_size= n_points * (WKB_HEADER_SIZE + POINT_DATA_SIZE) + 4;
2011-05-04 20:20:17 +02:00
if (bin->reserve(bin_size, 512))
return 0;
bin->q_append(n_points);
opres_end= opres + res_len;
2011-05-04 20:20:17 +02:00
for (; opres < opres_end; opres+= (4 + 8*2))
{
bin->q_append((char)wkb_ndr);
bin->q_append((uint32)wkb_point);
if (!p.init_from_wkb(opres + 4, POINT_DATA_SIZE, wkb_ndr, bin))
return 0;
}
return res_len;
2011-05-04 20:20:17 +02:00
}
uint Gis_multi_point::init_from_wkb(const char *wkb, uint len, wkbByteOrder bo,
String *res)
{
uint32 n_points;
uint proper_size;
Gis_point p;
const char *wkb_end;
2012-08-17 11:14:04 +02:00
if (len < 4 ||
(n_points= wkb_get_uint(wkb, bo)) > max_n_points)
return 0;
proper_size= 4 + n_points * (WKB_HEADER_SIZE + POINT_DATA_SIZE);
if (len < proper_size || res->reserve(proper_size))
return 0;
res->q_append(n_points);
wkb_end= wkb + proper_size;
for (wkb+=4; wkb < wkb_end; wkb+= (WKB_HEADER_SIZE + POINT_DATA_SIZE))
{
res->q_append((char)wkb_ndr);
res->q_append((uint32)wkb_point);
if (!p.init_from_wkb(wkb + WKB_HEADER_SIZE,
POINT_DATA_SIZE, (wkbByteOrder) wkb[0], res))
return 0;
}
return proper_size;
}
bool Gis_multi_point::init_from_json(json_engine_t *je, bool er_on_3D,
String *wkb)
{
uint32 n_points= 0;
uint32 np_pos= wkb->length();
Gis_point p;
if (json_read_value(je))
return TRUE;
if (je->value_type != JSON_VALUE_ARRAY)
{
je->s.error= GEOJ_INCORRECT_GEOJSON;
return TRUE;
}
if (wkb->reserve(4, 512))
return TRUE;
wkb->length(wkb->length()+4); // Reserve space for n_points
while (json_scan_next(je) == 0 && je->state != JST_ARRAY_END)
{
DBUG_ASSERT(je->state == JST_VALUE);
if (wkb->reserve(1 + 4, 512))
return TRUE;
wkb->q_append((char) wkb_ndr);
wkb->q_append((uint32) wkb_point);
if (p.init_from_json(je, er_on_3D, wkb))
return TRUE;
n_points++;
}
if (je->s.error)
return TRUE;
if (n_points == 0)
{
je->s.error= Geometry::GEOJ_EMPTY_COORDINATES;
return TRUE;
}
wkb->write_at_position(np_pos, n_points);
return FALSE;
}
bool Gis_multi_point::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_points;
if (no_data(m_data, 4))
return 1;
n_points= uint4korr(m_data);
if (n_points > max_n_points ||
2013-08-15 23:04:20 +02:00
not_enough_points(m_data+4, n_points, WKB_HEADER_SIZE) ||
txt->reserve(((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
return 1;
*end= append_points(txt, n_points, m_data+4, WKB_HEADER_SIZE);
txt->length(txt->length()-1); // Remove end ','
return 0;
}
bool Gis_multi_point::get_data_as_json(String *txt, uint max_dec_digits,
const char **end) const
{
uint32 n_points;
if (no_data(m_data, 4))
return 1;
n_points= uint4korr(m_data);
if (n_points > max_n_points ||
not_enough_points(m_data+4, n_points, WKB_HEADER_SIZE) ||
txt->reserve((MAX_DIGITS_IN_DOUBLE * 2 + 6) * n_points + 2))
return 1;
*end= append_json_points(txt, max_dec_digits, n_points, m_data+4,
WKB_HEADER_SIZE);
return 0;
}
bool Gis_multi_point::get_mbr(MBR *mbr, const char **end) const
{
return (*end= get_mbr_for_points(mbr, m_data, WKB_HEADER_SIZE)) == 0;
}
int Gis_multi_point::num_geometries(uint32 *num) const
{
*num= uint4korr(m_data);
return 0;
}
int Gis_multi_point::geometry_n(uint32 num, String *result) const
{
const char *data= m_data;
uint32 n_points;
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
data+= 4+ (num - 1) * (WKB_HEADER_SIZE + POINT_DATA_SIZE);
if (num > n_points || num < 1 ||
no_data(data, WKB_HEADER_SIZE + POINT_DATA_SIZE) ||
result->reserve(WKB_HEADER_SIZE + POINT_DATA_SIZE))
return 1;
result->q_append(data, WKB_HEADER_SIZE + POINT_DATA_SIZE);
return 0;
}
2011-05-04 20:20:17 +02:00
int Gis_multi_point::store_shapes(Gcalc_shape_transporter *trn) const
{
uint32 n_points;
Gis_point pt;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
data+= 4;
if (trn->start_collection(n_points))
return 1;
while (n_points--)
{
if (no_data(data, WKB_HEADER_SIZE))
return 1;
data+= WKB_HEADER_SIZE;
pt.set_data_ptr(data, (uint32) (m_data_end - data));
if (pt.store_shapes(trn))
return 1;
data+= pt.get_data_size();
}
return 0;
}
const Geometry::Class_info *Gis_multi_point::get_class_info() const
{
return &multipoint_class;
}
/**
Function that calculate spherical distance of Multipoints geometries.
In case there is single point in Multipoint geometries calculate_haversine()
can handle such case. Otherwise, new geometry (Point) has to be constructed.
@param g pointer to the Geometry
@param r sphere radius
@param result pointer to the result
@param err pointer to the error obtained from calculate_haversin()
@return state
@retval TRUE failed
@retval FALSE success
*/
int Gis_multi_point::spherical_distance_multipoints(Geometry *g, const double r,
double *result, int *err)
{
const uint32 len= 4 + WKB_HEADER_SIZE + POINT_DATA_SIZE + 1;
// Check how many points are stored in Multipoints
uint32 num_of_points1, num_of_points2;
// To find the minimum radius it cannot be greater than Earth radius
double res= 6370986.0;
/* From Item_func_sphere_distance::spherical_distance_points,
we are sure that there will be multiple points and we have to construct
Point geometry and return the smallest result.
*/
num_geometries(&num_of_points1);
DBUG_ASSERT(num_of_points1 >= 1);
g->num_geometries(&num_of_points2);
DBUG_ASSERT(num_of_points2 >= 1);
for (uint32 i=1; i <= num_of_points1; i++)
{
Geometry_buffer buff_temp;
Geometry *temp;
double temp_res= 0.0;
char s[len];
const char *pt_ptr= get_data_ptr()+
4+WKB_HEADER_SIZE*i + POINT_DATA_SIZE*(i-1);
// First 4 bytes are handled already, make sure to create a Point
memset(s + 4, Geometry::wkb_point, 1);
if (no_data(pt_ptr, POINT_DATA_SIZE))
return 1;
memcpy(s + 5, this->get_data_ptr() + 5, 4);
memcpy(s + 4 + WKB_HEADER_SIZE, pt_ptr, POINT_DATA_SIZE);
s[len-1]= '\0';
temp= Geometry::construct(&buff_temp, s, len);
if (!temp)
return 1;
// Optimization for single Multipoint
if (num_of_points2 == 1)
{
*result= static_cast<Gis_point *>(temp)->calculate_haversine(g, r, err);
return 0;
}
for (uint32 j=1; j<= num_of_points2; j++)
{
Geometry_buffer buff_temp2;
Geometry *temp2;
char s2[len];
const char *pt_ptr= g->get_data_ptr()+
4+WKB_HEADER_SIZE*j + POINT_DATA_SIZE*(j-1);
// First 4 bytes are handled already, make sure to create a Point
memset(s2 + 4, Geometry::wkb_point, 1);
if (g->no_data(pt_ptr, POINT_DATA_SIZE))
return 1;
memcpy(s2 + 5, g->get_data_ptr() + 5, 4);
memcpy(s2 + 4 + WKB_HEADER_SIZE, pt_ptr, POINT_DATA_SIZE);
s2[len-1]= '\0';
temp2= Geometry::construct(&buff_temp2, s2, len);
if (!temp2)
return 1;
temp_res= static_cast<Gis_point *>(temp)->calculate_haversine(temp2, r, err);
if (res > temp_res)
res= temp_res;
}
}
*result= res;
return 0;
}
/***************************** MultiLineString *******************************/
uint32 Gis_multi_line_string::get_data_size() const
{
uint32 n_line_strings;
uint32 n_points;
const char *data= m_data;
if (no_data(data, 4))
return GET_SIZE_ERROR;
n_line_strings= uint4korr(data);
data+= 4;
while (n_line_strings--)
{
if (no_data(data, WKB_HEADER_SIZE + 4) ||
not_enough_points(data + WKB_HEADER_SIZE+4,
(n_points= uint4korr(data + WKB_HEADER_SIZE))))
return GET_SIZE_ERROR;
data+= (WKB_HEADER_SIZE + 4 + n_points*POINT_DATA_SIZE);
}
if (no_data(data, 0))
return GET_SIZE_ERROR;
return (uint32) (data - m_data);
}
bool Gis_multi_line_string::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
uint32 n_line_strings= 0;
uint32 ls_pos= wkb->length();
if (wkb->reserve(4, 512))
return 1;
wkb->length(wkb->length()+4); // Reserve space for points
for (;;)
{
Gis_line_string ls;
2011-05-04 20:20:17 +02:00
if (wkb->reserve(1 + 4, 512))
return 1;
2011-05-04 20:20:17 +02:00
wkb->q_append((char) wkb_ndr); wkb->q_append((uint32) wkb_linestring);
if (trs->check_next_symbol('(') ||
ls.init_from_wkt(trs, wkb) ||
trs->check_next_symbol(')'))
return 1;
n_line_strings++;
if (trs->skip_char(',')) // Didn't find ','
break;
}
wkb->write_at_position(ls_pos, n_line_strings);
return 0;
}
2011-05-04 20:20:17 +02:00
uint Gis_multi_line_string::init_from_opresult(String *bin,
const char *opres, uint res_len)
2011-05-04 20:20:17 +02:00
{
const char *opres_orig= opres;
int ns_pos= bin->length();
uint n_linestring= 0;
2011-05-04 20:20:17 +02:00
if (bin->reserve(4, 512))
return 0;
bin->q_append(n_linestring);
2011-05-04 20:20:17 +02:00
while (res_len)
2011-05-04 20:20:17 +02:00
{
Gis_line_string ls;
int ls_len;
if (bin->reserve(WKB_HEADER_SIZE, 512))
return 0;
bin->q_append((char) wkb_ndr);
bin->q_append((uint32) wkb_linestring);
if (!(ls_len= ls.init_from_opresult(bin, opres, res_len)))
2011-05-04 20:20:17 +02:00
return 0;
opres+= ls_len;
res_len-= ls_len;
n_linestring++;
2011-05-04 20:20:17 +02:00
}
bin->write_at_position(ns_pos, n_linestring);
2011-05-04 20:20:17 +02:00
return (uint) (opres - opres_orig);
}
uint Gis_multi_line_string::init_from_wkb(const char *wkb, uint len,
wkbByteOrder bo, String *res)
{
uint32 n_line_strings;
const char *wkb_orig= wkb;
2011-05-04 20:20:17 +02:00
if (len < 4 ||
(n_line_strings= wkb_get_uint(wkb, bo))< 1)
return 0;
if (res->reserve(4, 512))
return 0;
res->q_append(n_line_strings);
wkb+= 4;
while (n_line_strings--)
{
Gis_line_string ls;
int ls_len;
if ((len < WKB_HEADER_SIZE) ||
res->reserve(WKB_HEADER_SIZE, 512))
return 0;
res->q_append((char) wkb_ndr);
res->q_append((uint32) wkb_linestring);
if (!(ls_len= ls.init_from_wkb(wkb + WKB_HEADER_SIZE, len,
(wkbByteOrder) wkb[0], res)))
return 0;
ls_len+= WKB_HEADER_SIZE;;
wkb+= ls_len;
len-= ls_len;
}
return (uint) (wkb - wkb_orig);
}
bool Gis_multi_line_string::init_from_json(json_engine_t *je, bool er_on_3D,
String *wkb)
{
uint32 n_line_strings= 0;
uint32 ls_pos= wkb->length();
if (json_read_value(je))
return TRUE;
if (je->value_type != JSON_VALUE_ARRAY)
{
je->s.error= GEOJ_INCORRECT_GEOJSON;
return TRUE;
}
if (wkb->reserve(4, 512))
return TRUE;
wkb->length(wkb->length()+4); // Reserve space for n_rings
while (json_scan_next(je) == 0 && je->state != JST_ARRAY_END)
{
Gis_line_string ls;
DBUG_ASSERT(je->state == JST_VALUE);
if (wkb->reserve(1 + 4, 512))
return TRUE;
wkb->q_append((char) wkb_ndr);
wkb->q_append((uint32) wkb_linestring);
if (ls.init_from_json(je, er_on_3D, wkb))
return TRUE;
n_line_strings++;
}
if (je->s.error)
return TRUE;
if (n_line_strings == 0)
{
je->s.error= Geometry::GEOJ_EMPTY_COORDINATES;
return TRUE;
}
wkb->write_at_position(ls_pos, n_line_strings);
return FALSE;
}
bool Gis_multi_line_string::get_data_as_wkt(String *txt,
const char **end) const
{
uint32 n_line_strings;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_line_strings= uint4korr(data);
data+= 4;
while (n_line_strings--)
{
uint32 n_points;
if (no_data(data, (WKB_HEADER_SIZE + 4)))
return 1;
n_points= uint4korr(data + WKB_HEADER_SIZE);
data+= WKB_HEADER_SIZE + 4;
if (not_enough_points(data, n_points) ||
txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
return 1;
txt->qs_append('(');
data= append_points(txt, n_points, data, 0);
(*txt) [txt->length() - 1]= ')';
txt->qs_append(',');
}
txt->length(txt->length() - 1);
*end= data;
return 0;
}
bool Gis_multi_line_string::get_data_as_json(String *txt, uint max_dec_digits,
const char **end) const
{
uint32 n_line_strings;
const char *data= m_data;
if (no_data(data, 4) || txt->reserve(1, 512))
return 1;
n_line_strings= uint4korr(data);
data+= 4;
txt->qs_append('[');
while (n_line_strings--)
{
uint32 n_points;
if (no_data(data, (WKB_HEADER_SIZE + 4)))
return 1;
n_points= uint4korr(data + WKB_HEADER_SIZE);
data+= WKB_HEADER_SIZE + 4;
if (not_enough_points(data, n_points) ||
txt->reserve(2 + (MAX_DIGITS_IN_DOUBLE * 2 + 6) * n_points))
return 1;
data= append_json_points(txt, max_dec_digits, n_points, data, 0);
txt->qs_append(", ", 2);
}
txt->length(txt->length() - 2);
txt->qs_append(']');
*end= data;
return 0;
}
bool Gis_multi_line_string::get_mbr(MBR *mbr, const char **end) const
{
uint32 n_line_strings;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_line_strings= uint4korr(data);
data+= 4;
while (n_line_strings--)
{
data+= WKB_HEADER_SIZE;
if (!(data= get_mbr_for_points(mbr, data, 0)))
return 1;
}
*end= data;
return 0;
}
int Gis_multi_line_string::num_geometries(uint32 *num) const
{
*num= uint4korr(m_data);
return 0;
}
int Gis_multi_line_string::geometry_n(uint32 num, String *result) const
{
uint32 n_line_strings, n_points, length;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_line_strings= uint4korr(data);
data+= 4;
if ((num > n_line_strings) || (num < 1))
return 1;
for (;;)
{
if (no_data(data, WKB_HEADER_SIZE + 4))
return 1;
n_points= uint4korr(data + WKB_HEADER_SIZE);
length= WKB_HEADER_SIZE + 4+ POINT_DATA_SIZE * n_points;
if (not_enough_points(data+WKB_HEADER_SIZE+4, n_points))
return 1;
if (!--num)
break;
data+= length;
}
return result->append(data, length, (uint32) 0);
}
int Gis_multi_line_string::geom_length(double *len, const char **end) const
{
uint32 n_line_strings;
const char *data= m_data;
const char *line_end;
if (no_data(data, 4))
return 1;
n_line_strings= uint4korr(data);
data+= 4;
*len=0;
while (n_line_strings--)
{
double ls_len;
Gis_line_string ls;
data+= WKB_HEADER_SIZE;
ls.set_data_ptr(data, (uint32) (m_data_end - data));
if (ls.geom_length(&ls_len, &line_end))
return 1;
*len+= ls_len;
/*
We know here that ls was ok, so we can call the trivial function
Gis_line_string::get_data_size without error checking
*/
data+= ls.get_data_size();
}
*end= data;
return 0;
}
int Gis_multi_line_string::is_closed(int *closed) const
{
uint32 n_line_strings;
const char *data= m_data;
if (no_data(data, 4 + WKB_HEADER_SIZE))
return 1;
n_line_strings= uint4korr(data);
data+= 4 + WKB_HEADER_SIZE;
while (n_line_strings--)
{
Gis_line_string ls;
if (no_data(data, 0))
return 1;
ls.set_data_ptr(data, (uint32) (m_data_end - data));
if (ls.is_closed(closed))
return 1;
if (!*closed)
return 0;
/*
We know here that ls was ok, so we can call the trivial function
Gis_line_string::get_data_size without error checking
*/
data+= ls.get_data_size() + WKB_HEADER_SIZE;
}
return 0;
}
2011-05-04 20:20:17 +02:00
int Gis_multi_line_string::store_shapes(Gcalc_shape_transporter *trn) const
{
uint32 n_lines;
Gis_line_string ls;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_lines= uint4korr(data);
data+= 4;
if (trn->start_collection(n_lines))
return 1;
while (n_lines--)
{
if (no_data(data, WKB_HEADER_SIZE))
return 1;
data+= WKB_HEADER_SIZE;
ls.set_data_ptr(data, (uint32) (m_data_end - data));
if (ls.store_shapes(trn))
return 1;
data+= ls.get_data_size();
}
return 0;
}
const Geometry::Class_info *Gis_multi_line_string::get_class_info() const
{
return &multilinestring_class;
}
/***************************** MultiPolygon *******************************/
uint32 Gis_multi_polygon::get_data_size() const
{
uint32 n_polygons;
uint32 n_points;
const char *data= m_data;
if (no_data(data, 4))
return GET_SIZE_ERROR;
n_polygons= uint4korr(data);
data+= 4;
while (n_polygons--)
{
uint32 n_linear_rings;
if (no_data(data, 4 + WKB_HEADER_SIZE))
return GET_SIZE_ERROR;
n_linear_rings= uint4korr(data + WKB_HEADER_SIZE);
data+= 4 + WKB_HEADER_SIZE;
while (n_linear_rings--)
{
if (no_data(data, 4) ||
not_enough_points(data+4, (n_points= uint4korr(data))))
return GET_SIZE_ERROR;
data+= 4 + n_points * POINT_DATA_SIZE;
}
}
if (no_data(data, 0))
return GET_SIZE_ERROR;
return (uint32) (data - m_data);
}
bool Gis_multi_polygon::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
uint32 n_polygons= 0;
int np_pos= wkb->length();
Gis_polygon p;
if (wkb->reserve(4, 512))
return 1;
wkb->length(wkb->length()+4); // Reserve space for points
for (;;)
{
2011-05-04 20:20:17 +02:00
if (wkb->reserve(1 + 4, 512))
return 1;
wkb->q_append((char) wkb_ndr);
wkb->q_append((uint32) wkb_polygon);
if (trs->check_next_symbol('(') ||
p.init_from_wkt(trs, wkb) ||
trs->check_next_symbol(')'))
return 1;
n_polygons++;
if (trs->skip_char(',')) // Didn't find ','
break;
}
wkb->write_at_position(np_pos, n_polygons);
return 0;
}
uint Gis_multi_polygon::init_from_wkb(const char *wkb, uint len,
wkbByteOrder bo, String *res)
{
uint32 n_poly;
const char *wkb_orig= wkb;
if (len < 4)
return 0;
n_poly= wkb_get_uint(wkb, bo);
if (res->reserve(4, 512))
return 0;
res->q_append(n_poly);
wkb+=4;
while (n_poly--)
{
Gis_polygon p;
int p_len;
if (len < WKB_HEADER_SIZE ||
res->reserve(WKB_HEADER_SIZE, 512))
return 0;
res->q_append((char) wkb_ndr);
res->q_append((uint32) wkb_polygon);
if (!(p_len= p.init_from_wkb(wkb + WKB_HEADER_SIZE, len,
(wkbByteOrder) wkb[0], res)))
return 0;
p_len+= WKB_HEADER_SIZE;
wkb+= p_len;
len-= p_len;
}
return (uint) (wkb - wkb_orig);
}
2011-05-04 20:20:17 +02:00
uint Gis_multi_polygon::init_from_opresult(String *bin,
const char *opres, uint res_len)
2011-05-04 20:20:17 +02:00
{
Gis_polygon p;
const char *opres_orig= opres;
uint p_len;
uint32 n_poly= 0;
2011-05-04 20:20:17 +02:00
uint32 np_pos= bin->length();
if (bin->reserve(4, 512))
return 0;
bin->q_append(n_poly);
while (res_len)
2011-05-04 20:20:17 +02:00
{
if (bin->reserve(1 + 4, 512))
return 0;
bin->q_append((char)wkb_ndr);
bin->q_append((uint32)wkb_polygon);
if (!(p_len= p.init_from_opresult(bin, opres, res_len)))
2011-05-04 20:20:17 +02:00
return 0;
opres+= p_len;
res_len-= p_len;
2011-05-04 20:20:17 +02:00
n_poly++;
}
bin->write_at_position(np_pos, n_poly);
return (uint)(opres - opres_orig);
2011-05-04 20:20:17 +02:00
}
bool Gis_multi_polygon::init_from_json(json_engine_t *je, bool er_on_3D,
String *wkb)
{
uint32 n_polygons= 0;
int np_pos= wkb->length();
Gis_polygon p;
if (json_read_value(je))
return TRUE;
if (je->value_type != JSON_VALUE_ARRAY)
{
je->s.error= GEOJ_INCORRECT_GEOJSON;
return TRUE;
}
if (wkb->reserve(4, 512))
return TRUE;
wkb->length(wkb->length()+4); // Reserve space for n_rings
while (json_scan_next(je) == 0 && je->state != JST_ARRAY_END)
{
DBUG_ASSERT(je->state == JST_VALUE);
if (wkb->reserve(1 + 4, 512))
return TRUE;
wkb->q_append((char) wkb_ndr);
wkb->q_append((uint32) wkb_polygon);
if (p.init_from_json(je, er_on_3D, wkb))
return TRUE;
n_polygons++;
}
if (je->s.error)
return TRUE;
if (n_polygons == 0)
{
je->s.error= Geometry::GEOJ_EMPTY_COORDINATES;
return TRUE;
}
wkb->write_at_position(np_pos, n_polygons);
return FALSE;
}
bool Gis_multi_polygon::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_polygons;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_polygons= uint4korr(data);
data+= 4;
while (n_polygons--)
{
uint32 n_linear_rings;
if (no_data(data, 4 + WKB_HEADER_SIZE) ||
txt->reserve(1, 512))
return 1;
n_linear_rings= uint4korr(data+WKB_HEADER_SIZE);
data+= 4 + WKB_HEADER_SIZE;
txt->q_append('(');
while (n_linear_rings--)
{
if (no_data(data, 4))
return 1;
uint32 n_points= uint4korr(data);
data+= 4;
if (not_enough_points(data, n_points) ||
txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points,
512))
return 1;
txt->qs_append('(');
data= append_points(txt, n_points, data, 0);
(*txt) [txt->length() - 1]= ')';
txt->qs_append(',');
}
(*txt) [txt->length() - 1]= ')';
txt->qs_append(',');
}
txt->length(txt->length() - 1);
*end= data;
return 0;
}
bool Gis_multi_polygon::get_data_as_json(String *txt, uint max_dec_digits,
const char **end) const
{
uint32 n_polygons;
const char *data= m_data;
if (no_data(data, 4) || txt->reserve(1, 512))
return 1;
n_polygons= uint4korr(data);
data+= 4;
txt->q_append('[');
while (n_polygons--)
{
uint32 n_linear_rings;
if (no_data(data, 4 + WKB_HEADER_SIZE) ||
txt->reserve(1, 512))
return 1;
n_linear_rings= uint4korr(data+WKB_HEADER_SIZE);
data+= 4 + WKB_HEADER_SIZE;
txt->q_append('[');
while (n_linear_rings--)
{
if (no_data(data, 4))
return 1;
uint32 n_points= uint4korr(data);
data+= 4;
if (not_enough_points(data, n_points) ||
txt->reserve(2 + (MAX_DIGITS_IN_DOUBLE * 2 + 6) * n_points,
512))
return 1;
data= append_json_points(txt, max_dec_digits, n_points, data, 0);
txt->qs_append(", ", 2);
}
txt->length(txt->length() - 2);
txt->qs_append("], ", 3);
}
txt->length(txt->length() - 2);
txt->q_append(']');
*end= data;
return 0;
}
bool Gis_multi_polygon::get_mbr(MBR *mbr, const char **end) const
{
uint32 n_polygons;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_polygons= uint4korr(data);
data+= 4;
while (n_polygons--)
{
uint32 n_linear_rings;
if (no_data(data, 4+WKB_HEADER_SIZE))
return 1;
n_linear_rings= uint4korr(data + WKB_HEADER_SIZE);
data+= WKB_HEADER_SIZE + 4;
while (n_linear_rings--)
{
if (!(data= get_mbr_for_points(mbr, data, 0)))
return 1;
}
}
*end= data;
return 0;
}
int Gis_multi_polygon::num_geometries(uint32 *num) const
{
*num= uint4korr(m_data);
return 0;
}
int Gis_multi_polygon::geometry_n(uint32 num, String *result) const
{
uint32 n_polygons;
const char *data= m_data, *start_of_polygon;
if (no_data(data, 4))
return 1;
n_polygons= uint4korr(data);
data+= 4;
if (num > n_polygons || num < 1)
return -1;
do
{
uint32 n_linear_rings;
start_of_polygon= data;
if (no_data(data, WKB_HEADER_SIZE + 4))
return 1;
n_linear_rings= uint4korr(data + WKB_HEADER_SIZE);
data+= WKB_HEADER_SIZE + 4;
while (n_linear_rings--)
{
uint32 n_points;
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
if (not_enough_points(data + 4, n_points))
return 1;
data+= 4 + POINT_DATA_SIZE * n_points;
}
} while (--num);
if (no_data(data, 0)) // We must check last segment
return 1;
return result->append(start_of_polygon, (uint32) (data - start_of_polygon),
(uint32) 0);
}
int Gis_multi_polygon::area(double *ar, const char **end_of_data) const
{
uint32 n_polygons;
const char *data= m_data;
double result= 0;
if (no_data(data, 4))
return 1;
n_polygons= uint4korr(data);
data+= 4;
while (n_polygons--)
{
double p_area;
Gis_polygon p;
data+= WKB_HEADER_SIZE;
p.set_data_ptr(data, (uint32) (m_data_end - data));
if (p.area(&p_area, &data))
return 1;
result+= p_area;
}
*ar= result;
*end_of_data= data;
return 0;
}
int Gis_multi_polygon::centroid(String *result) const
{
uint32 n_polygons;
Gis_polygon p;
double res_area= 0.0, res_cx= 0.0, res_cy= 0.0;
double cur_area, cur_cx, cur_cy;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_polygons= uint4korr(data);
data+= 4;
while (n_polygons--)
{
data+= WKB_HEADER_SIZE;
p.set_data_ptr(data, (uint32) (m_data_end - data));
if (p.area(&cur_area, &data) ||
p.centroid_xy(&cur_cx, &cur_cy))
return 1;
res_area+= cur_area;
res_cx+= cur_area * cur_cx;
res_cy+= cur_area * cur_cy;
}
res_cx/= res_area;
res_cy/= res_area;
return create_point(result, res_cx, res_cy);
}
2011-05-04 20:20:17 +02:00
int Gis_multi_polygon::store_shapes(Gcalc_shape_transporter *trn) const
{
uint32 n_polygons;
Gis_polygon p;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_polygons= uint4korr(data);
data+= 4;
if (trn->start_collection(n_polygons))
return 1;
while (n_polygons--)
{
if (no_data(data, WKB_HEADER_SIZE))
return 1;
data+= WKB_HEADER_SIZE;
p.set_data_ptr(data, (uint32) (m_data_end - data));
if (p.store_shapes(trn))
return 1;
data+= p.get_data_size();
}
return 0;
}
const Geometry::Class_info *Gis_multi_polygon::get_class_info() const
{
return &multipolygon_class;
}
/************************* GeometryCollection ****************************/
uint32 Gis_geometry_collection::get_data_size() const
{
uint32 n_objects;
const char *data= m_data;
Geometry_buffer buffer;
Geometry *geom;
if (no_data(data, 4))
return GET_SIZE_ERROR;
n_objects= uint4korr(data);
data+= 4;
while (n_objects--)
{
uint32 wkb_type,object_size;
if (no_data(data, WKB_HEADER_SIZE))
return GET_SIZE_ERROR;
wkb_type= uint4korr(data + 1);
data+= WKB_HEADER_SIZE;
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return GET_SIZE_ERROR;
geom->set_data_ptr(data, (uint) (m_data_end - data));
if ((object_size= geom->get_data_size()) == GET_SIZE_ERROR)
return GET_SIZE_ERROR;
data+= object_size;
}
return (uint32) (data - m_data);
}
bool Gis_geometry_collection::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
uint32 n_objects= 0;
uint32 no_pos= wkb->length();
Geometry_buffer buffer;
Geometry *g;
char next_sym;
if (wkb->reserve(4, 512))
return 1;
wkb->length(wkb->length()+4); // Reserve space for points
if (!(next_sym= trs->next_symbol()))
return 1;
if (next_sym != ')')
{
LEX_STRING next_word;
if (trs->lookup_next_word(&next_word))
return 1;
if (next_word.length != 5 ||
(my_charset_latin1.strnncoll("empty", 5, next_word.str, 5) != 0))
{
for (;;)
{
if (!(g= create_from_wkt(&buffer, trs, wkb)))
return 1;
if (g->get_class_info()->m_type_id == wkb_geometrycollection)
{
trs->set_error_msg("Unexpected GEOMETRYCOLLECTION");
return 1;
}
n_objects++;
if (trs->skip_char(',')) // Didn't find ','
break;
}
}
}
wkb->write_at_position(no_pos, n_objects);
return 0;
}
2011-05-04 20:20:17 +02:00
uint Gis_geometry_collection::init_from_opresult(String *bin,
const char *opres,
uint res_len)
2011-05-04 20:20:17 +02:00
{
const char *opres_orig= opres;
Geometry_buffer buffer;
Geometry *geom;
int g_len;
uint32 wkb_type;
int no_pos= bin->length();
uint32 n_objects= 0;
2011-05-04 20:20:17 +02:00
if (bin->reserve(4, 512))
return 0;
bin->q_append(n_objects);
2011-05-04 20:20:17 +02:00
if (res_len == 0)
{
/* Special case of GEOMETRYCOLLECTION EMPTY. */
opres+= 1;
goto empty_geom;
}
while (res_len)
2011-05-04 20:20:17 +02:00
{
switch ((Gcalc_function::shape_type) uint4korr(opres))
{
case Gcalc_function::shape_point: wkb_type= wkb_point; break;
case Gcalc_function::shape_line: wkb_type= wkb_linestring; break;
case Gcalc_function::shape_polygon: wkb_type= wkb_polygon; break;
default: wkb_type= 0; DBUG_ASSERT(FALSE);
};
if (bin->reserve(WKB_HEADER_SIZE, 512))
return 0;
bin->q_append((char) wkb_ndr);
bin->q_append(wkb_type);
if (!(geom= create_by_typeid(&buffer, wkb_type)) ||
!(g_len= geom->init_from_opresult(bin, opres, res_len)))
2011-05-04 20:20:17 +02:00
return 0;
opres+= g_len;
res_len-= g_len;
n_objects++;
2011-05-04 20:20:17 +02:00
}
empty_geom:
bin->write_at_position(no_pos, n_objects);
2011-05-04 20:20:17 +02:00
return (uint) (opres - opres_orig);
}
uint Gis_geometry_collection::init_from_wkb(const char *wkb, uint len,
wkbByteOrder bo, String *res)
{
uint32 n_geom;
const char *wkb_orig= wkb;
if (len < 4)
return 0;
n_geom= wkb_get_uint(wkb, bo);
if (res->reserve(4, 512))
return 0;
res->q_append(n_geom);
wkb+= 4;
while (n_geom--)
{
Geometry_buffer buffer;
Geometry *geom;
int g_len;
uint32 wkb_type;
if (len < WKB_HEADER_SIZE ||
res->reserve(WKB_HEADER_SIZE, 512))
return 0;
res->q_append((char) wkb_ndr);
wkb_type= wkb_get_uint(wkb+1, (wkbByteOrder) wkb[0]);
res->q_append(wkb_type);
if (!(geom= create_by_typeid(&buffer, wkb_type)) ||
!(g_len= geom->init_from_wkb(wkb + WKB_HEADER_SIZE, len,
(wkbByteOrder) wkb[0], res)))
return 0;
g_len+= WKB_HEADER_SIZE;
wkb+= g_len;
len-= g_len;
}
return (uint) (wkb - wkb_orig);
}
bool Gis_geometry_collection::init_from_json(json_engine_t *je, bool er_on_3D,
String *wkb)
{
uint32 n_objects= 0;
uint32 no_pos= wkb->length();
Geometry_buffer buffer;
Geometry *g;
if (json_read_value(je))
return TRUE;
if (je->value_type != JSON_VALUE_ARRAY)
{
je->s.error= GEOJ_INCORRECT_GEOJSON;
return TRUE;
}
if (wkb->reserve(4, 512))
return TRUE;
wkb->length(wkb->length()+4); // Reserve space for n_objects
while (json_scan_next(je) == 0 && je->state != JST_ARRAY_END)
{
json_engine_t sav_je= *je;
DBUG_ASSERT(je->state == JST_VALUE);
if (!(g= create_from_json(&buffer, je, er_on_3D, wkb)))
return TRUE;
*je= sav_je;
if (json_skip_array_item(je))
return TRUE;
n_objects++;
}
wkb->write_at_position(no_pos, n_objects);
return FALSE;
}
bool Gis_geometry_collection::get_data_as_wkt(String *txt,
const char **end) const
{
uint32 n_objects;
Geometry_buffer buffer;
Geometry *geom;
const char *data= m_data;
if (no_data(data, 4))
return 1;
n_objects= uint4korr(data);
data+= 4;
if (n_objects == 0)
{
txt->append(STRING_WITH_LEN(" EMPTY"), 512);
goto exit;
}
txt->qs_append('(');
while (n_objects--)
{
uint32 wkb_type;
if (no_data(data, WKB_HEADER_SIZE))
return 1;
wkb_type= uint4korr(data + 1);
data+= WKB_HEADER_SIZE;
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
geom->set_data_ptr(data, (uint) (m_data_end - data));
if (geom->as_wkt(txt, &data))
return 1;
if (n_objects && txt->append(STRING_WITH_LEN(","), 512))
return 1;
}
txt->qs_append(')');
exit:
*end= data;
return 0;
}
bool Gis_geometry_collection::get_data_as_json(String *txt, uint max_dec_digits,
const char **end) const
{
uint32 n_objects;
Geometry_buffer buffer;
Geometry *geom;
const char *data= m_data;
if (no_data(data, 4) || txt->reserve(1, 512))
return 1;
n_objects= uint4korr(data);
data+= 4;
txt->qs_append('[');
while (n_objects--)
{
uint32 wkb_type;
if (no_data(data, WKB_HEADER_SIZE))
return 1;
wkb_type= uint4korr(data + 1);
data+= WKB_HEADER_SIZE;
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
geom->set_data_ptr(data, (uint) (m_data_end - data));
if (txt->append("{", 1) ||
geom->as_json(txt, max_dec_digits, &data) ||
txt->append(STRING_WITH_LEN("}, "), 512))
return 1;
}
txt->length(txt->length() - 2);
if (txt->append("]", 1))
return 1;
*end= data;
return 0;
}
bool Gis_geometry_collection::get_mbr(MBR *mbr, const char **end) const
{
uint32 n_objects;
const char *data= m_data;
Geometry_buffer buffer;
Geometry *geom;
if (no_data(data, 4))
return 1;
n_objects= uint4korr(data);
data+= 4;
if (n_objects == 0)
goto exit;
while (n_objects--)
{
uint32 wkb_type;
if (no_data(data, WKB_HEADER_SIZE))
return 1;
wkb_type= uint4korr(data + 1);
data+= WKB_HEADER_SIZE;
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
geom->set_data_ptr(data, (uint32) (m_data_end - data));
if (geom->get_mbr(mbr, &data))
return 1;
}
exit:
*end= data;
return 0;
}
int Gis_geometry_collection::area(double *ar, const char **end) const
{
uint32 n_objects;
const char *data= m_data;
Geometry_buffer buffer;
Geometry *geom;
double result;
if (no_data(data, 4))
return 1;
n_objects= uint4korr(data);
data+= 4;
result= 0.0;
if (n_objects == 0)
goto exit;
while (n_objects--)
{
uint32 wkb_type;
if (no_data(data, WKB_HEADER_SIZE))
return 1;
wkb_type= uint4korr(data + 1);
data+= WKB_HEADER_SIZE;
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
geom->set_data_ptr(data, (uint32) (m_data_end - data));
if (geom->area(ar, &data))
return 1;
result+= *ar;
}
exit:
*end= data;
*ar= result;
return 0;
}
int Gis_geometry_collection::geom_length(double *len, const char **end) const
{
uint32 n_objects;
const char *data= m_data;
Geometry_buffer buffer;
Geometry *geom;
double result;
if (no_data(data, 4))
return 1;
n_objects= uint4korr(data);
data+= 4;
result= 0.0;
if (n_objects == 0)
goto exit;
while (n_objects--)
{
uint32 wkb_type;
if (no_data(data, WKB_HEADER_SIZE))
return 1;
wkb_type= uint4korr(data + 1);
data+= WKB_HEADER_SIZE;
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
geom->set_data_ptr(data, (uint32) (m_data_end - data));
if (geom->geom_length(len, &data))
return 1;
result+= *len;
}
exit:
*end= data;
*len= result;
return 0;
}
int Gis_geometry_collection::num_geometries(uint32 *num) const
{
if (no_data(m_data, 4))
return 1;
*num= uint4korr(m_data);
return 0;
}
int Gis_geometry_collection::geometry_n(uint32 num, String *result) const
{
uint32 n_objects, wkb_type, length;
const char *data= m_data;
Geometry_buffer buffer;
Geometry *geom;
if (no_data(data, 4))
return 1;
n_objects= uint4korr(data);
data+= 4;
if (num > n_objects || num < 1)
return 1;
do
{
if (no_data(data, WKB_HEADER_SIZE))
return 1;
wkb_type= uint4korr(data + 1);
data+= WKB_HEADER_SIZE;
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
geom->set_data_ptr(data, (uint) (m_data_end - data));
if ((length= geom->get_data_size()) == GET_SIZE_ERROR)
return 1;
data+= length;
} while (--num);
/* Copy found object to result */
2011-05-04 20:20:17 +02:00
if (result->reserve(1 + 4 + length))
return 1;
result->q_append((char) wkb_ndr);
result->q_append((uint32) wkb_type);
result->q_append(data-length, length); // data-length = start_of_data
return 0;
}
/*
Return dimension for object
SYNOPSIS
dimension()
res_dim Result dimension
end End of object will be stored here. May be 0 for
simple objects!
RETURN
0 ok
1 error
*/
bool Gis_geometry_collection::dimension(uint32 *res_dim, const char **end) const
{
uint32 n_objects;
const char *data= m_data;
Geometry_buffer buffer;
Geometry *geom;
if (no_data(data, 4))
return 1;
n_objects= uint4korr(data);
data+= 4;
*res_dim= 0;
while (n_objects--)
{
uint32 wkb_type, length, dim;
const char *end_data;
if (no_data(data, WKB_HEADER_SIZE))
return 1;
wkb_type= uint4korr(data + 1);
data+= WKB_HEADER_SIZE;
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
geom->set_data_ptr(data, (uint32) (m_data_end - data));
if (geom->dimension(&dim, &end_data))
return 1;
set_if_bigger(*res_dim, dim);
if (end_data) // Complex object
data= end_data;
else if ((length= geom->get_data_size()) == GET_SIZE_ERROR)
return 1;
else
data+= length;
}
*end= data;
return 0;
}
2011-05-04 20:20:17 +02:00
int Gis_geometry_collection::store_shapes(Gcalc_shape_transporter *trn) const
{
uint32 n_objects;
const char *data= m_data;
Geometry_buffer buffer;
Geometry *geom;
if (no_data(data, 4))
return 1;
n_objects= uint4korr(data);
data+= 4;
if (!n_objects)
{
trn->empty_shape();
return 0;
}
2011-05-04 20:20:17 +02:00
if (trn->start_collection(n_objects))
return 1;
while (n_objects--)
{
uint32 wkb_type;
if (no_data(data, WKB_HEADER_SIZE))
return 1;
wkb_type= uint4korr(data + 1);
data+= WKB_HEADER_SIZE;
if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
geom->set_data_ptr(data, (uint32) (m_data_end - data));
if (geom->store_shapes(trn))
return 1;
data+= geom->get_data_size();
}
return 0;
}
const Geometry::Class_info *Gis_geometry_collection::get_class_info() const
{
return &geometrycollection_class;
}
#endif /*HAVE_SPATIAL*/