mariadb/sql/item_geofunc.cc

3905 lines
101 KiB
C++
Raw Normal View History

2016-06-14 13:55:28 +02:00
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates.
Copyright (c) 2011, 2016, MariaDB
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 */
2007-10-11 19:29:09 +02:00
/**
@file
@brief
This file defines all spatial functions
*/
Add ifdefs to control when "#pragma implementation" should be used Added some more ifdefs for "#pragma interface" client/sql_string.cc: USE_PRAGMA_IMPLEMENTATION client/sql_string.h: USE_PRAGMA_INTERFACE include/my_global.h: Use pragma implementation for gcc pre version 3 mysys/raid.cc: USE_PRAGMA_IMPLEMENTATION sql/field.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_berkeley.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_blackhole.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_heap.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_innodb.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_isam.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_isammrg.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_myisam.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_myisammrg.cc: USE_PRAGMA_IMPLEMENTATION sql/ha_ndbcluster.cc: USE_PRAGMA_IMPLEMENTATION sql/handler.cc: USE_PRAGMA_IMPLEMENTATION sql/hash_filo.cc: USE_PRAGMA_IMPLEMENTATION sql/item.cc: USE_PRAGMA_IMPLEMENTATION sql/item_cmpfunc.cc: USE_PRAGMA_IMPLEMENTATION sql/item_func.cc: USE_PRAGMA_IMPLEMENTATION sql/item_geofunc.cc: USE_PRAGMA_IMPLEMENTATION sql/item_strfunc.cc: USE_PRAGMA_IMPLEMENTATION sql/item_subselect.cc: USE_PRAGMA_IMPLEMENTATION sql/item_sum.cc: USE_PRAGMA_IMPLEMENTATION sql/item_timefunc.cc: USE_PRAGMA_IMPLEMENTATION sql/item_uniq.cc: USE_PRAGMA_IMPLEMENTATION sql/item_uniq.h: USE_PRAGMA_INTERFACE sql/log_event.cc: USE_PRAGMA_IMPLEMENTATION sql/log_event.h: USE_PRAGMA_INTERFACE sql/opt_range.cc: USE_PRAGMA_IMPLEMENTATION sql/procedure.cc: USE_PRAGMA_IMPLEMENTATION sql/protocol.cc: USE_PRAGMA_IMPLEMENTATION sql/protocol_cursor.cc: USE_PRAGMA_IMPLEMENTATION sql/set_var.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_analyse.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_analyse.h: USE_PRAGMA_INTERFACE sql/sql_class.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_crypt.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_crypt.h: USE_PRAGMA_IMPLEMENTATION sql/sql_list.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_map.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_map.h: USE_PRAGMA_INTERFACE sql/sql_olap.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_select.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_string.cc: USE_PRAGMA_IMPLEMENTATION sql/sql_udf.cc: USE_PRAGMA_IMPLEMENTATION sql/tztime.cc: USE_PRAGMA_IMPLEMENTATION
2005-05-26 12:09:14 +02:00
#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
#include "mariadb.h"
#include "sql_priv.h"
/*
It is necessary to include set_var.h instead of item.h because there
are dependencies on include order for set_var.h and item.h. This
will be resolved later.
*/
#include "sql_class.h" // THD, set_var.h: THD
#include "set_var.h"
#ifdef HAVE_SPATIAL
#include <m_ctype.h>
#include "opt_range.h"
#include "item_geofunc.h"
#include "item_create.h"
2011-05-04 20:20:17 +02:00
bool Item_geometry_func::fix_length_and_dec()
{
collation.set(&my_charset_bin);
decimals=0;
MDEV-9217 Split Item::tmp_table_field_from_field_type() into virtual methods in Type_handler - Adding Type_handler::make_table_field() and moving pieces of the code from Item::tmp_table_field_from_field_type() to virtual implementations for various type handlers. - Adding a new Type_all_attributes, to access to Item's extended attributes, such as decimal_precision() and geometry_type(). - Adding a new class Record_addr, to pass record related information to Type_handler methods (ptr, null_ptr and null_bit) as a single structure. Note, later it will possibly be extended for BIT-alike field purposes, by adding new members (bit_ptr_arg, bit_ofs_arg). - Moving the code from Field_new_decimal::create_from_item() to Type_handler_newdecimal::make_table_field(). - Removing Field_new_decimal() and Field_geom() helper constructor variants that were used for temporary field creation. - Adding Item_field::type_handler(), Field::type_handler() and Field_blob::type_handler() to return correct type handlers for blob variants, according to Field_blob::packlength. - Adding Type_handler_blob_common, as a common parent for Type_handler_tiny_blob, Type_handler_blob, Type_handler_medium_blob and Type_handler_long_blob. - Implementing Type_handler_blob_common::Item_hybrid_func_fix_attributes(). It's needed for cases when TEXT variants of different character sets are mixed in LEAST, GREATEST, CASE and its abreviations (IF, IFNULL, COALESCE), e.g.: CREATE TABLE t1 ( a TINYTEXT CHARACTER SET latin1, b TINYTEXT CHARACTER SET utf8 ); CREATE TABLE t2 AS SELECT COALESCE(a,b) FROM t1; Type handler aggregation returns TINYTEXT as a common data type for the two columns. But as conversion from latin1 to utf8 happens for "a", the maximum possible length of "a" grows from 255 to 255*3. Type_handler_blob_common::Item_hybrid_func_fix_attributes() makes sure to update the blob type handler according to max_length. - Adding Type_handler::blob_type_handler(uint max_octet_length). - Adding a few m_type_aggregator_for_result.add() pairs, because now Item_xxx::type_handler() can return pointers to type_handler_tiny_blob, type_handler_blob, type_handler_medium_blob, type_handler_long_blob. Before the patch only type_handler_blob was possible result of type_handler(). - Making type_handler_tiny_blob, type_handler_blob, type_handler_medium_blob, type_handler_long_blob public. - Removing the condition in Item_sum_avg::create_tmp_field() checking Item_sum_avg::result_type() against DECIMAL_RESULT. Now both REAL_RESULT and DECIMAL_RESULT are symmetrically handled by tmp_table_field_from_field_type(). - Removing Item_geometry_func::create_field_for_create_select(), as the inherited version perfectly works. - Fixing Item_func_as_wkb::field_type() to return MYSQL_TYPE_LONG_BLOB rather than MYSQL_TYPE_BLOB. It's needed to make sure that tmp_table_field_from_field_type() creates a LONGBLOB field for AsWKB(). - Fixing Item_func_as_wkt::fix_length_and_dec() to set max_length to UINT32_MAX rather than MAX_BLOB_WIDTH, to make sure that tmp_table_field_from_field_type() creates a LONGTEXT field for AsWKT(). - Removing Item_func_set_user_var::create_field_for_create_select(), as the inherited version works fine. - Adding Item_func_get_user_var::create_field_for_create_select() to make sure that "CREATE TABLE t1 AS SELECT @string_user variable" always creates a field of LONGTEXT/LONGBLOB type. - Item_func_ifnull::create_field_for_create_select() behavior has changed. Before the patch it passed set_blob_packflag=false, which meant to create LONGBLOB for all blob variants. Now it takes into account max_length, which gives better column data types for: CREATE TABLE t2 AS SELECT IFNULL(blob_column1, blob_column2) FROM t1; - Fixing Item_func_nullif::fix_length_and_dec() to use set_handler(args[2]->type_handler()) instead of set_handler_by_field_type(args[2]->field_type()). This is needed to distinguish between BLOB variants. - Implementing Item_blob::type_handler(), to make sure to create proper BLOB field variant, according to max_length, for queries like: CREATE TABLE t1 AS SELECT some_blob_field FROM INFORMATION_SCHEMA.SOME_TABLE; - Fixing Item_field::real_type_handler() to make sure that the code aggregating fields for UNION gets a proper BLOB variant type handler from fields. - Adding a special code into Item_type_holder::make_field_by_type(), to make sure that after aggregating field types it also properly takes into account max_length when mixing TEXT variants of different character sets and chooses a proper TEXT variant: CREATE TABLE t1 ( a TINYTEXT CHARACTER SET latin1, b TINYTEXT CHARACTER SET utf8 ); CREATE TABLE t2 AS SELECT a FROM t1 UNION SELECT b FROM t1; - Adding tests, for better coverage of IFNULL, NULLIF, UNION. - The fact that tmp_table_field_from_field_type() now takes into account BLOB variants (instead of always creating LONGBLOB), tests results for WEIGHT_STRING() and NULLIF() and UNION have become more precise.
2017-04-24 10:09:25 +02:00
max_length= (uint32) UINT_MAX32;
maybe_null= 1;
return FALSE;
}
String *Item_func_geometry_from_text::val_str(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
Geometry_buffer buffer;
String arg_val;
WL#2649 Number-to-string conversions added: include/ctype_numconv.inc mysql-test/include/ctype_numconv.inc mysql-test/r/ctype_binary.result mysql-test/t/ctype_binary.test Adding tests modified: mysql-test/r/bigint.result mysql-test/r/case.result mysql-test/r/create.result mysql-test/r/ctype_cp1251.result mysql-test/r/ctype_latin1.result mysql-test/r/ctype_ucs.result mysql-test/r/func_gconcat.result mysql-test/r/func_str.result mysql-test/r/metadata.result mysql-test/r/ps_1general.result mysql-test/r/ps_2myisam.result mysql-test/r/ps_3innodb.result mysql-test/r/ps_4heap.result mysql-test/r/ps_5merge.result mysql-test/r/show_check.result mysql-test/r/type_datetime.result mysql-test/r/type_ranges.result mysql-test/r/union.result mysql-test/suite/ndb/r/ps_7ndb.result mysql-test/t/ctype_cp1251.test mysql-test/t/ctype_latin1.test mysql-test/t/ctype_ucs.test mysql-test/t/func_str.test Fixing tests @ sql/field.cc - Return str result using my_charset_numeric. - Using real multi-byte aware str_to_XXX functions to handle tricky charset values propely (e.g. UCS2) @ sql/field.h - Changing derivation of non-string field types to DERIVATION_NUMERIC. - Changing binary() for numeric/datetime fields to always return TRUE even if charset is not my_charset_bin. We need this to keep ha_base_keytype() return HA_KEYTYPE_BINARY. - Adding BINARY_FLAG into some fields, because it's not being set automatically anymore with "my_charset_bin to my_charset_numeric" change. - Changing derivation for numeric/datetime datatypes to a weaker value, to make "SELECT concat('string', field)" use character set of the string literal for the result of the function. @ sql/item.cc - Implementing generic val_str_ascii(). - Using max_char_length() instead of direct read of max_length to make "tricky" charsets like UCS2 work. NOTE: in the future we'll possibly remove all direct reads of max_length - Fixing Item_num::safe_charset_converter(). Previously it alligned binary string to character string (for example by adding leading 0x00 when doing binary->UCS2 conversion). Now it just converts from my_charset_numbner to "tocs". - Using val_str_ascii() in Item::get_time() to make UCS2 arguments work. - Other misc changes @ sql/item.h - Changing MY_COLL_CMP_CONV and MY_COLL_ALLOW_CONV to bit operations instead of hard-coded bit masks. - Addding new method DTCollation.set_numeric(). - Adding new methods to Item. - Adding helper functions to make code look nicer: agg_item_charsets_for_string_result() agg_item_charsets_for_comparison() - Changing charset for Item_num-derived items from my_charset_bin to my_charset_numeric (which is an alias for latin1). @ sql/item_cmpfunc.cc - Using new helper functions - Other misc changes @ sql/item_cmpfunc.h - Fixing strcmp() to return max_length=2. Previously it returned 1, which was wrong, because it did not fit '-1'. @ sql/item_func.cc - Using new helper functions - Other minor changes @ sql/item_func.h - Removing unused functions - Adding helper functions agg_arg_charsets_for_string_result() agg_arg_charsets_for_comparison() - Adding set_numeric() into constructors of numeric items. - Using fix_length_and_charset() and fix_char_length() instead of direct write to max_length. @ sql/item_geofunc.cc - Changing class for Item_func_geometry_type and Item_func_as_wkt from Item_str_func to Item_str_ascii_func, to make them return UCS2 result properly (when character_set_connection=ucs2). @ sql/item_geofunc.h - Changing class for Item_func_geometry_type and Item_func_as_wkt from Item_str_func to Item_str_ascii_func, to make them return UCS2 result properly (when @@character_set_connection=ucs2). @ sql/item_strfunc.cc - Implementing Item_str_func::val_str(). - Renaming val_str to val_str_ascii for some items, to make them work with UCS2 properly. - Using new helper functions - All single-argument functions that expect string result now call this method: agg_arg_charsets_for_string_result(collation, args, 1); This enables character set conversion to @@character_set_connection in case of pure numeric input. @ sql/item_strfunc.h - Introducing Item_str_ascii_func - for functions which return pure ASCII data, for performance purposes, as well as for the cases when the old implementation of val_str() was heavily 8-bit oriented and implementing a UCS2-aware version is tricky. @ sql/item_sum.cc - Using new helper functions. @ sql/item_timefunc.cc - Using my_charset_numeric instead of my_charset_bin. - Using fix_char_length(), fix_length_and_charset() and fix_length_and_charset_datetime() instead of direct write to max_length. - Using tricky-charset aware function str_to_time_with_warn() @ sql/item_timefunc.h - Using new helper functions for charset and length initialization. - Changing base class for Item_func_get_format() to make it return UCS2 properly (when character_set_connection=ucs2). @ sql/item_xmlfunc.cc - Using new helper function @ sql/my_decimal.cc - Adding a new DECIMAL to CHAR converter with real multibyte support (e.g. UCS2) @ sql/mysql_priv.h - Introducing a new derivation level for numeric/datetime data types. - Adding macros for my_charset_numeric and MY_REPERTOIRE_NUMERIC. - Adding prototypes for str_set_decimal() - Adding prototypes for character-set aware str_to_xxx() functions. @ sql/protocol.cc - Changing charsetnr to "binary" client-side metadata for numeric/datetime data types. @ sql/time.cc - Adding to_ascii() helper function, to convert a string in any character set to ascii representation. In the future can be extended to understand digits written in various non-Latin word scripts. - Adding real multy-byte character set aware versions for str_to_XXXX, to make these these type of queries work correct: INSERT INTO t1 SET datetime_column=ucs2_expression; @ strings/ctype-ucs2.c - endptr was not calculated correctly. INSERTing of UCS2 values into numeric columns returned warnings about truncated wrong data.
2010-02-11 05:17:25 +01:00
String *wkt= args[0]->val_str_ascii(&arg_val);
if ((null_value= args[0]->null_value))
return 0;
Gis_read_stream trs(wkt->charset(), wkt->ptr(), wkt->length());
uint32 srid= 0;
if ((arg_count == 2) && !args[1]->null_value)
srid= (uint32)args[1]->val_int();
str->set_charset(&my_charset_bin);
str->length(0);
if (str->reserve(SRID_SIZE, 512))
return 0;
str->q_append(srid);
if ((null_value= !Geometry::create_from_wkt(&buffer, &trs, str, 0)))
return 0;
return str;
}
String *Item_func_geometry_from_wkb::val_str(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String arg_val;
String *wkb;
Geometry_buffer buffer;
uint32 srid= 0;
if (args[0]->field_type() == MYSQL_TYPE_GEOMETRY)
{
String *str_ret= args[0]->val_str(str);
null_value= args[0]->null_value;
return str_ret;
}
wkb= args[0]->val_str(&arg_val);
if ((arg_count == 2) && !args[1]->null_value)
srid= (uint32)args[1]->val_int();
str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
{
null_value= TRUE; /* purecov: inspected */
return 0; /* purecov: inspected */
}
str->length(0);
str->q_append(srid);
if ((null_value=
(args[0]->null_value ||
!Geometry::create_from_wkb(&buffer, wkb->ptr(), wkb->length(), str))))
return 0;
return str;
}
void report_json_error_ex(String *js, json_engine_t *je,
const char *fname, int n_param,
Sql_condition::enum_warning_level lv);
String *Item_func_geometry_from_json::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
Geometry_buffer buffer;
String *js= args[0]->val_str_ascii(&tmp_js);
uint32 srid= 0;
longlong options= 0;
json_engine_t je;
if ((null_value= args[0]->null_value))
return 0;
if (arg_count > 1 && !args[1]->null_value)
{
options= args[1]->val_int();
if (options > 4 || options < 1)
{
String *sv= args[1]->val_str(&tmp_js);
my_error(ER_WRONG_VALUE_FOR_TYPE, MYF(0),
"option", sv->c_ptr_safe(), "ST_GeometryFromJSON");
null_value= 1;
return 0;
}
}
if ((arg_count == 3) && !args[2]->null_value)
srid= (uint32)args[2]->val_int();
str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
return 0;
str->length(0);
str->q_append(srid);
json_scan_start(&je, js->charset(), (const uchar *) js->ptr(),
(const uchar *) js->end());
if ((null_value= !Geometry::create_from_json(&buffer, &je, options==1, str)))
{
int code= 0;
switch (je.s.error)
{
case Geometry::GEOJ_INCORRECT_GEOJSON:
code= ER_GEOJSON_INCORRECT;
break;
case Geometry::GEOJ_TOO_FEW_POINTS:
code= ER_GEOJSON_TOO_FEW_POINTS;
break;
case Geometry::GEOJ_EMPTY_COORDINATES:
code= ER_GEOJSON_EMPTY_COORDINATES;
break;
case Geometry::GEOJ_POLYGON_NOT_CLOSED:
code= ER_GEOJSON_NOT_CLOSED;
break;
case Geometry::GEOJ_DIMENSION_NOT_SUPPORTED:
my_error(ER_GIS_INVALID_DATA, MYF(0), "ST_GeometryFromJSON");
break;
default:
report_json_error_ex(js, &je, func_name(), 0, Sql_condition::WARN_LEVEL_WARN);
return NULL;
}
if (code)
{
THD *thd= current_thd;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, code,
ER_THD(thd, code));
}
return 0;
}
return str;
}
WL#2649 Number-to-string conversions added: include/ctype_numconv.inc mysql-test/include/ctype_numconv.inc mysql-test/r/ctype_binary.result mysql-test/t/ctype_binary.test Adding tests modified: mysql-test/r/bigint.result mysql-test/r/case.result mysql-test/r/create.result mysql-test/r/ctype_cp1251.result mysql-test/r/ctype_latin1.result mysql-test/r/ctype_ucs.result mysql-test/r/func_gconcat.result mysql-test/r/func_str.result mysql-test/r/metadata.result mysql-test/r/ps_1general.result mysql-test/r/ps_2myisam.result mysql-test/r/ps_3innodb.result mysql-test/r/ps_4heap.result mysql-test/r/ps_5merge.result mysql-test/r/show_check.result mysql-test/r/type_datetime.result mysql-test/r/type_ranges.result mysql-test/r/union.result mysql-test/suite/ndb/r/ps_7ndb.result mysql-test/t/ctype_cp1251.test mysql-test/t/ctype_latin1.test mysql-test/t/ctype_ucs.test mysql-test/t/func_str.test Fixing tests @ sql/field.cc - Return str result using my_charset_numeric. - Using real multi-byte aware str_to_XXX functions to handle tricky charset values propely (e.g. UCS2) @ sql/field.h - Changing derivation of non-string field types to DERIVATION_NUMERIC. - Changing binary() for numeric/datetime fields to always return TRUE even if charset is not my_charset_bin. We need this to keep ha_base_keytype() return HA_KEYTYPE_BINARY. - Adding BINARY_FLAG into some fields, because it's not being set automatically anymore with "my_charset_bin to my_charset_numeric" change. - Changing derivation for numeric/datetime datatypes to a weaker value, to make "SELECT concat('string', field)" use character set of the string literal for the result of the function. @ sql/item.cc - Implementing generic val_str_ascii(). - Using max_char_length() instead of direct read of max_length to make "tricky" charsets like UCS2 work. NOTE: in the future we'll possibly remove all direct reads of max_length - Fixing Item_num::safe_charset_converter(). Previously it alligned binary string to character string (for example by adding leading 0x00 when doing binary->UCS2 conversion). Now it just converts from my_charset_numbner to "tocs". - Using val_str_ascii() in Item::get_time() to make UCS2 arguments work. - Other misc changes @ sql/item.h - Changing MY_COLL_CMP_CONV and MY_COLL_ALLOW_CONV to bit operations instead of hard-coded bit masks. - Addding new method DTCollation.set_numeric(). - Adding new methods to Item. - Adding helper functions to make code look nicer: agg_item_charsets_for_string_result() agg_item_charsets_for_comparison() - Changing charset for Item_num-derived items from my_charset_bin to my_charset_numeric (which is an alias for latin1). @ sql/item_cmpfunc.cc - Using new helper functions - Other misc changes @ sql/item_cmpfunc.h - Fixing strcmp() to return max_length=2. Previously it returned 1, which was wrong, because it did not fit '-1'. @ sql/item_func.cc - Using new helper functions - Other minor changes @ sql/item_func.h - Removing unused functions - Adding helper functions agg_arg_charsets_for_string_result() agg_arg_charsets_for_comparison() - Adding set_numeric() into constructors of numeric items. - Using fix_length_and_charset() and fix_char_length() instead of direct write to max_length. @ sql/item_geofunc.cc - Changing class for Item_func_geometry_type and Item_func_as_wkt from Item_str_func to Item_str_ascii_func, to make them return UCS2 result properly (when character_set_connection=ucs2). @ sql/item_geofunc.h - Changing class for Item_func_geometry_type and Item_func_as_wkt from Item_str_func to Item_str_ascii_func, to make them return UCS2 result properly (when @@character_set_connection=ucs2). @ sql/item_strfunc.cc - Implementing Item_str_func::val_str(). - Renaming val_str to val_str_ascii for some items, to make them work with UCS2 properly. - Using new helper functions - All single-argument functions that expect string result now call this method: agg_arg_charsets_for_string_result(collation, args, 1); This enables character set conversion to @@character_set_connection in case of pure numeric input. @ sql/item_strfunc.h - Introducing Item_str_ascii_func - for functions which return pure ASCII data, for performance purposes, as well as for the cases when the old implementation of val_str() was heavily 8-bit oriented and implementing a UCS2-aware version is tricky. @ sql/item_sum.cc - Using new helper functions. @ sql/item_timefunc.cc - Using my_charset_numeric instead of my_charset_bin. - Using fix_char_length(), fix_length_and_charset() and fix_length_and_charset_datetime() instead of direct write to max_length. - Using tricky-charset aware function str_to_time_with_warn() @ sql/item_timefunc.h - Using new helper functions for charset and length initialization. - Changing base class for Item_func_get_format() to make it return UCS2 properly (when character_set_connection=ucs2). @ sql/item_xmlfunc.cc - Using new helper function @ sql/my_decimal.cc - Adding a new DECIMAL to CHAR converter with real multibyte support (e.g. UCS2) @ sql/mysql_priv.h - Introducing a new derivation level for numeric/datetime data types. - Adding macros for my_charset_numeric and MY_REPERTOIRE_NUMERIC. - Adding prototypes for str_set_decimal() - Adding prototypes for character-set aware str_to_xxx() functions. @ sql/protocol.cc - Changing charsetnr to "binary" client-side metadata for numeric/datetime data types. @ sql/time.cc - Adding to_ascii() helper function, to convert a string in any character set to ascii representation. In the future can be extended to understand digits written in various non-Latin word scripts. - Adding real multy-byte character set aware versions for str_to_XXXX, to make these these type of queries work correct: INSERT INTO t1 SET datetime_column=ucs2_expression; @ strings/ctype-ucs2.c - endptr was not calculated correctly. INSERTing of UCS2 values into numeric columns returned warnings about truncated wrong data.
2010-02-11 05:17:25 +01:00
String *Item_func_as_wkt::val_str_ascii(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
Geometry_buffer buffer;
Geometry *geom= NULL;
const char *dummy;
if ((null_value=
(args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
str->length(0);
str->set_charset(&my_charset_latin1);
if ((null_value= geom->as_wkt(str, &dummy)))
return 0;
return str;
}
bool Item_func_as_wkt::fix_length_and_dec()
{
WL#2649 Number-to-string conversions added: include/ctype_numconv.inc mysql-test/include/ctype_numconv.inc mysql-test/r/ctype_binary.result mysql-test/t/ctype_binary.test Adding tests modified: mysql-test/r/bigint.result mysql-test/r/case.result mysql-test/r/create.result mysql-test/r/ctype_cp1251.result mysql-test/r/ctype_latin1.result mysql-test/r/ctype_ucs.result mysql-test/r/func_gconcat.result mysql-test/r/func_str.result mysql-test/r/metadata.result mysql-test/r/ps_1general.result mysql-test/r/ps_2myisam.result mysql-test/r/ps_3innodb.result mysql-test/r/ps_4heap.result mysql-test/r/ps_5merge.result mysql-test/r/show_check.result mysql-test/r/type_datetime.result mysql-test/r/type_ranges.result mysql-test/r/union.result mysql-test/suite/ndb/r/ps_7ndb.result mysql-test/t/ctype_cp1251.test mysql-test/t/ctype_latin1.test mysql-test/t/ctype_ucs.test mysql-test/t/func_str.test Fixing tests @ sql/field.cc - Return str result using my_charset_numeric. - Using real multi-byte aware str_to_XXX functions to handle tricky charset values propely (e.g. UCS2) @ sql/field.h - Changing derivation of non-string field types to DERIVATION_NUMERIC. - Changing binary() for numeric/datetime fields to always return TRUE even if charset is not my_charset_bin. We need this to keep ha_base_keytype() return HA_KEYTYPE_BINARY. - Adding BINARY_FLAG into some fields, because it's not being set automatically anymore with "my_charset_bin to my_charset_numeric" change. - Changing derivation for numeric/datetime datatypes to a weaker value, to make "SELECT concat('string', field)" use character set of the string literal for the result of the function. @ sql/item.cc - Implementing generic val_str_ascii(). - Using max_char_length() instead of direct read of max_length to make "tricky" charsets like UCS2 work. NOTE: in the future we'll possibly remove all direct reads of max_length - Fixing Item_num::safe_charset_converter(). Previously it alligned binary string to character string (for example by adding leading 0x00 when doing binary->UCS2 conversion). Now it just converts from my_charset_numbner to "tocs". - Using val_str_ascii() in Item::get_time() to make UCS2 arguments work. - Other misc changes @ sql/item.h - Changing MY_COLL_CMP_CONV and MY_COLL_ALLOW_CONV to bit operations instead of hard-coded bit masks. - Addding new method DTCollation.set_numeric(). - Adding new methods to Item. - Adding helper functions to make code look nicer: agg_item_charsets_for_string_result() agg_item_charsets_for_comparison() - Changing charset for Item_num-derived items from my_charset_bin to my_charset_numeric (which is an alias for latin1). @ sql/item_cmpfunc.cc - Using new helper functions - Other misc changes @ sql/item_cmpfunc.h - Fixing strcmp() to return max_length=2. Previously it returned 1, which was wrong, because it did not fit '-1'. @ sql/item_func.cc - Using new helper functions - Other minor changes @ sql/item_func.h - Removing unused functions - Adding helper functions agg_arg_charsets_for_string_result() agg_arg_charsets_for_comparison() - Adding set_numeric() into constructors of numeric items. - Using fix_length_and_charset() and fix_char_length() instead of direct write to max_length. @ sql/item_geofunc.cc - Changing class for Item_func_geometry_type and Item_func_as_wkt from Item_str_func to Item_str_ascii_func, to make them return UCS2 result properly (when character_set_connection=ucs2). @ sql/item_geofunc.h - Changing class for Item_func_geometry_type and Item_func_as_wkt from Item_str_func to Item_str_ascii_func, to make them return UCS2 result properly (when @@character_set_connection=ucs2). @ sql/item_strfunc.cc - Implementing Item_str_func::val_str(). - Renaming val_str to val_str_ascii for some items, to make them work with UCS2 properly. - Using new helper functions - All single-argument functions that expect string result now call this method: agg_arg_charsets_for_string_result(collation, args, 1); This enables character set conversion to @@character_set_connection in case of pure numeric input. @ sql/item_strfunc.h - Introducing Item_str_ascii_func - for functions which return pure ASCII data, for performance purposes, as well as for the cases when the old implementation of val_str() was heavily 8-bit oriented and implementing a UCS2-aware version is tricky. @ sql/item_sum.cc - Using new helper functions. @ sql/item_timefunc.cc - Using my_charset_numeric instead of my_charset_bin. - Using fix_char_length(), fix_length_and_charset() and fix_length_and_charset_datetime() instead of direct write to max_length. - Using tricky-charset aware function str_to_time_with_warn() @ sql/item_timefunc.h - Using new helper functions for charset and length initialization. - Changing base class for Item_func_get_format() to make it return UCS2 properly (when character_set_connection=ucs2). @ sql/item_xmlfunc.cc - Using new helper function @ sql/my_decimal.cc - Adding a new DECIMAL to CHAR converter with real multibyte support (e.g. UCS2) @ sql/mysql_priv.h - Introducing a new derivation level for numeric/datetime data types. - Adding macros for my_charset_numeric and MY_REPERTOIRE_NUMERIC. - Adding prototypes for str_set_decimal() - Adding prototypes for character-set aware str_to_xxx() functions. @ sql/protocol.cc - Changing charsetnr to "binary" client-side metadata for numeric/datetime data types. @ sql/time.cc - Adding to_ascii() helper function, to convert a string in any character set to ascii representation. In the future can be extended to understand digits written in various non-Latin word scripts. - Adding real multy-byte character set aware versions for str_to_XXXX, to make these these type of queries work correct: INSERT INTO t1 SET datetime_column=ucs2_expression; @ strings/ctype-ucs2.c - endptr was not calculated correctly. INSERTing of UCS2 values into numeric columns returned warnings about truncated wrong data.
2010-02-11 05:17:25 +01:00
collation.set(default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII);
MDEV-9217 Split Item::tmp_table_field_from_field_type() into virtual methods in Type_handler - Adding Type_handler::make_table_field() and moving pieces of the code from Item::tmp_table_field_from_field_type() to virtual implementations for various type handlers. - Adding a new Type_all_attributes, to access to Item's extended attributes, such as decimal_precision() and geometry_type(). - Adding a new class Record_addr, to pass record related information to Type_handler methods (ptr, null_ptr and null_bit) as a single structure. Note, later it will possibly be extended for BIT-alike field purposes, by adding new members (bit_ptr_arg, bit_ofs_arg). - Moving the code from Field_new_decimal::create_from_item() to Type_handler_newdecimal::make_table_field(). - Removing Field_new_decimal() and Field_geom() helper constructor variants that were used for temporary field creation. - Adding Item_field::type_handler(), Field::type_handler() and Field_blob::type_handler() to return correct type handlers for blob variants, according to Field_blob::packlength. - Adding Type_handler_blob_common, as a common parent for Type_handler_tiny_blob, Type_handler_blob, Type_handler_medium_blob and Type_handler_long_blob. - Implementing Type_handler_blob_common::Item_hybrid_func_fix_attributes(). It's needed for cases when TEXT variants of different character sets are mixed in LEAST, GREATEST, CASE and its abreviations (IF, IFNULL, COALESCE), e.g.: CREATE TABLE t1 ( a TINYTEXT CHARACTER SET latin1, b TINYTEXT CHARACTER SET utf8 ); CREATE TABLE t2 AS SELECT COALESCE(a,b) FROM t1; Type handler aggregation returns TINYTEXT as a common data type for the two columns. But as conversion from latin1 to utf8 happens for "a", the maximum possible length of "a" grows from 255 to 255*3. Type_handler_blob_common::Item_hybrid_func_fix_attributes() makes sure to update the blob type handler according to max_length. - Adding Type_handler::blob_type_handler(uint max_octet_length). - Adding a few m_type_aggregator_for_result.add() pairs, because now Item_xxx::type_handler() can return pointers to type_handler_tiny_blob, type_handler_blob, type_handler_medium_blob, type_handler_long_blob. Before the patch only type_handler_blob was possible result of type_handler(). - Making type_handler_tiny_blob, type_handler_blob, type_handler_medium_blob, type_handler_long_blob public. - Removing the condition in Item_sum_avg::create_tmp_field() checking Item_sum_avg::result_type() against DECIMAL_RESULT. Now both REAL_RESULT and DECIMAL_RESULT are symmetrically handled by tmp_table_field_from_field_type(). - Removing Item_geometry_func::create_field_for_create_select(), as the inherited version perfectly works. - Fixing Item_func_as_wkb::field_type() to return MYSQL_TYPE_LONG_BLOB rather than MYSQL_TYPE_BLOB. It's needed to make sure that tmp_table_field_from_field_type() creates a LONGBLOB field for AsWKB(). - Fixing Item_func_as_wkt::fix_length_and_dec() to set max_length to UINT32_MAX rather than MAX_BLOB_WIDTH, to make sure that tmp_table_field_from_field_type() creates a LONGTEXT field for AsWKT(). - Removing Item_func_set_user_var::create_field_for_create_select(), as the inherited version works fine. - Adding Item_func_get_user_var::create_field_for_create_select() to make sure that "CREATE TABLE t1 AS SELECT @string_user variable" always creates a field of LONGTEXT/LONGBLOB type. - Item_func_ifnull::create_field_for_create_select() behavior has changed. Before the patch it passed set_blob_packflag=false, which meant to create LONGBLOB for all blob variants. Now it takes into account max_length, which gives better column data types for: CREATE TABLE t2 AS SELECT IFNULL(blob_column1, blob_column2) FROM t1; - Fixing Item_func_nullif::fix_length_and_dec() to use set_handler(args[2]->type_handler()) instead of set_handler_by_field_type(args[2]->field_type()). This is needed to distinguish between BLOB variants. - Implementing Item_blob::type_handler(), to make sure to create proper BLOB field variant, according to max_length, for queries like: CREATE TABLE t1 AS SELECT some_blob_field FROM INFORMATION_SCHEMA.SOME_TABLE; - Fixing Item_field::real_type_handler() to make sure that the code aggregating fields for UNION gets a proper BLOB variant type handler from fields. - Adding a special code into Item_type_holder::make_field_by_type(), to make sure that after aggregating field types it also properly takes into account max_length when mixing TEXT variants of different character sets and chooses a proper TEXT variant: CREATE TABLE t1 ( a TINYTEXT CHARACTER SET latin1, b TINYTEXT CHARACTER SET utf8 ); CREATE TABLE t2 AS SELECT a FROM t1 UNION SELECT b FROM t1; - Adding tests, for better coverage of IFNULL, NULLIF, UNION. - The fact that tmp_table_field_from_field_type() now takes into account BLOB variants (instead of always creating LONGBLOB), tests results for WEIGHT_STRING() and NULLIF() and UNION have become more precise.
2017-04-24 10:09:25 +02:00
max_length= (uint32) UINT_MAX32;
maybe_null= 1;
return FALSE;
}
String *Item_func_as_wkb::val_str(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
Geometry_buffer buffer;
if ((null_value=
(args[0]->null_value ||
!(Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
str->copy(swkb->ptr() + SRID_SIZE, swkb->length() - SRID_SIZE,
&my_charset_bin);
return str;
}
bool Item_func_as_geojson::fix_length_and_dec()
{
collation.set(default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII);
max_length=MAX_BLOB_WIDTH;
maybe_null= 1;
return FALSE;
}
String *Item_func_as_geojson::val_str_ascii(String *str)
{
DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
uint max_dec= FLOATING_POINT_DECIMALS;
longlong options= 0;
Geometry_buffer buffer;
Geometry *geom= NULL;
const char *dummy;
if ((null_value=
(args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
if (arg_count > 1)
{
max_dec= (uint) args[1]->val_int();
if (args[1]->null_value)
max_dec= FLOATING_POINT_DECIMALS;
if (arg_count > 2)
{
options= args[2]->val_int();
if (args[2]->null_value)
options= 0;
}
}
str->length(0);
str->set_charset(&my_charset_latin1);
if (str->reserve(1, 512))
return 0;
str->qs_append('{');
if (options & 1)
{
if (geom->bbox_as_json(str) || str->append(", ", 2))
goto error;
}
if ((geom->as_json(str, max_dec, &dummy) || str->append("}", 1)))
goto error;
return str;
error:
null_value= 1;
return 0;
}
WL#2649 Number-to-string conversions added: include/ctype_numconv.inc mysql-test/include/ctype_numconv.inc mysql-test/r/ctype_binary.result mysql-test/t/ctype_binary.test Adding tests modified: mysql-test/r/bigint.result mysql-test/r/case.result mysql-test/r/create.result mysql-test/r/ctype_cp1251.result mysql-test/r/ctype_latin1.result mysql-test/r/ctype_ucs.result mysql-test/r/func_gconcat.result mysql-test/r/func_str.result mysql-test/r/metadata.result mysql-test/r/ps_1general.result mysql-test/r/ps_2myisam.result mysql-test/r/ps_3innodb.result mysql-test/r/ps_4heap.result mysql-test/r/ps_5merge.result mysql-test/r/show_check.result mysql-test/r/type_datetime.result mysql-test/r/type_ranges.result mysql-test/r/union.result mysql-test/suite/ndb/r/ps_7ndb.result mysql-test/t/ctype_cp1251.test mysql-test/t/ctype_latin1.test mysql-test/t/ctype_ucs.test mysql-test/t/func_str.test Fixing tests @ sql/field.cc - Return str result using my_charset_numeric. - Using real multi-byte aware str_to_XXX functions to handle tricky charset values propely (e.g. UCS2) @ sql/field.h - Changing derivation of non-string field types to DERIVATION_NUMERIC. - Changing binary() for numeric/datetime fields to always return TRUE even if charset is not my_charset_bin. We need this to keep ha_base_keytype() return HA_KEYTYPE_BINARY. - Adding BINARY_FLAG into some fields, because it's not being set automatically anymore with "my_charset_bin to my_charset_numeric" change. - Changing derivation for numeric/datetime datatypes to a weaker value, to make "SELECT concat('string', field)" use character set of the string literal for the result of the function. @ sql/item.cc - Implementing generic val_str_ascii(). - Using max_char_length() instead of direct read of max_length to make "tricky" charsets like UCS2 work. NOTE: in the future we'll possibly remove all direct reads of max_length - Fixing Item_num::safe_charset_converter(). Previously it alligned binary string to character string (for example by adding leading 0x00 when doing binary->UCS2 conversion). Now it just converts from my_charset_numbner to "tocs". - Using val_str_ascii() in Item::get_time() to make UCS2 arguments work. - Other misc changes @ sql/item.h - Changing MY_COLL_CMP_CONV and MY_COLL_ALLOW_CONV to bit operations instead of hard-coded bit masks. - Addding new method DTCollation.set_numeric(). - Adding new methods to Item. - Adding helper functions to make code look nicer: agg_item_charsets_for_string_result() agg_item_charsets_for_comparison() - Changing charset for Item_num-derived items from my_charset_bin to my_charset_numeric (which is an alias for latin1). @ sql/item_cmpfunc.cc - Using new helper functions - Other misc changes @ sql/item_cmpfunc.h - Fixing strcmp() to return max_length=2. Previously it returned 1, which was wrong, because it did not fit '-1'. @ sql/item_func.cc - Using new helper functions - Other minor changes @ sql/item_func.h - Removing unused functions - Adding helper functions agg_arg_charsets_for_string_result() agg_arg_charsets_for_comparison() - Adding set_numeric() into constructors of numeric items. - Using fix_length_and_charset() and fix_char_length() instead of direct write to max_length. @ sql/item_geofunc.cc - Changing class for Item_func_geometry_type and Item_func_as_wkt from Item_str_func to Item_str_ascii_func, to make them return UCS2 result properly (when character_set_connection=ucs2). @ sql/item_geofunc.h - Changing class for Item_func_geometry_type and Item_func_as_wkt from Item_str_func to Item_str_ascii_func, to make them return UCS2 result properly (when @@character_set_connection=ucs2). @ sql/item_strfunc.cc - Implementing Item_str_func::val_str(). - Renaming val_str to val_str_ascii for some items, to make them work with UCS2 properly. - Using new helper functions - All single-argument functions that expect string result now call this method: agg_arg_charsets_for_string_result(collation, args, 1); This enables character set conversion to @@character_set_connection in case of pure numeric input. @ sql/item_strfunc.h - Introducing Item_str_ascii_func - for functions which return pure ASCII data, for performance purposes, as well as for the cases when the old implementation of val_str() was heavily 8-bit oriented and implementing a UCS2-aware version is tricky. @ sql/item_sum.cc - Using new helper functions. @ sql/item_timefunc.cc - Using my_charset_numeric instead of my_charset_bin. - Using fix_char_length(), fix_length_and_charset() and fix_length_and_charset_datetime() instead of direct write to max_length. - Using tricky-charset aware function str_to_time_with_warn() @ sql/item_timefunc.h - Using new helper functions for charset and length initialization. - Changing base class for Item_func_get_format() to make it return UCS2 properly (when character_set_connection=ucs2). @ sql/item_xmlfunc.cc - Using new helper function @ sql/my_decimal.cc - Adding a new DECIMAL to CHAR converter with real multibyte support (e.g. UCS2) @ sql/mysql_priv.h - Introducing a new derivation level for numeric/datetime data types. - Adding macros for my_charset_numeric and MY_REPERTOIRE_NUMERIC. - Adding prototypes for str_set_decimal() - Adding prototypes for character-set aware str_to_xxx() functions. @ sql/protocol.cc - Changing charsetnr to "binary" client-side metadata for numeric/datetime data types. @ sql/time.cc - Adding to_ascii() helper function, to convert a string in any character set to ascii representation. In the future can be extended to understand digits written in various non-Latin word scripts. - Adding real multy-byte character set aware versions for str_to_XXXX, to make these these type of queries work correct: INSERT INTO t1 SET datetime_column=ucs2_expression; @ strings/ctype-ucs2.c - endptr was not calculated correctly. INSERTing of UCS2 values into numeric columns returned warnings about truncated wrong data.
2010-02-11 05:17:25 +01:00
String *Item_func_geometry_type::val_str_ascii(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String *swkb= args[0]->val_str(str);
Geometry_buffer buffer;
Geometry *geom= NULL;
if ((null_value=
(args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
/* String will not move */
str->copy(geom->get_class_info()->m_name.str,
geom->get_class_info()->m_name.length,
&my_charset_latin1);
return str;
}
String *Item_func_envelope::val_str(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
Geometry_buffer buffer;
Geometry *geom= NULL;
uint32 srid;
if ((null_value=
args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))
return 0;
srid= uint4korr(swkb->ptr());
str->set_charset(&my_charset_bin);
str->length(0);
if (str->reserve(SRID_SIZE, 512))
return 0;
str->q_append(srid);
return (null_value= geom->envelope(str)) ? 0 : str;
}
int Item_func_boundary::Transporter::single_point(double x, double y)
{
return 0;
}
int Item_func_boundary::Transporter::start_line()
{
n_points= 0;
current_type= Gcalc_function::shape_line;
return 0;
}
int Item_func_boundary::Transporter::complete_line()
{
current_type= (Gcalc_function::shape_type) 0;
if (n_points > 1)
return m_receiver->single_point(last_x, last_y);
return 0;
}
int Item_func_boundary::Transporter::start_poly()
{
current_type= Gcalc_function::shape_polygon;
return 0;
}
int Item_func_boundary::Transporter::complete_poly()
{
current_type= (Gcalc_function::shape_type) 0;
return 0;
}
int Item_func_boundary::Transporter::start_ring()
{
n_points= 0;
return m_receiver->start_shape(Gcalc_function::shape_line);
}
int Item_func_boundary::Transporter::complete_ring()
{
if (n_points > 1)
{
m_receiver->add_point(last_x, last_y);
}
m_receiver->complete_shape();
return 0;
}
int Item_func_boundary::Transporter::add_point(double x, double y)
{
++n_points;
if (current_type== Gcalc_function::shape_polygon)
{
/* Polygon's ring case */
if (n_points == 1)
{
last_x= x;
last_y= y;
}
return m_receiver->add_point(x, y);
}
if (current_type== Gcalc_function::shape_line)
{
/* Line's case */
last_x= x;
last_y= y;
if (n_points == 1)
return m_receiver->single_point(x, y);
}
return 0;
}
int Item_func_boundary::Transporter::start_collection(int n_objects)
{
return 0;
}
String *Item_func_boundary::val_str(String *str_value)
{
DBUG_ENTER("Item_func_boundary::val_str");
DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
Geometry_buffer buffer;
Geometry *g;
uint32 srid= 0;
Transporter trn(&res_receiver);
if ((null_value=
args[0]->null_value ||
!(g= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))
DBUG_RETURN(0);
if (g->store_shapes(&trn))
goto mem_error;
str_value->set_charset(&my_charset_bin);
if (str_value->reserve(SRID_SIZE, 512))
goto mem_error;
str_value->length(0);
str_value->q_append(srid);
if (!Geometry::create_from_opresult(&buffer, str_value, res_receiver))
goto mem_error;
res_receiver.reset();
DBUG_RETURN(str_value);
mem_error:
null_value= 1;
DBUG_RETURN(0);
}
String *Item_func_centroid::val_str(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
Geometry_buffer buffer;
Geometry *geom= NULL;
uint32 srid;
if ((null_value= args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))
return 0;
str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
return 0;
str->length(0);
srid= uint4korr(swkb->ptr());
str->q_append(srid);
return (null_value= MY_TEST(geom->centroid(str))) ? 0 : str;
}
int Item_func_convexhull::add_node_to_line(ch_node **p_cur, int dir,
const Gcalc_heap::Info *pi)
{
ch_node *new_node;
ch_node *cur= *p_cur;
while (cur->prev)
{
int v_sign= Gcalc_scan_iterator::point::cmp_dx_dy(
cur->prev->pi, cur->pi, cur->pi, pi);
if (v_sign*dir <0)
break;
new_node= cur;
cur= cur->prev;
res_heap.free_item(new_node);
}
if (!(new_node= new_ch_node()))
return 1;
cur->next= new_node;
new_node->prev= cur;
new_node->pi= pi;
*p_cur= new_node;
return 0;
}
#ifndef HEAVY_CONVEX_HULL
String *Item_func_convexhull::val_str(String *str_value)
{
Geometry_buffer buffer;
Geometry *geom= NULL;
MBR mbr;
const char *c_end;
Gcalc_operation_transporter trn(&func, &collector);
uint32 srid= 0;
ch_node *left_first, *left_cur, *right_first, *right_cur;
Gcalc_heap::Info *cur_pi;
DBUG_ENTER("Item_func_convexhull::val_str");
DBUG_ASSERT(fixed == 1);
String *swkb= args[0]->val_str(&tmp_value);
if ((null_value=
args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))
DBUG_RETURN(0);
geom->get_mbr(&mbr, &c_end);
collector.set_extent(mbr.xmin, mbr.xmax, mbr.ymin, mbr.ymax);
if ((null_value= geom->store_shapes(&trn)))
{
str_value= 0;
goto mem_error;
}
collector.prepare_operation();
if (!(cur_pi= collector.get_first()))
goto build_result; /* An EMPTY GEOMETRY */
if (!cur_pi->get_next())
{
/* Single point. */
2016-02-23 21:35:05 +01:00
if (res_receiver.single_point(cur_pi->node.shape.x, cur_pi->node.shape.y))
goto mem_error;
goto build_result;
}
left_cur= left_first= new_ch_node();
right_cur= right_first= new_ch_node();
right_first->prev= left_first->prev= 0;
right_first->pi= left_first->pi= cur_pi;
while ((cur_pi= cur_pi->get_next()))
{
/* Handle left part of the hull, then the right part. */
if (add_node_to_line(&left_cur, 1, cur_pi))
goto mem_error;
if (add_node_to_line(&right_cur, -1, cur_pi))
goto mem_error;
}
left_cur->next= 0;
if (left_first->get_next()->get_next() == NULL &&
right_cur->prev->prev == NULL)
{
/* We only have 2 nodes in the result, so we create a polyline. */
if (res_receiver.start_shape(Gcalc_function::shape_line) ||
2016-02-23 21:35:05 +01:00
res_receiver.add_point(left_first->pi->node.shape.x, left_first->pi->node.shape.y) ||
res_receiver.add_point(left_cur->pi->node.shape.x, left_cur->pi->node.shape.y) ||
res_receiver.complete_shape())
goto mem_error;
goto build_result;
}
if (res_receiver.start_shape(Gcalc_function::shape_polygon))
goto mem_error;
while (left_first)
{
2016-02-23 21:35:05 +01:00
if (res_receiver.add_point(left_first->pi->node.shape.x, left_first->pi->node.shape.y))
goto mem_error;
left_first= left_first->get_next();
}
/* Skip last point in the right part as it coincides */
/* with the last one in the left. */
right_cur= right_cur->prev;
while (right_cur->prev)
{
2016-02-23 21:35:05 +01:00
if (res_receiver.add_point(right_cur->pi->node.shape.x, right_cur->pi->node.shape.y))
goto mem_error;
right_cur= right_cur->prev;
}
res_receiver.complete_shape();
build_result:
str_value->set_charset(&my_charset_bin);
if (str_value->reserve(SRID_SIZE, 512))
goto mem_error;
str_value->length(0);
str_value->q_append(srid);
if (!Geometry::create_from_opresult(&buffer, str_value, res_receiver))
goto mem_error;
mem_error:
collector.reset();
func.reset();
res_receiver.reset();
res_heap.reset();
DBUG_RETURN(str_value);
}
#else /*HEAVY_CONVEX_HULL*/
String *Item_func_convexhull::val_str(String *str_value)
{
Geometry_buffer buffer;
Geometry *geom= NULL;
MBR mbr;
const char *c_end;
Gcalc_operation_transporter trn(&func, &collector);
const Gcalc_scan_iterator::event_point *ev;
uint32 srid= 0;
ch_node *left_first, *left_cur, *right_first, *right_cur;
DBUG_ENTER("Item_func_convexhull::val_str");
DBUG_ASSERT(fixed == 1);
String *swkb= args[0]->val_str(&tmp_value);
if ((null_value=
args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length()))))
DBUG_RETURN(0);
geom->get_mbr(&mbr, &c_end);
collector.set_extent(mbr.xmin, mbr.xmax, mbr.ymin, mbr.ymax);
if ((null_value= geom->store_shapes(&trn)))
{
str_value= 0;
goto mem_error;
}
collector.prepare_operation();
scan_it.init(&collector);
scan_it.killed= (int *) &(current_thd->killed);
if (!scan_it.more_points())
goto build_result; /* An EMPTY GEOMETRY */
if (scan_it.step())
goto mem_error;
if (!scan_it.more_points())
{
/* Single point. */
if (res_receiver.single_point(scan_it.get_events()->pi->x,
scan_it.get_events()->pi->y))
goto mem_error;
goto build_result;
}
left_cur= left_first= new_ch_node();
right_cur= right_first= new_ch_node();
right_first->prev= left_first->prev= 0;
right_first->pi= left_first->pi= scan_it.get_events()->pi;
while (scan_it.more_points())
{
if (scan_it.step())
goto mem_error;
ev= scan_it.get_events();
/* Skip the intersections-only events. */
while (ev->event == scev_intersection)
{
ev= ev->get_next();
if (!ev)
goto skip_point;
}
{
Gcalc_point_iterator pit(&scan_it);
if (!pit.point() || scan_it.get_event_position() == pit.point())
{
/* Handle left part of the hull. */
if (add_node_to_line(&left_cur, 1, ev->pi))
goto mem_error;
}
if (pit.point())
{
/* Check the rightmost point */
for(; pit.point()->c_get_next(); ++pit)
;
}
if (!pit.point() || pit.point()->event ||
scan_it.get_event_position() == pit.point()->c_get_next())
{
/* Handle right part of the hull. */
if (add_node_to_line(&right_cur, -1, ev->pi))
goto mem_error;
}
}
skip_point:;
}
left_cur->next= 0;
if (left_first->get_next()->get_next() == NULL &&
right_cur->prev->prev == NULL)
{
/* We only have 2 nodes in the result, so we create a polyline. */
if (res_receiver.start_shape(Gcalc_function::shape_line) ||
res_receiver.add_point(left_first->pi->x, left_first->pi->y) ||
res_receiver.add_point(left_cur->pi->x, left_cur->pi->y) ||
res_receiver.complete_shape())
goto mem_error;
goto build_result;
}
if (res_receiver.start_shape(Gcalc_function::shape_polygon))
goto mem_error;
while (left_first)
{
if (res_receiver.add_point(left_first->pi->x, left_first->pi->y))
goto mem_error;
left_first= left_first->get_next();
}
/* Skip last point in the right part as it coincides */
/* with the last one in the left. */
right_cur= right_cur->prev;
while (right_cur->prev)
{
if (res_receiver.add_point(right_cur->pi->x, right_cur->pi->y))
goto mem_error;
right_cur= right_cur->prev;
}
res_receiver.complete_shape();
build_result:
str_value->set_charset(&my_charset_bin);
if (str_value->reserve(SRID_SIZE, 512))
goto mem_error;
str_value->length(0);
str_value->q_append(srid);
if (!Geometry::create_from_opresult(&buffer, str_value, res_receiver))
goto mem_error;
mem_error:
collector.reset();
func.reset();
res_receiver.reset();
res_heap.reset();
DBUG_RETURN(str_value);
}
#endif /*HEAVY_CONVEX_HULL*/
/*
Spatial decomposition functions
*/
String *Item_func_spatial_decomp::val_str(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
Geometry_buffer buffer;
Geometry *geom= NULL;
uint32 srid;
if ((null_value=
(args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
srid= uint4korr(swkb->ptr());
str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
goto err;
str->length(0);
str->q_append(srid);
switch (decomp_func) {
case SP_STARTPOINT:
if (geom->start_point(str))
goto err;
break;
case SP_ENDPOINT:
if (geom->end_point(str))
goto err;
break;
case SP_EXTERIORRING:
if (geom->exterior_ring(str))
goto err;
break;
default:
goto err;
}
return str;
err:
null_value= 1;
return 0;
}
String *Item_func_spatial_decomp_n::val_str(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
long n= (long) args[1]->val_int();
Geometry_buffer buffer;
Geometry *geom= NULL;
uint32 srid;
if ((null_value=
(args[0]->null_value || args[1]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())))))
return 0;
str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
goto err;
srid= uint4korr(swkb->ptr());
str->length(0);
str->q_append(srid);
switch (decomp_func_n)
{
case SP_POINTN:
if (geom->point_n(n,str))
goto err;
break;
case SP_GEOMETRYN:
if (geom->geometry_n(n,str))
goto err;
break;
case SP_INTERIORRINGN:
if (geom->interior_ring_n(n,str))
goto err;
break;
default:
goto err;
}
return str;
err:
null_value=1;
return 0;
}
/*
Functions to concatenate various spatial objects
*/
/*
* Concatenate doubles into Point
*/
String *Item_func_point::val_str(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
double x= args[0]->val_real();
double y= args[1]->val_real();
uint32 srid= 0;
if ((null_value= (args[0]->null_value ||
2011-05-04 20:20:17 +02:00
args[1]->null_value ||
str->alloc(4/*SRID*/ + 1 + 4 + SIZEOF_STORED_DOUBLE * 2))))
return 0;
str->set_charset(&my_charset_bin);
str->length(0);
str->q_append(srid);
str->q_append((char)Geometry::wkb_ndr);
str->q_append((uint32)Geometry::wkb_point);
str->q_append(x);
str->q_append(y);
return str;
}
2007-10-11 19:29:09 +02:00
/**
Concatenates various items into various collections
with checkings for valid wkb type of items.
For example, MultiPoint can be a collection of Points only.
coll_type contains wkb type of target collection.
item_type contains a valid wkb type of items.
In the case when coll_type is wkbGeometryCollection,
we do not check wkb type of items, any is valid.
*/
String *Item_func_spatial_collection::val_str(String *str)
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String arg_value;
uint i;
uint32 srid= 0;
str->set_charset(&my_charset_bin);
str->length(0);
if (str->reserve(4/*SRID*/ + 1 + 4 + 4, 512))
goto err;
str->q_append(srid);
str->q_append((char) Geometry::wkb_ndr);
str->q_append((uint32) coll_type);
str->q_append((uint32) arg_count);
for (i= 0; i < arg_count; ++i)
{
String *res= args[i]->val_str(&arg_value);
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
uint32 len;
if (args[i]->null_value || ((len= res->length()) < WKB_HEADER_SIZE))
goto err;
if (coll_type == Geometry::wkb_geometrycollection)
{
/*
In the case of GeometryCollection we don't need any checkings
for item types, so just copy them into target collection
*/
if (str->append(res->ptr() + 4/*SRID*/, len - 4/*SRID*/, (uint32) 512))
goto err;
}
else
{
enum Geometry::wkbType wkb_type;
const uint data_offset= 4/*SRID*/ + 1;
if (res->length() < data_offset + sizeof(uint32))
goto err;
const char *data= res->ptr() + data_offset;
/*
In the case of named collection we must check that items
are of specific type, let's do this checking now
*/
wkb_type= (Geometry::wkbType) uint4korr(data);
data+= 4;
len-= 5 + 4/*SRID*/;
if (wkb_type != item_type)
goto err;
switch (coll_type) {
case Geometry::wkb_multipoint:
case Geometry::wkb_multilinestring:
case Geometry::wkb_multipolygon:
if (len < WKB_HEADER_SIZE ||
str->append(data-WKB_HEADER_SIZE, len+WKB_HEADER_SIZE, 512))
goto err;
break;
case Geometry::wkb_linestring:
if (len < POINT_DATA_SIZE || str->append(data, POINT_DATA_SIZE, 512))
goto err;
break;
case Geometry::wkb_polygon:
{
uint32 n_points;
double x1, y1, x2, y2;
const char *org_data= data;
if (len < 4)
goto err;
n_points= uint4korr(data);
data+= 4;
if (n_points < 2 || len < 4 + n_points * POINT_DATA_SIZE)
goto err;
float8get(x1, data);
data+= SIZEOF_STORED_DOUBLE;
float8get(y1, data);
data+= SIZEOF_STORED_DOUBLE;
data+= (n_points - 2) * POINT_DATA_SIZE;
float8get(x2, data);
float8get(y2, data + SIZEOF_STORED_DOUBLE);
if ((x1 != x2) || (y1 != y2) ||
str->append(org_data, len, 512))
goto err;
}
break;
default:
goto err;
}
}
}
if (str->length() > current_thd->variables.max_allowed_packet)
{
THD *thd= current_thd;
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
ER_THD(thd, ER_WARN_ALLOWED_PACKET_OVERFLOWED),
func_name(), thd->variables.max_allowed_packet);
goto err;
}
null_value = 0;
return str;
err:
null_value= 1;
return 0;
}
/*
Functions for spatial relations
*/
static SEL_ARG sel_arg_impossible(SEL_ARG::IMPOSSIBLE);
SEL_ARG *
Item_func_spatial_rel::get_mm_leaf(RANGE_OPT_PARAM *param,
Field *field, KEY_PART *key_part,
Item_func::Functype type, Item *value)
{
DBUG_ENTER("Item_func_spatial_rel::get_mm_leaf");
if (key_part->image_type != Field::itMBR)
DBUG_RETURN(0);
if (value->cmp_type() != STRING_RESULT)
DBUG_RETURN(&sel_arg_impossible);
if (param->using_real_indexes &&
!field->optimize_range(param->real_keynr[key_part->key],
key_part->part))
DBUG_RETURN(0);
Field_geom *field_geom= dynamic_cast<Field_geom*>(field);
DBUG_ASSERT(field_geom);
const Type_handler_geometry *sav_geom_type= field_geom->type_handler_geom();
// We have to be able to store all sorts of spatial features here
field_geom->set_type_handler(&type_handler_geometry);
bool rc= value->save_in_field_no_warnings(field, 1);
field_geom->set_type_handler(sav_geom_type);
if (rc)
DBUG_RETURN(&sel_arg_impossible); // Bad GEOMETRY value
DBUG_ASSERT(!field->real_maybe_null()); // SPATIAL keys do not support NULL
uchar *str= (uchar*) alloc_root(param->mem_root, key_part->store_length + 1);
if (!str)
DBUG_RETURN(0); // out of memory
field->get_key_image(str, key_part->length, key_part->image_type);
SEL_ARG *tree;
if (!(tree= new (param->mem_root) SEL_ARG(field, str, str)))
DBUG_RETURN(0); // out of memory
switch (type) {
case SP_EQUALS_FUNC:
tree->min_flag= GEOM_FLAG | HA_READ_MBR_EQUAL;// NEAR_MIN;//512;
tree->max_flag= NO_MAX_RANGE;
break;
case SP_DISJOINT_FUNC:
tree->min_flag= GEOM_FLAG | HA_READ_MBR_DISJOINT;// NEAR_MIN;//512;
tree->max_flag= NO_MAX_RANGE;
break;
case SP_INTERSECTS_FUNC:
tree->min_flag= GEOM_FLAG | HA_READ_MBR_INTERSECT;// NEAR_MIN;//512;
tree->max_flag= NO_MAX_RANGE;
break;
case SP_TOUCHES_FUNC:
tree->min_flag= GEOM_FLAG | HA_READ_MBR_INTERSECT;// NEAR_MIN;//512;
tree->max_flag= NO_MAX_RANGE;
break;
case SP_CROSSES_FUNC:
tree->min_flag= GEOM_FLAG | HA_READ_MBR_INTERSECT;// NEAR_MIN;//512;
tree->max_flag= NO_MAX_RANGE;
break;
case SP_WITHIN_FUNC:
tree->min_flag= GEOM_FLAG | HA_READ_MBR_CONTAIN;// NEAR_MIN;//512;
tree->max_flag= NO_MAX_RANGE;
break;
case SP_CONTAINS_FUNC:
tree->min_flag= GEOM_FLAG | HA_READ_MBR_WITHIN;// NEAR_MIN;//512;
tree->max_flag= NO_MAX_RANGE;
break;
case SP_OVERLAPS_FUNC:
tree->min_flag= GEOM_FLAG | HA_READ_MBR_INTERSECT;// NEAR_MIN;//512;
tree->max_flag= NO_MAX_RANGE;
break;
default:
DBUG_ASSERT(0);
break;
}
DBUG_RETURN(tree);
}
2011-05-04 20:20:17 +02:00
const char *Item_func_spatial_mbr_rel::func_name() const
{
switch (spatial_rel) {
case SP_CONTAINS_FUNC:
return "mbrcontains";
case SP_WITHIN_FUNC:
return "mbrwithin";
case SP_EQUALS_FUNC:
return "mbrequals";
case SP_DISJOINT_FUNC:
return "mbrdisjoint";
case SP_INTERSECTS_FUNC:
return "mbrintersects";
case SP_TOUCHES_FUNC:
return "mbrtouches";
case SP_CROSSES_FUNC:
return "mbrcrosses";
case SP_OVERLAPS_FUNC:
return "mbroverlaps";
default:
DBUG_ASSERT(0); // Should never happened
return "mbrsp_unknown";
}
}
longlong Item_func_spatial_mbr_rel::val_int()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String *res1= args[0]->val_str(&tmp_value1);
String *res2= args[1]->val_str(&tmp_value2);
Geometry_buffer buffer1, buffer2;
Geometry *g1, *g2;
MBR mbr1, mbr2;
const char *dummy;
if ((null_value=
(args[0]->null_value ||
args[1]->null_value ||
!(g1= Geometry::construct(&buffer1, res1->ptr(), res1->length())) ||
!(g2= Geometry::construct(&buffer2, res2->ptr(), res2->length())) ||
g1->get_mbr(&mbr1, &dummy) || !mbr1.valid() ||
g2->get_mbr(&mbr2, &dummy) || !mbr2.valid())))
return 0;
switch (spatial_rel) {
case SP_CONTAINS_FUNC:
return mbr1.contains(&mbr2);
case SP_WITHIN_FUNC:
return mbr1.within(&mbr2);
case SP_EQUALS_FUNC:
return mbr1.equals(&mbr2);
case SP_DISJOINT_FUNC:
return mbr1.disjoint(&mbr2);
case SP_INTERSECTS_FUNC:
return mbr1.intersects(&mbr2);
case SP_TOUCHES_FUNC:
return mbr1.touches(&mbr2);
case SP_OVERLAPS_FUNC:
return mbr1.overlaps(&mbr2);
case SP_CROSSES_FUNC:
return 0;
default:
break;
}
null_value=1;
return 0;
}
const char *Item_func_spatial_precise_rel::func_name() const
2011-05-04 20:20:17 +02:00
{
switch (spatial_rel) {
case SP_CONTAINS_FUNC:
return "st_contains";
case SP_WITHIN_FUNC:
return "st_within";
case SP_EQUALS_FUNC:
return "st_equals";
case SP_DISJOINT_FUNC:
return "st_disjoint";
case SP_INTERSECTS_FUNC:
return "st_intersects";
case SP_TOUCHES_FUNC:
return "st_touches";
case SP_CROSSES_FUNC:
return "st_crosses";
case SP_OVERLAPS_FUNC:
return "st_overlaps";
default:
DBUG_ASSERT(0); // Should never happened
return "sp_unknown";
}
}
static double count_edge_t(const Gcalc_heap::Info *ea,
const Gcalc_heap::Info *eb,
const Gcalc_heap::Info *v,
double &ex, double &ey, double &vx, double &vy,
double &e_sqrlen)
{
ex= eb->node.shape.x - ea->node.shape.x;
ey= eb->node.shape.y - ea->node.shape.y;
vx= v->node.shape.x - ea->node.shape.x;
vy= v->node.shape.y - ea->node.shape.y;
2011-05-04 20:20:17 +02:00
e_sqrlen= ex * ex + ey * ey;
return (ex * vx + ey * vy) / e_sqrlen;
}
static double distance_to_line(double ex, double ey, double vx, double vy,
double e_sqrlen)
{
return fabs(vx * ey - vy * ex) / sqrt(e_sqrlen);
}
static double distance_points(const Gcalc_heap::Info *a,
const Gcalc_heap::Info *b)
{
double x= a->node.shape.x - b->node.shape.x;
double y= a->node.shape.y - b->node.shape.y;
2011-05-04 20:20:17 +02:00
return sqrt(x * x + y * y);
}
static Gcalc_function::op_type op_matrix(int n)
{
switch (n)
{
case 0:
return Gcalc_function::op_internals;
case 1:
return Gcalc_function::op_border;
case 2:
return (Gcalc_function::op_type)
((int) Gcalc_function::op_not | (int) Gcalc_function::op_union);
};
GCALC_DBUG_ASSERT(FALSE);
return Gcalc_function::op_any;
}
static int setup_relate_func(Geometry *g1, Geometry *g2,
Gcalc_operation_transporter *trn, Gcalc_function *func,
const char *mask)
{
int do_store_shapes=1;
uint UNINIT_VAR(shape_a), UNINIT_VAR(shape_b);
uint n_operands= 0;
int last_shape_pos;
last_shape_pos= func->get_next_expression_pos();
if (func->reserve_op_buffer(1))
return 1;
func->add_operation(Gcalc_function::op_intersection, 0);
for (int nc=0; nc<9; nc++)
{
uint cur_op;
cur_op= Gcalc_function::op_intersection;
switch (mask[nc])
{
case '*':
continue;
case 'T':
case '0':
case '1':
case '2':
cur_op|= Gcalc_function::v_find_t;
break;
case 'F':
cur_op|= (Gcalc_function::op_not | Gcalc_function::v_find_f);
break;
default:
return 1;
};
++n_operands;
if (func->reserve_op_buffer(3))
return 1;
func->add_operation(cur_op, 2);
func->add_operation(op_matrix(nc/3), 1);
if (do_store_shapes)
{
shape_a= func->get_next_expression_pos();
if (g1->store_shapes(trn))
return 1;
}
else
func->repeat_expression(shape_a);
if (func->reserve_op_buffer(1))
return 1;
func->add_operation(op_matrix(nc%3), 1);
if (do_store_shapes)
{
shape_b= func->get_next_expression_pos();
if (g2->store_shapes(trn))
return 1;
do_store_shapes= 0;
}
else
func->repeat_expression(shape_b);
}
func->add_operands_to_op(last_shape_pos, n_operands);
return 0;
}
2011-05-04 20:20:17 +02:00
#define GIS_ZERO 0.00000000001
class Geometry_ptr_with_buffer_and_mbr
{
public:
Geometry *geom;
Geometry_buffer buffer;
MBR mbr;
bool construct(Item *item, String *tmp_value)
{
const char *c_end;
String *res= item->val_str(tmp_value);
return
item->null_value ||
!(geom= Geometry::construct(&buffer, res->ptr(), res->length())) ||
geom->get_mbr(&mbr, &c_end) || !mbr.valid();
}
int store_shapes(Gcalc_shape_transporter *trn) const
{ return geom->store_shapes(trn); }
};
longlong Item_func_spatial_relate::val_int()
{
DBUG_ENTER("Item_func_spatial_relate::val_int");
DBUG_ASSERT(fixed == 1);
Geometry_ptr_with_buffer_and_mbr g1, g2;
int result= 0;
if ((null_value= (g1.construct(args[0], &tmp_value1) ||
g2.construct(args[1], &tmp_value2) ||
func.reserve_op_buffer(1))))
DBUG_RETURN(0);
MBR umbr(g1.mbr, g2.mbr);
collector.set_extent(umbr.xmin, umbr.xmax, umbr.ymin, umbr.ymax);
g1.mbr.buffer(1e-5);
Gcalc_operation_transporter trn(&func, &collector);
String *matrix= args[2]->val_str(&tmp_matrix);
if ((null_value= args[2]->null_value || matrix->length() != 9 ||
setup_relate_func(g1.geom, g2.geom,
&trn, &func, matrix->ptr())))
goto exit;
collector.prepare_operation();
scan_it.init(&collector);
scan_it.killed= (int *) &(current_thd->killed);
if (!func.alloc_states())
result= func.check_function(scan_it);
exit:
collector.reset();
func.reset();
scan_it.reset();
DBUG_RETURN(result);
}
longlong Item_func_spatial_precise_rel::val_int()
2011-05-04 20:20:17 +02:00
{
DBUG_ENTER("Item_func_spatial_precise_rel::val_int");
2011-05-04 20:20:17 +02:00
DBUG_ASSERT(fixed == 1);
Geometry_ptr_with_buffer_and_mbr g1, g2;
2011-05-04 20:20:17 +02:00
int result= 0;
uint shape_a, shape_b;
2011-05-04 20:20:17 +02:00
if ((null_value= (g1.construct(args[0], &tmp_value1) ||
g2.construct(args[1], &tmp_value2) ||
func.reserve_op_buffer(1))))
2011-05-04 20:20:17 +02:00
DBUG_RETURN(0);
Gcalc_operation_transporter trn(&func, &collector);
MBR umbr(g1.mbr, g2.mbr);
collector.set_extent(umbr.xmin, umbr.xmax, umbr.ymin, umbr.ymax);
g1.mbr.buffer(1e-5);
2011-05-04 20:20:17 +02:00
switch (spatial_rel) {
case SP_CONTAINS_FUNC:
if (!g1.mbr.contains(&g2.mbr))
goto exit;
func.add_operation(Gcalc_function::v_find_f |
Gcalc_function::op_not |
Gcalc_function::op_difference, 2);
/* Mind the g2 goes first. */
null_value= g2.store_shapes(&trn) || g1.store_shapes(&trn);
2011-05-04 20:20:17 +02:00
break;
case SP_WITHIN_FUNC:
g2.mbr.buffer(2e-5);
if (!g1.mbr.within(&g2.mbr))
goto exit;
func.add_operation(Gcalc_function::v_find_f |
Gcalc_function::op_not |
Gcalc_function::op_difference, 2);
null_value= g1.store_shapes(&trn) || g2.store_shapes(&trn);
2011-05-04 20:20:17 +02:00
break;
case SP_EQUALS_FUNC:
if (!g1.mbr.contains(&g2.mbr))
goto exit;
func.add_operation(Gcalc_function::v_find_f |
Gcalc_function::op_not |
Gcalc_function::op_symdifference, 2);
null_value= g1.store_shapes(&trn) || g2.store_shapes(&trn);
2011-05-04 20:20:17 +02:00
break;
case SP_DISJOINT_FUNC:
func.add_operation(Gcalc_function::v_find_f |
Gcalc_function::op_not |
Gcalc_function::op_intersection, 2);
null_value= g1.store_shapes(&trn) || g2.store_shapes(&trn);
2011-05-04 20:20:17 +02:00
break;
case SP_INTERSECTS_FUNC:
if (!g1.mbr.intersects(&g2.mbr))
goto exit;
func.add_operation(Gcalc_function::v_find_t |
Gcalc_function::op_intersection, 2);
null_value= g1.store_shapes(&trn) || g2.store_shapes(&trn);
2011-05-04 20:20:17 +02:00
break;
case SP_OVERLAPS_FUNC:
case SP_CROSSES_FUNC:
func.add_operation(Gcalc_function::op_intersection, 2);
if (func.reserve_op_buffer(3))
break;
func.add_operation(Gcalc_function::v_find_t |
Gcalc_function::op_intersection, 2);
shape_a= func.get_next_expression_pos();
if ((null_value= g1.store_shapes(&trn)))
break;
shape_b= func.get_next_expression_pos();
if ((null_value= g2.store_shapes(&trn)))
break;
if (func.reserve_op_buffer(7))
break;
func.add_operation(Gcalc_function::op_intersection, 2);
func.add_operation(Gcalc_function::v_find_t |
Gcalc_function::op_difference, 2);
func.repeat_expression(shape_a);
func.repeat_expression(shape_b);
func.add_operation(Gcalc_function::v_find_t |
Gcalc_function::op_difference, 2);
func.repeat_expression(shape_b);
func.repeat_expression(shape_a);
break;
case SP_TOUCHES_FUNC:
if (func.reserve_op_buffer(5))
break;
func.add_operation(Gcalc_function::op_intersection, 2);
func.add_operation(Gcalc_function::v_find_f |
Gcalc_function::op_not |
Gcalc_function::op_intersection, 2);
func.add_operation(Gcalc_function::op_internals, 1);
shape_a= func.get_next_expression_pos();
if ((null_value= g1.store_shapes(&trn)) ||
func.reserve_op_buffer(1))
break;
func.add_operation(Gcalc_function::op_internals, 1);
shape_b= func.get_next_expression_pos();
if ((null_value= g2.store_shapes(&trn)) ||
func.reserve_op_buffer(1))
break;
func.add_operation(Gcalc_function::v_find_t |
Gcalc_function::op_intersection, 2);
func.repeat_expression(shape_a);
func.repeat_expression(shape_b);
2011-05-04 20:20:17 +02:00
break;
default:
DBUG_ASSERT(FALSE);
break;
}
if (null_value)
2011-05-04 20:20:17 +02:00
goto exit;
collector.prepare_operation();
scan_it.init(&collector);
scan_it.killed= (int *) &(current_thd->killed);
2011-05-04 20:20:17 +02:00
if (func.alloc_states())
goto exit;
result= func.check_function(scan_it);
2011-05-04 20:20:17 +02:00
exit:
collector.reset();
func.reset();
scan_it.reset();
DBUG_RETURN(result);
}
Item_func_spatial_operation::~Item_func_spatial_operation()
{
}
String *Item_func_spatial_operation::val_str(String *str_value)
{
DBUG_ENTER("Item_func_spatial_operation::val_str");
DBUG_ASSERT(fixed == 1);
Geometry_ptr_with_buffer_and_mbr g1, g2;
2011-05-04 20:20:17 +02:00
uint32 srid= 0;
Gcalc_operation_transporter trn(&func, &collector);
if (func.reserve_op_buffer(1))
DBUG_RETURN(0);
func.add_operation(spatial_op, 2);
if ((null_value= (g1.construct(args[0], &tmp_value1) ||
g2.construct(args[1], &tmp_value2))))
{
str_value= 0;
2011-05-04 20:20:17 +02:00
goto exit;
}
2011-05-04 20:20:17 +02:00
g1.mbr.add_mbr(&g2.mbr);
collector.set_extent(g1.mbr.xmin, g1.mbr.xmax, g1.mbr.ymin, g1.mbr.ymax);
2011-05-04 20:20:17 +02:00
if ((null_value= g1.store_shapes(&trn) || g2.store_shapes(&trn)))
{
str_value= 0;
goto exit;
}
2011-05-04 20:20:17 +02:00
collector.prepare_operation();
if (func.alloc_states())
goto exit;
operation.init(&func);
if (operation.count_all(&collector) ||
operation.get_result(&res_receiver))
goto exit;
str_value->set_charset(&my_charset_bin);
if (str_value->reserve(SRID_SIZE, 512))
goto exit;
str_value->length(0);
str_value->q_append(srid);
if (!Geometry::create_from_opresult(&g1.buffer, str_value, res_receiver))
2011-05-04 20:20:17 +02:00
goto exit;
exit:
collector.reset();
func.reset();
res_receiver.reset();
DBUG_RETURN(str_value);
}
const char *Item_func_spatial_operation::func_name() const
{
switch (spatial_op) {
case Gcalc_function::op_intersection:
return "st_intersection";
case Gcalc_function::op_difference:
return "st_difference";
case Gcalc_function::op_union:
return "st_union";
case Gcalc_function::op_symdifference:
return "st_symdifference";
default:
DBUG_ASSERT(0); // Should never happen
return "sp_unknown";
}
}
static const int SINUSES_CALCULATED= 32;
static double n_sinus[SINUSES_CALCULATED+1]=
{
0,
0.04906767432741802,
0.0980171403295606,
0.1467304744553618,
0.1950903220161283,
0.2429801799032639,
0.2902846772544623,
0.3368898533922201,
0.3826834323650898,
0.4275550934302821,
0.4713967368259976,
0.5141027441932217,
0.5555702330196022,
0.5956993044924334,
0.6343932841636455,
0.6715589548470183,
0.7071067811865475,
0.7409511253549591,
0.773010453362737,
0.8032075314806448,
0.8314696123025452,
0.8577286100002721,
0.8819212643483549,
0.9039892931234433,
0.9238795325112867,
0.9415440651830208,
0.9569403357322089,
0.970031253194544,
0.9807852804032304,
0.989176509964781,
0.9951847266721968,
0.9987954562051724,
1
};
static void get_n_sincos(int n, double *sinus, double *cosinus)
{
DBUG_ASSERT(n > 0 && n < SINUSES_CALCULATED*2+1);
if (n < (SINUSES_CALCULATED + 1))
{
*sinus= n_sinus[n];
*cosinus= n_sinus[SINUSES_CALCULATED - n];
}
else
{
n-= SINUSES_CALCULATED;
*sinus= n_sinus[SINUSES_CALCULATED - n];
*cosinus= -n_sinus[n];
}
}
static int fill_half_circle(Gcalc_shape_transporter *trn, double x, double y,
double ax, double ay)
{
double n_sin, n_cos;
double x_n, y_n;
for (int n = 1; n < (SINUSES_CALCULATED * 2 - 1); n++)
{
get_n_sincos(n, &n_sin, &n_cos);
x_n= ax * n_cos - ay * n_sin;
y_n= ax * n_sin + ay * n_cos;
if (trn->add_point(x_n + x, y_n + y))
return 1;
}
return 0;
}
static int fill_gap(Gcalc_shape_transporter *trn,
double x, double y,
double ax, double ay, double bx, double by, double d,
bool *empty_gap)
{
double ab= ax * bx + ay * by;
double cosab= ab / (d * d) + GIS_ZERO;
double n_sin, n_cos;
double x_n, y_n;
int n=1;
*empty_gap= true;
for (;;)
{
get_n_sincos(n++, &n_sin, &n_cos);
if (n_cos <= cosab)
break;
*empty_gap= false;
x_n= ax * n_cos - ay * n_sin;
y_n= ax * n_sin + ay * n_cos;
if (trn->add_point(x_n + x, y_n + y))
return 1;
}
return 0;
}
/*
Calculates the vector (p2,p1) and
negatively orthogonal to it with the length of d.
The result is (ex,ey) - the vector, (px,py) - the orthogonal.
*/
static void calculate_perpendicular(
double x1, double y1, double x2, double y2, double d,
double *ex, double *ey,
double *px, double *py)
{
double q;
*ex= x1 - x2;
*ey= y1 - y2;
q= d / sqrt((*ex) * (*ex) + (*ey) * (*ey));
*px= (*ey) * q;
*py= -(*ex) * q;
}
int Item_func_buffer::Transporter::single_point(double x, double y)
{
if (buffer_op == Gcalc_function::op_difference)
{
if (m_fn->reserve_op_buffer(1))
return 1;
m_fn->add_operation(Gcalc_function::op_false, 0);
return 0;
}
m_nshapes= 0;
2011-05-04 20:20:17 +02:00
return add_point_buffer(x, y);
}
int Item_func_buffer::Transporter::add_edge_buffer(
double x3, double y3, bool round_p1, bool round_p2)
{
Gcalc_operation_transporter trn(m_fn, m_heap);
double e1_x, e1_y, e2_x, e2_y, p1_x, p1_y, p2_x, p2_y;
double e1e2;
double sin1, cos1;
double x_n, y_n;
bool empty_gap1, empty_gap2;
++m_nshapes;
if (trn.start_simple_poly())
return 1;
calculate_perpendicular(x1, y1, x2, y2, m_d, &e1_x, &e1_y, &p1_x, &p1_y);
calculate_perpendicular(x3, y3, x2, y2, m_d, &e2_x, &e2_y, &p2_x, &p2_y);
e1e2= e1_x * e2_y - e2_x * e1_y;
sin1= n_sinus[1];
cos1= n_sinus[31];
if (e1e2 < 0)
{
empty_gap2= false;
x_n= x2 + p2_x * cos1 - p2_y * sin1;
y_n= y2 + p2_y * cos1 + p2_x * sin1;
if (fill_gap(&trn, x2, y2, -p1_x,-p1_y, p2_x,p2_y, m_d, &empty_gap1) ||
trn.add_point(x2 + p2_x, y2 + p2_y) ||
trn.add_point(x_n, y_n))
return 1;
}
else
{
x_n= x2 - p2_x * cos1 - p2_y * sin1;
y_n= y2 - p2_y * cos1 + p2_x * sin1;
if (trn.add_point(x_n, y_n) ||
trn.add_point(x2 - p2_x, y2 - p2_y) ||
fill_gap(&trn, x2, y2, -p2_x, -p2_y, p1_x, p1_y, m_d, &empty_gap2))
return 1;
empty_gap1= false;
}
if ((!empty_gap2 && trn.add_point(x2 + p1_x, y2 + p1_y)) ||
trn.add_point(x1 + p1_x, y1 + p1_y))
return 1;
if (round_p1 && fill_half_circle(&trn, x1, y1, p1_x, p1_y))
return 1;
if (trn.add_point(x1 - p1_x, y1 - p1_y) ||
(!empty_gap1 && trn.add_point(x2 - p1_x, y2 - p1_y)))
return 1;
return trn.complete_simple_poly();
}
int Item_func_buffer::Transporter::add_last_edge_buffer()
{
Gcalc_operation_transporter trn(m_fn, m_heap);
double e1_x, e1_y, p1_x, p1_y;
++m_nshapes;
if (trn.start_simple_poly())
return 1;
calculate_perpendicular(x1, y1, x2, y2, m_d, &e1_x, &e1_y, &p1_x, &p1_y);
if (trn.add_point(x1 + p1_x, y1 + p1_y) ||
trn.add_point(x1 - p1_x, y1 - p1_y) ||
trn.add_point(x2 - p1_x, y2 - p1_y) ||
fill_half_circle(&trn, x2, y2, -p1_x, -p1_y) ||
trn.add_point(x2 + p1_x, y2 + p1_y))
return 1;
return trn.complete_simple_poly();
}
int Item_func_buffer::Transporter::add_point_buffer(double x, double y)
{
Gcalc_operation_transporter trn(m_fn, m_heap);
m_nshapes++;
if (trn.start_simple_poly())
return 1;
if (trn.add_point(x - m_d, y) ||
fill_half_circle(&trn, x, y, -m_d, 0.0) ||
trn.add_point(x + m_d, y) ||
fill_half_circle(&trn, x, y, m_d, 0.0))
return 1;
return trn.complete_simple_poly();
}
int Item_func_buffer::Transporter::start_line()
{
if (buffer_op == Gcalc_function::op_difference)
{
if (m_fn->reserve_op_buffer(1))
return 1;
m_fn->add_operation(Gcalc_function::op_false, 0);
skip_line= TRUE;
return 0;
}
m_nshapes= 0;
if (m_fn->reserve_op_buffer(2))
return 1;
last_shape_pos= m_fn->get_next_expression_pos();
m_fn->add_operation(buffer_op, 0);
2011-05-04 20:20:17 +02:00
m_npoints= 0;
int_start_line();
return 0;
}
int Item_func_buffer::Transporter::start_poly()
{
m_nshapes= 1;
if (m_fn->reserve_op_buffer(2))
return 1;
last_shape_pos= m_fn->get_next_expression_pos();
m_fn->add_operation(buffer_op, 0);
2011-05-04 20:20:17 +02:00
return Gcalc_operation_transporter::start_poly();
}
int Item_func_buffer::Transporter::complete_poly()
{
if (Gcalc_operation_transporter::complete_poly())
return 1;
m_fn->add_operands_to_op(last_shape_pos, m_nshapes);
return 0;
}
2011-05-04 20:20:17 +02:00
int Item_func_buffer::Transporter::start_ring()
{
m_npoints= 0;
return Gcalc_operation_transporter::start_ring();
}
int Item_func_buffer::Transporter::start_collection(int n_objects)
{
if (m_fn->reserve_op_buffer(1))
return 1;
m_fn->add_operation(Gcalc_function::op_union, n_objects);
return 0;
}
2011-05-04 20:20:17 +02:00
int Item_func_buffer::Transporter::add_point(double x, double y)
{
if (skip_line)
return 0;
2011-05-04 20:20:17 +02:00
if (m_npoints && x == x2 && y == y2)
return 0;
++m_npoints;
if (m_npoints == 1)
{
x00= x;
y00= y;
}
else if (m_npoints == 2)
{
x01= x;
y01= y;
}
else if (add_edge_buffer(x, y, (m_npoints == 3) && line_started(), false))
return 1;
x1= x2;
y1= y2;
x2= x;
y2= y;
return line_started() ? 0 : Gcalc_operation_transporter::add_point(x, y);
}
int Item_func_buffer::Transporter::complete()
{
if (m_npoints)
{
if (m_npoints == 1)
{
if (add_point_buffer(x2, y2))
return 1;
}
else if (m_npoints == 2)
{
if (add_edge_buffer(x1, y1, true, true))
return 1;
}
else if (line_started())
{
if (add_last_edge_buffer())
return 1;
}
else
{
if (x2 != x00 || y2 != y00)
2011-05-04 20:20:17 +02:00
{
if (add_edge_buffer(x00, y00, false, false))
return 1;
x1= x2;
y1= y2;
x2= x00;
y2= y00;
}
if (add_edge_buffer(x01, y01, false, false))
return 1;
}
}
return 0;
}
int Item_func_buffer::Transporter::complete_line()
{
if (!skip_line)
{
if (complete())
return 1;
int_complete_line();
m_fn->add_operands_to_op(last_shape_pos, m_nshapes);
}
skip_line= FALSE;
2011-05-04 20:20:17 +02:00
return 0;
}
int Item_func_buffer::Transporter::complete_ring()
{
return complete() ||
Gcalc_operation_transporter::complete_ring();
}
String *Item_func_buffer::val_str(String *str_value)
{
DBUG_ENTER("Item_func_buffer::val_str");
DBUG_ASSERT(fixed == 1);
MDEV-10306 Wrong results with combination of CONCAT, SUBSTR and CONVERT in subquery The bug happens because of a combination of unfortunate circumstances: 1. Arguments args[0] and args[2] of Item_func_concat point recursively (through Item_direct_view_ref's) to the same Item_func_conv_charset. Both args[0]->args[0]->ref[0] and args[2]->args[0]->ref[0] refer to this Item_func_conv_charset. 2. When Item_func_concat::args[0]->val_str() is called, Item_func_conv_charset::val_str() writes its result to Item_func_conc_charset::tmp_value. 3. Then, for optimization purposes (to avoid copying), Item_func_substr::val_str() initializes Item_func_substr::tmp_value to point to the buffer fragment owned by Item_func_conv_charset::tmp_value Item_func_substr::tmp_value is returned as a result of Item_func_concat::args[0]->val_str(). 4. Due to optimization to avoid memory reallocs, Item_func_concat::val_str() remembers the result of args[0]->val_str() in "res" and further uses "res" to collect the return value. 5. When Item_func_concat::args[2]->val_str() is called, Item_func_conv_charset::tmp_value gets overwritten (see #1), which effectively overwrites args[0]'s Item_func_substr::tmp_value (see #3), which effectively overwrites "res" (see #4). This patch does the following: a. Changes Item_func_conv_charset::val_str(String *str) to use tmp_value and str the other way around. After this change tmp_value is used to store a temporary result, while str is used to return the value. The fixes the second problem (without SUBSTR): SELECT CONCAT(t2,'-',t2) c2 FROM (SELECT CONVERT(t USING latin1) t2 FROM t1) sub; As Item_func_concat::val_str() supplies two different buffers when calling args[0]->val_str() and args[2]->val_str(), in the new reduction the result created during args[0]->val_str() does not get overwritten by args[2]->val_str(). b. Fixing the same problem in val_str() for similar classes Item_func_to_base64 Item_func_from_base64 Item_func_weight_string Item_func_hex Item_func_unhex Item_func_quote Item_func_compress Item_func_uncompress Item_func_des_encrypt Item_func_des_decrypt Item_func_conv_charset Item_func_reverse Item_func_soundex Item_func_aes_encrypt Item_func_aes_decrypt Item_func_buffer c. Fixing Item_func::val_str_from_val_str_ascii() the same way. Now Item_str_ascii_func::ascii_buff is used for temporary value, while the parameter passed to val_str() is used to return the result. This fixes the same problem when conversion (from ASCII to e.g. UCS2) takes place. See the ctype_ucs.test for example queries that returned wrong results before the fix. d. Some Item_func descendand classes had temporary String buffers (tmp_value and tmp_str), but did not really use them. Removing these temporary buffers from: Item_func_decode_histogram Item_func_format Item_func_binlog_gtid_pos Item_func_spatial_collection: e. Removing Item_func_buffer::tmp_value, because it's not used any more. f. Renaming Item_func_[un]compress::buffer to "tmp_value", for consistency with other classes. Note, this patch does not fix the following classes (although they have a similar problem): Item_str_conv Item_func_make_set Item_char_typecast They have a complex implementations and simple swapping between "tmp_value" and "str" won't work. These classes will be fixed separately.
2017-06-19 10:45:32 +02:00
String *obj= args[0]->val_str(str_value);
2011-05-04 20:20:17 +02:00
double dist= args[1]->val_real();
Geometry_buffer buffer;
Geometry *g;
uint32 srid= 0;
String *str_result= NULL;
Transporter trn(&func, &collector, dist);
MBR mbr;
const char *c_end;
2011-05-04 20:20:17 +02:00
null_value= 1;
if (args[0]->null_value || args[1]->null_value ||
!(g= Geometry::construct(&buffer, obj->ptr(), obj->length())) ||
g->get_mbr(&mbr, &c_end))
2011-05-04 20:20:17 +02:00
goto mem_error;
if (dist > 0.0)
mbr.buffer(dist);
else
{
/* This happens when dist is too far negative. */
if (mbr.xmax + dist < mbr.xmin || mbr.ymax + dist < mbr.ymin)
goto return_empty_result;
}
collector.set_extent(mbr.xmin, mbr.xmax, mbr.ymin, mbr.ymax);
/*
If the distance given is 0, the Buffer function is in fact NOOP,
so it's natural just to return the argument1.
Besides, internal calculations here can't handle zero distance anyway.
*/
if (fabs(dist) < GIS_ZERO)
{
null_value= 0;
str_result= obj;
goto mem_error;
}
2011-05-04 20:20:17 +02:00
if (g->store_shapes(&trn))
goto mem_error;
collector.prepare_operation();
if (func.alloc_states())
goto mem_error;
operation.init(&func);
operation.killed= (int *) &(current_thd->killed);
2011-05-04 20:20:17 +02:00
if (operation.count_all(&collector) ||
operation.get_result(&res_receiver))
goto mem_error;
return_empty_result:
2011-05-04 20:20:17 +02:00
str_value->set_charset(&my_charset_bin);
if (str_value->reserve(SRID_SIZE, 512))
goto mem_error;
str_value->length(0);
str_value->q_append(srid);
if (!Geometry::create_from_opresult(&buffer, str_value, res_receiver))
2011-05-04 20:20:17 +02:00
goto mem_error;
null_value= 0;
str_result= str_value;
mem_error:
collector.reset();
func.reset();
res_receiver.reset();
DBUG_RETURN(str_result);
}
longlong Item_func_isempty::val_int()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
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
String tmp;
String *swkb= args[0]->val_str(&tmp);
Geometry_buffer buffer;
null_value= args[0]->null_value ||
!(Geometry::construct(&buffer, swkb->ptr(), swkb->length()));
return null_value ? 1 : 0;
}
longlong Item_func_issimple::val_int()
{
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
String *swkb= args[0]->val_str(&tmp);
Geometry_buffer buffer;
2011-05-04 20:20:17 +02:00
Gcalc_operation_transporter trn(&func, &collector);
Geometry *g;
int result= 1;
MBR mbr;
const char *c_end;
2011-05-04 20:20:17 +02:00
DBUG_ENTER("Item_func_issimple::val_int");
DBUG_ASSERT(fixed == 1);
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
null_value= 0;
if ((args[0]->null_value ||
!(g= Geometry::construct(&buffer, swkb->ptr(), swkb->length())) ||
g->get_mbr(&mbr, &c_end)))
{
/* We got NULL as an argument. Have to return -1 */
DBUG_RETURN(-1);
}
2011-05-04 20:20:17 +02:00
collector.set_extent(mbr.xmin, mbr.xmax, mbr.ymin, mbr.ymax);
2011-05-04 20:20:17 +02:00
if (g->get_class_info()->m_type_id == Geometry::wkb_point)
DBUG_RETURN(1);
if (g->store_shapes(&trn))
goto mem_error;
collector.prepare_operation();
scan_it.init(&collector);
while (scan_it.more_points())
{
const Gcalc_scan_iterator::event_point *ev, *next_ev;
2011-05-04 20:20:17 +02:00
if (scan_it.step())
goto mem_error;
2011-09-01 08:44:56 +02:00
ev= scan_it.get_events();
if (ev->simple_event())
continue;
next_ev= ev->get_next();
if ((ev->event & (scev_thread | scev_single_point)) && !next_ev)
continue;
if ((ev->event == scev_two_threads) && !next_ev->get_next())
2011-09-01 08:44:56 +02:00
continue;
/* If the first and last points of a curve coincide - that is */
/* an exception to the rule and the line is considered as simple. */
if ((next_ev && !next_ev->get_next()) &&
(ev->event & (scev_thread | scev_end)) &&
(next_ev->event & (scev_thread | scev_end)))
2011-09-01 08:44:56 +02:00
continue;
result= 0;
break;
2011-05-04 20:20:17 +02:00
}
collector.reset();
func.reset();
scan_it.reset();
DBUG_RETURN(result);
mem_error:
null_value= 1;
DBUG_RETURN(0);
}
longlong Item_func_isclosed::val_int()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String tmp;
String *swkb= args[0]->val_str(&tmp);
Geometry_buffer buffer;
Geometry *geom;
int isclosed= 0; // In case of error
null_value= 0;
if (!swkb ||
args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())) ||
geom->is_closed(&isclosed))
{
/* IsClosed(NULL) should return -1 */
return -1;
}
return (longlong) isclosed;
}
longlong Item_func_isring::val_int()
{
/* It's actually a combination of two functions - IsClosed and IsSimple */
DBUG_ASSERT(fixed == 1);
String tmp;
String *swkb= args[0]->val_str(&tmp);
Geometry_buffer buffer;
Geometry *geom;
int isclosed= 0; // In case of error
null_value= 0;
if (!swkb ||
args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())) ||
geom->is_closed(&isclosed))
{
/* IsRing(NULL) should return -1 */
return -1;
}
if (!isclosed)
return 0;
return Item_func_issimple::val_int();
}
/*
Numerical functions
*/
longlong Item_func_dimension::val_int()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
uint32 dim= 0; // In case of error
String *swkb= args[0]->val_str(&value);
Geometry_buffer buffer;
Geometry *geom;
const char *dummy;
null_value= (!swkb ||
args[0]->null_value ||
!(geom= Geometry::construct(&buffer, swkb->ptr(), swkb->length())) ||
geom->dimension(&dim, &dummy));
return (longlong) dim;
}
longlong Item_func_numinteriorring::val_int()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
uint32 num= 0; // In case of error
String *swkb= args[0]->val_str(&value);
Geometry_buffer buffer;
Geometry *geom;
null_value= (!swkb ||
!(geom= Geometry::construct(&buffer,
swkb->ptr(), swkb->length())) ||
geom->num_interior_ring(&num));
return (longlong) num;
}
longlong Item_func_numgeometries::val_int()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
uint32 num= 0; // In case of errors
String *swkb= args[0]->val_str(&value);
Geometry_buffer buffer;
Geometry *geom;
null_value= (!swkb ||
!(geom= Geometry::construct(&buffer,
swkb->ptr(), swkb->length())) ||
geom->num_geometries(&num));
return (longlong) num;
}
longlong Item_func_numpoints::val_int()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
uint32 num= 0; // In case of errors
String *swkb= args[0]->val_str(&value);
Geometry_buffer buffer;
Geometry *geom;
null_value= (!swkb ||
args[0]->null_value ||
!(geom= Geometry::construct(&buffer,
swkb->ptr(), swkb->length())) ||
geom->num_points(&num));
return (longlong) num;
}
double Item_func_x::val_real()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
double res= 0.0; // In case of errors
String *swkb= args[0]->val_str(&value);
Geometry_buffer buffer;
Geometry *geom;
null_value= (!swkb ||
!(geom= Geometry::construct(&buffer,
swkb->ptr(), swkb->length())) ||
geom->get_x(&res));
return res;
}
double Item_func_y::val_real()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
double res= 0; // In case of errors
String *swkb= args[0]->val_str(&value);
Geometry_buffer buffer;
Geometry *geom;
null_value= (!swkb ||
!(geom= Geometry::construct(&buffer,
swkb->ptr(), swkb->length())) ||
geom->get_y(&res));
return res;
}
double Item_func_area::val_real()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
double res= 0; // In case of errors
String *swkb= args[0]->val_str(&value);
Geometry_buffer buffer;
Geometry *geom;
const char *dummy;
null_value= (!swkb ||
!(geom= Geometry::construct(&buffer,
swkb->ptr(), swkb->length())) ||
geom->area(&res, &dummy));
return res;
}
double Item_func_glength::val_real()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
double res= 0; // In case of errors
String *swkb= args[0]->val_str(&value);
Geometry_buffer buffer;
Geometry *geom;
const char *end;
null_value= (!swkb ||
!(geom= Geometry::construct(&buffer,
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
swkb->ptr(),
swkb->length())) ||
geom->geom_length(&res, &end));
return res;
}
longlong Item_func_srid::val_int()
{
DBUG_ASSERT(fixed == 1); added to val* small optimisation in signed_literal sql/field.cc: layout fixed sql/item.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed fixed= 1; added where it was forgoten in fix_fields Item_string can be used without fix_fields sql/item.h: DBUG_ASSERT(fixed == 1); added to val* Item_string can be used without fix_fields sql/item_cmpfunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_cmpfunc.h: fixed layout and getting Item statistic sql/item_func.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_func.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_geofunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_strfunc.cc: DBUG_ASSERT(fixed == 1); added to val* layout fixed sql/item_strfunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_subselect.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_sum.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.cc: DBUG_ASSERT(fixed == 1); added to val* sql/item_timefunc.h: DBUG_ASSERT(fixed == 1); added to val* sql/item_uniq.h: DBUG_ASSERT(fixed == 1); added to val* sql/sql_base.cc: Item creation revised sql/sql_help.cc: Item creation revised sql/sql_load.cc: Item creation revised sql/sql_parse.cc: fix_field call added sql/sql_select.cc: Item creation revised sql/sql_show.cc: Item creation revised sql/sql_union.cc: Item creation revised sql/sql_update.cc: Item creation revised sql/sql_yacc.yy: Item creation revised small optimisation in signed_literal
2004-03-18 14:14:36 +01:00
DBUG_ASSERT(fixed == 1);
String *swkb= args[0]->val_str(&value);
Geometry_buffer buffer;
Fixed many compiler warnings Fixed bugs in group_concat with ORDER BY and DISTINCT (Bugs #2695, #3381 and #3319) Fixed crash when doing rollback in slave and the io thread catched up with the sql thread Set locked_in_memory properly include/mysql_com.h: Fixed compiler warning libmysqld/emb_qcache.cc: Removed not used variable libmysqld/lib_sql.cc: Removed not used variable myisam/mi_locking.c: Added comment myisam/mi_rnext.c: Fixed bug in concurrent insert myisam/mi_rprev.c: Simple optimization mysql-test/r/func_gconcat.result: New tests mysql-test/t/func_gconcat.test: New tests mysql-test/t/func_group.test: Cleanup sql-common/client.c: Removed compiler warning sql/derror.cc: Better comments sql/field.cc: Removed not used function/variable sql/field.h: Removed not needed variable sql/ha_innodb.cc: Removed not used function sql/item.cc: Fixed compiler warning sql/item_cmpfunc.cc: Fixed compiler warning sql/item_func.cc: Fixed compiler warning sql/item_geofunc.cc: Fixed compiler warning sql/item_sum.cc: Fixed bugs in group_concat and added more comments (Bugs #2695, #3381 and #3319) - field->abs_offset was not needed - Wrong assumption of field order in temporary table - Some not used variables removed - Added ORDER BY fields after argument fields so that code in sql_select.cc can move all fields to point to temporary tables, if needed. - Optimized loops sql/item_sum.h: Bug fixing and cleanup of group_concat() sql/log.cc: Removed wrong comment sql/log_event.cc: Removed compiler warning sql/mysqld.cc: Set locked_in_memory properly sql/protocol.cc: Removed compiler warning sql/set_var.cc: Code cleanup sql/slave.cc: Fixed crash when doing rollback in slave and the io thread catched up with the sql thread sql/sql_cache.cc: Removed compiler warnings sql/sql_derived.cc: Removed not used variable sql/sql_insert.cc: Removed compiler warnings sql/sql_lex.cc: Removed not used lable sql/sql_lex.h: Removed compiler warnings sql/sql_parse.cc: Removed compiler warnings sql/sql_prepare.cc: Removed compiler warnings sql/sql_select.cc: Removed not used variables Added function comments sql/sql_show.cc: Removed compiler warnings sql/sql_yacc.yy: Fix for ORDER BY handling in GROUP_CONCAT()
2004-04-05 12:56:05 +02:00
null_value= (!swkb ||
!Geometry::construct(&buffer,
swkb->ptr(), swkb->length()));
if (null_value)
return 0;
return (longlong) (uint4korr(swkb->ptr()));
}
2011-05-04 20:20:17 +02:00
double Item_func_distance::val_real()
{
2011-11-18 15:15:06 +01:00
bool cur_point_edge;
2011-05-04 20:20:17 +02:00
const Gcalc_scan_iterator::point *evpos;
const Gcalc_heap::Info *cur_point, *dist_point;
const Gcalc_scan_iterator::event_point *ev;
2011-05-04 20:20:17 +02:00
double t, distance, cur_distance;
double x1, x2, y1, y2;
double ex, ey, vx, vy, e_sqrlen;
uint obj2_si;
Gcalc_operation_transporter trn(&func, &collector);
DBUG_ENTER("Item_func_distance::val_real");
DBUG_ASSERT(fixed == 1);
String *res1= args[0]->val_str(&tmp_value1);
String *res2= args[1]->val_str(&tmp_value2);
Geometry_buffer buffer1, buffer2;
Geometry *g1, *g2;
MBR mbr1, mbr2;
const char *c_end;
2011-05-04 20:20:17 +02:00
if ((null_value= (args[0]->null_value || args[1]->null_value ||
!(g1= Geometry::construct(&buffer1, res1->ptr(), res1->length())) ||
!(g2= Geometry::construct(&buffer2, res2->ptr(), res2->length())) ||
g1->get_mbr(&mbr1, &c_end) ||
g2->get_mbr(&mbr2, &c_end))))
2011-05-04 20:20:17 +02:00
goto mem_error;
mbr1.add_mbr(&mbr2);
collector.set_extent(mbr1.xmin, mbr1.xmax, mbr1.ymin, mbr1.ymax);
2011-05-04 20:20:17 +02:00
if ((g1->get_class_info()->m_type_id == Geometry::wkb_point) &&
(g2->get_class_info()->m_type_id == Geometry::wkb_point))
{
if (((Gis_point *) g1)->get_xy(&x1, &y1) ||
((Gis_point *) g2)->get_xy(&x2, &y2))
goto mem_error;
ex= x2 - x1;
ey= y2 - y1;
DBUG_RETURN(sqrt(ex * ex + ey * ey));
}
if (func.reserve_op_buffer(1))
goto mem_error;
func.add_operation(Gcalc_function::op_intersection, 2);
if (g1->store_shapes(&trn))
goto mem_error;
obj2_si= func.get_nshapes();
if (g2->store_shapes(&trn) || func.alloc_states())
goto mem_error;
if (obj2_si == 0 || func.get_nshapes() == obj2_si)
{
distance= 0.0;
null_value= 1;
goto exit;
}
2011-05-04 20:20:17 +02:00
collector.prepare_operation();
scan_it.init(&collector);
distance= DBL_MAX;
while (scan_it.more_points())
{
if (scan_it.step())
goto mem_error;
evpos= scan_it.get_event_position();
2011-09-01 08:44:56 +02:00
ev= scan_it.get_events();
2011-05-04 20:20:17 +02:00
2011-09-01 08:44:56 +02:00
if (ev->simple_event())
2011-05-04 20:20:17 +02:00
{
2011-09-01 08:44:56 +02:00
cur_point= ev->pi;
goto count_distance;
2011-05-04 20:20:17 +02:00
}
/*
2011-09-01 08:44:56 +02:00
handling intersection we only need to check if it's the intersecion
of objects 1 and 2. In this case distance is 0
2011-05-04 20:20:17 +02:00
*/
2011-09-01 08:44:56 +02:00
cur_point= NULL;
2011-05-04 20:20:17 +02:00
/*
having these events we need to check for possible intersection
of objects
scev_thread | scev_two_threads | scev_single_point
*/
func.clear_i_states();
2011-05-04 20:20:17 +02:00
for (Gcalc_point_iterator pit(&scan_it); pit.point() != evpos; ++pit)
{
gcalc_shape_info si= pit.point()->get_shape();
if ((func.get_shape_kind(si) == Gcalc_function::shape_polygon))
func.invert_i_state(si);
2011-05-04 20:20:17 +02:00
}
2011-09-01 08:44:56 +02:00
func.clear_b_states();
2011-09-01 08:44:56 +02:00
for (; ev; ev= ev->get_next())
2011-05-04 20:20:17 +02:00
{
2011-09-01 08:44:56 +02:00
if (ev->event != scev_intersection)
cur_point= ev->pi;
func.set_b_state(ev->get_shape());
2011-09-01 08:44:56 +02:00
if (func.count())
{
/* Point of one object is inside the other - intersection found */
distance= 0;
goto exit;
}
2011-05-04 20:20:17 +02:00
}
2011-09-01 08:44:56 +02:00
if (!cur_point)
continue;
2011-05-04 20:20:17 +02:00
count_distance:
if (cur_point->node.shape.shape >= obj2_si)
2011-05-04 20:20:17 +02:00
continue;
cur_point_edge= !cur_point->is_bottom();
for (dist_point= collector.get_first(); dist_point; dist_point= dist_point->get_next())
{
/* We only check vertices of object 2 */
if (dist_point->type != Gcalc_heap::nt_shape_node ||
dist_point->node.shape.shape < obj2_si)
2011-05-04 20:20:17 +02:00
continue;
/* if we have an edge to check */
if (dist_point->node.shape.left)
2011-05-04 20:20:17 +02:00
{
t= count_edge_t(dist_point, dist_point->node.shape.left, cur_point,
2011-05-04 20:20:17 +02:00
ex, ey, vx, vy, e_sqrlen);
if ((t>0.0) && (t<1.0))
{
cur_distance= distance_to_line(ex, ey, vx, vy, e_sqrlen);
if (distance > cur_distance)
distance= cur_distance;
}
}
if (cur_point_edge)
{
t= count_edge_t(cur_point, cur_point->node.shape.left, dist_point,
2011-05-04 20:20:17 +02:00
ex, ey, vx, vy, e_sqrlen);
if ((t>0.0) && (t<1.0))
{
cur_distance= distance_to_line(ex, ey, vx, vy, e_sqrlen);
if (distance > cur_distance)
distance= cur_distance;
}
}
cur_distance= distance_points(cur_point, dist_point);
if (distance > cur_distance)
distance= cur_distance;
}
}
exit:
collector.reset();
func.reset();
scan_it.reset();
DBUG_RETURN(distance);
mem_error:
null_value= 1;
DBUG_RETURN(0);
}
String *Item_func_pointonsurface::val_str(String *str)
{
Gcalc_operation_transporter trn(&func, &collector);
DBUG_ENTER("Item_func_pointonsurface::val_real");
DBUG_ASSERT(fixed == 1);
String *res= args[0]->val_str(&tmp_value);
Geometry_buffer buffer;
Geometry *g;
MBR mbr;
const char *c_end;
double UNINIT_VAR(px), UNINIT_VAR(py), x0, y0;
String *result= 0;
const Gcalc_scan_iterator::point *pprev= NULL;
uint32 srid;
null_value= 1;
if ((args[0]->null_value ||
!(g= Geometry::construct(&buffer, res->ptr(), res->length())) ||
g->get_mbr(&mbr, &c_end)))
goto mem_error;
collector.set_extent(mbr.xmin, mbr.xmax, mbr.ymin, mbr.ymax);
if (g->store_shapes(&trn))
goto mem_error;
collector.prepare_operation();
scan_it.init(&collector);
while (scan_it.more_points())
{
if (scan_it.step())
goto mem_error;
if (scan_it.get_h() > GIS_ZERO)
{
y0= scan_it.get_y();
break;
}
}
if (!scan_it.more_points())
{
goto exit;
}
if (scan_it.step())
goto mem_error;
for (Gcalc_point_iterator pit(&scan_it); pit.point(); ++pit)
{
if (pprev == NULL)
{
pprev= pit.point();
continue;
}
x0= scan_it.get_sp_x(pprev);
px= scan_it.get_sp_x(pit.point());
if (px - x0 > GIS_ZERO)
{
if (scan_it.get_h() > GIS_ZERO)
{
px= (px + x0) / 2.0;
py= scan_it.get_y();
}
else
{
px= (px + x0) / 2.0;
py= (y0 + scan_it.get_y()) / 2.0;
}
null_value= 0;
break;
}
pprev= NULL;
}
if (null_value)
goto exit;
str->set_charset(&my_charset_bin);
if (str->reserve(SRID_SIZE, 512))
goto mem_error;
str->length(0);
srid= uint4korr(res->ptr());
str->q_append(srid);
if (Geometry::create_point(str, px, py))
goto mem_error;
result= str;
exit:
collector.reset();
func.reset();
scan_it.reset();
DBUG_RETURN(result);
mem_error:
collector.reset();
func.reset();
scan_it.reset();
null_value= 1;
DBUG_RETURN(0);
}
#ifndef DBUG_OFF
longlong Item_func_gis_debug::val_int()
{
/* For now this is just a stub. TODO: implement the internal GIS debuggign */
return 0;
}
#endif
/**********************************************************************/
class Create_func_area : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_area(thd, arg1);
}
static Create_func_area s_singleton;
protected:
Create_func_area() {}
virtual ~Create_func_area() {}
};
class Create_func_as_wkb : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_as_wkb(thd, arg1);
}
static Create_func_as_wkb s_singleton;
protected:
Create_func_as_wkb() {}
virtual ~Create_func_as_wkb() {}
};
class Create_func_as_wkt : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_as_wkt(thd, arg1);
}
static Create_func_as_wkt s_singleton;
protected:
Create_func_as_wkt() {}
virtual ~Create_func_as_wkt() {}
};
class Create_func_centroid : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_centroid(thd, arg1);
}
static Create_func_centroid s_singleton;
protected:
Create_func_centroid() {}
virtual ~Create_func_centroid() {}
};
class Create_func_convexhull : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_convexhull(thd, arg1);
}
static Create_func_convexhull s_singleton;
protected:
Create_func_convexhull() {}
virtual ~Create_func_convexhull() {}
};
class Create_func_pointonsurface : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_pointonsurface(thd, arg1);
}
static Create_func_pointonsurface s_singleton;
protected:
Create_func_pointonsurface() {}
virtual ~Create_func_pointonsurface() {}
};
class Create_func_mbr_contains : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_mbr_rel(thd, arg1, arg2,
Item_func::SP_CONTAINS_FUNC);
}
static Create_func_mbr_contains s_singleton;
protected:
Create_func_mbr_contains() {}
virtual ~Create_func_mbr_contains() {}
};
class Create_func_contains : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_precise_rel(thd, arg1, arg2,
Item_func::SP_CONTAINS_FUNC);
}
static Create_func_contains s_singleton;
protected:
Create_func_contains() {}
virtual ~Create_func_contains() {}
};
class Create_func_crosses : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_precise_rel(thd, arg1, arg2,
Item_func::SP_CROSSES_FUNC);
}
static Create_func_crosses s_singleton;
protected:
Create_func_crosses() {}
virtual ~Create_func_crosses() {}
};
class Create_func_dimension : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_dimension(thd, arg1);
}
static Create_func_dimension s_singleton;
protected:
Create_func_dimension() {}
virtual ~Create_func_dimension() {}
};
class Create_func_mbr_disjoint : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_mbr_rel(thd, arg1, arg2,
Item_func::SP_DISJOINT_FUNC);
}
static Create_func_mbr_disjoint s_singleton;
protected:
Create_func_mbr_disjoint() {}
virtual ~Create_func_mbr_disjoint() {}
};
class Create_func_disjoint : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_precise_rel(thd, arg1, arg2,
Item_func::SP_DISJOINT_FUNC);
}
static Create_func_disjoint s_singleton;
protected:
Create_func_disjoint() {}
virtual ~Create_func_disjoint() {}
};
class Create_func_distance : public Create_func_arg2
{
public:
Item* create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_distance(thd, arg1, arg2);
}
static Create_func_distance s_singleton;
protected:
Create_func_distance() {}
virtual ~Create_func_distance() {}
};
class Create_func_endpoint : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_spatial_decomp(thd, arg1,
Item_func::SP_ENDPOINT);
}
static Create_func_endpoint s_singleton;
protected:
Create_func_endpoint() {}
virtual ~Create_func_endpoint() {}
};
class Create_func_envelope : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_envelope(thd, arg1);
}
static Create_func_envelope s_singleton;
protected:
Create_func_envelope() {}
virtual ~Create_func_envelope() {}
};
class Create_func_boundary : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_boundary(thd, arg1);
}
static Create_func_boundary s_singleton;
protected:
Create_func_boundary() {}
virtual ~Create_func_boundary() {}
};
class Create_func_mbr_equals : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_mbr_rel(thd, arg1, arg2,
Item_func::SP_EQUALS_FUNC);
}
static Create_func_mbr_equals s_singleton;
protected:
Create_func_mbr_equals() {}
virtual ~Create_func_mbr_equals() {}
};
class Create_func_equals : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_precise_rel(thd, arg1, arg2,
Item_func::SP_EQUALS_FUNC);
}
static Create_func_equals s_singleton;
protected:
Create_func_equals() {}
virtual ~Create_func_equals() {}
};
class Create_func_exteriorring : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_spatial_decomp(thd, arg1,
Item_func::SP_EXTERIORRING);
}
static Create_func_exteriorring s_singleton;
protected:
Create_func_exteriorring() {}
virtual ~Create_func_exteriorring() {}
};
class Create_func_geometry_from_text : public Create_native_func
{
public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list);
static Create_func_geometry_from_text s_singleton;
protected:
Create_func_geometry_from_text() {}
virtual ~Create_func_geometry_from_text() {}
};
Item*
Create_func_geometry_from_text::create_native(THD *thd, LEX_CSTRING *name,
List<Item> *item_list)
{
Item *func= NULL;
int arg_count= 0;
if (item_list != NULL)
arg_count= item_list->elements;
switch (arg_count) {
case 1:
{
Item *param_1= item_list->pop();
func= new (thd->mem_root) Item_func_geometry_from_text(thd, param_1);
thd->lex->uncacheable(UNCACHEABLE_RAND);
break;
}
case 2:
{
Item *param_1= item_list->pop();
Item *param_2= item_list->pop();
func= new (thd->mem_root) Item_func_geometry_from_text(thd, param_1, param_2);
break;
}
default:
{
my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
break;
}
}
return func;
}
class Create_func_geometry_from_wkb : public Create_native_func
{
public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list);
static Create_func_geometry_from_wkb s_singleton;
protected:
Create_func_geometry_from_wkb() {}
virtual ~Create_func_geometry_from_wkb() {}
};
Item*
Create_func_geometry_from_wkb::create_native(THD *thd, LEX_CSTRING *name,
List<Item> *item_list)
{
Item *func= NULL;
int arg_count= 0;
if (item_list != NULL)
arg_count= item_list->elements;
switch (arg_count) {
case 1:
{
Item *param_1= item_list->pop();
func= new (thd->mem_root) Item_func_geometry_from_wkb(thd, param_1);
thd->lex->uncacheable(UNCACHEABLE_RAND);
break;
}
case 2:
{
Item *param_1= item_list->pop();
Item *param_2= item_list->pop();
func= new (thd->mem_root) Item_func_geometry_from_wkb(thd, param_1, param_2);
break;
}
default:
{
my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
break;
}
}
return func;
}
class Create_func_geometry_from_json : public Create_native_func
{
public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list);
static Create_func_geometry_from_json s_singleton;
protected:
Create_func_geometry_from_json() {}
virtual ~Create_func_geometry_from_json() {}
};
Item*
Create_func_geometry_from_json::create_native(THD *thd, LEX_CSTRING *name,
List<Item> *item_list)
{
Item *func= NULL;
int arg_count= 0;
if (item_list != NULL)
arg_count= item_list->elements;
switch (arg_count) {
case 1:
{
Item *json= item_list->pop();
func= new (thd->mem_root) Item_func_geometry_from_json(thd, json);
thd->lex->uncacheable(UNCACHEABLE_RAND);
break;
}
case 2:
{
Item *json= item_list->pop();
Item *options= item_list->pop();
func= new (thd->mem_root) Item_func_geometry_from_json(thd, json, options);
break;
}
case 3:
{
Item *json= item_list->pop();
Item *options= item_list->pop();
Item *srid= item_list->pop();
func= new (thd->mem_root) Item_func_geometry_from_json(thd, json, options,
srid);
break;
}
default:
{
my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
break;
}
}
return func;
}
class Create_func_as_geojson : public Create_native_func
{
public:
Item *create_native(THD *thd, LEX_CSTRING *name, List<Item> *item_list);
static Create_func_as_geojson s_singleton;
protected:
Create_func_as_geojson() {}
virtual ~Create_func_as_geojson() {}
};
Item*
Create_func_as_geojson::create_native(THD *thd, LEX_CSTRING *name,
List<Item> *item_list)
{
Item *func= NULL;
int arg_count= 0;
if (item_list != NULL)
arg_count= item_list->elements;
switch (arg_count) {
case 1:
{
Item *geom= item_list->pop();
func= new (thd->mem_root) Item_func_as_geojson(thd, geom);
thd->lex->uncacheable(UNCACHEABLE_RAND);
break;
}
case 2:
{
Item *geom= item_list->pop();
Item *max_dec= item_list->pop();
func= new (thd->mem_root) Item_func_as_geojson(thd, geom, max_dec);
break;
}
case 3:
{
Item *geom= item_list->pop();
Item *max_dec= item_list->pop();
Item *options= item_list->pop();
func= new (thd->mem_root) Item_func_as_geojson(thd, geom, max_dec, options);
break;
}
default:
{
my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name->str);
break;
}
}
return func;
}
class Create_func_geometry_type : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_geometry_type(thd, arg1);
}
static Create_func_geometry_type s_singleton;
protected:
Create_func_geometry_type() {}
virtual ~Create_func_geometry_type() {}
};
class Create_func_geometryn : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_decomp_n(thd, arg1, arg2,
Item_func::SP_GEOMETRYN);
}
static Create_func_geometryn s_singleton;
protected:
Create_func_geometryn() {}
virtual ~Create_func_geometryn() {}
};
#if !defined(DBUG_OFF)
class Create_func_gis_debug : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_gis_debug(thd, arg1);
}
static Create_func_gis_debug s_singleton;
protected:
Create_func_gis_debug() {}
virtual ~Create_func_gis_debug() {}
};
#endif
class Create_func_glength : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_glength(thd, arg1);
}
static Create_func_glength s_singleton;
protected:
Create_func_glength() {}
virtual ~Create_func_glength() {}
};
class Create_func_interiorringn : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_decomp_n(thd, arg1, arg2,
Item_func::SP_INTERIORRINGN);
}
static Create_func_interiorringn s_singleton;
protected:
Create_func_interiorringn() {}
virtual ~Create_func_interiorringn() {}
};
class Create_func_relate : public Create_func_arg3
{
public:
Item *create_3_arg(THD *thd, Item *arg1, Item *arg2, Item *arg3) override
{
return new (thd->mem_root) Item_func_spatial_relate(thd, arg1, arg2, arg3);
}
static Create_func_relate s_singleton;
protected:
Create_func_relate() {}
virtual ~Create_func_relate() {}
};
class Create_func_mbr_intersects : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_mbr_rel(thd, arg1, arg2,
Item_func::SP_INTERSECTS_FUNC);
}
static Create_func_mbr_intersects s_singleton;
protected:
Create_func_mbr_intersects() {}
virtual ~Create_func_mbr_intersects() {}
};
class Create_func_intersects : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_precise_rel(thd, arg1, arg2,
Item_func::SP_INTERSECTS_FUNC);
}
static Create_func_intersects s_singleton;
protected:
Create_func_intersects() {}
virtual ~Create_func_intersects() {}
};
class Create_func_intersection : public Create_func_arg2
{
public:
Item* create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_operation(thd, arg1, arg2,
Gcalc_function::op_intersection);
}
static Create_func_intersection s_singleton;
protected:
Create_func_intersection() {}
virtual ~Create_func_intersection() {}
};
class Create_func_difference : public Create_func_arg2
{
public:
Item* create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_operation(thd, arg1, arg2,
Gcalc_function::op_difference);
}
static Create_func_difference s_singleton;
protected:
Create_func_difference() {}
virtual ~Create_func_difference() {}
};
class Create_func_union : public Create_func_arg2
{
public:
Item* create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_operation(thd, arg1, arg2,
Gcalc_function::op_union);
}
static Create_func_union s_singleton;
protected:
Create_func_union() {}
virtual ~Create_func_union() {}
};
class Create_func_symdifference : public Create_func_arg2
{
public:
Item* create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_operation(thd, arg1, arg2,
Gcalc_function::op_symdifference);
}
static Create_func_symdifference s_singleton;
protected:
Create_func_symdifference() {}
virtual ~Create_func_symdifference() {}
};
class Create_func_buffer : public Create_func_arg2
{
public:
Item* create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_buffer(thd, arg1, arg2);
}
static Create_func_buffer s_singleton;
protected:
Create_func_buffer() {}
virtual ~Create_func_buffer() {}
};
class Create_func_isclosed : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_isclosed(thd, arg1);
}
static Create_func_isclosed s_singleton;
protected:
Create_func_isclosed() {}
virtual ~Create_func_isclosed() {}
};
class Create_func_isring : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_isring(thd, arg1);
}
static Create_func_isring s_singleton;
protected:
Create_func_isring() {}
virtual ~Create_func_isring() {}
};
class Create_func_isempty : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_isempty(thd, arg1);
}
static Create_func_isempty s_singleton;
protected:
Create_func_isempty() {}
virtual ~Create_func_isempty() {}
};
class Create_func_issimple : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_issimple(thd, arg1);
}
static Create_func_issimple s_singleton;
protected:
Create_func_issimple() {}
virtual ~Create_func_issimple() {}
};
class Create_func_numgeometries : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_numgeometries(thd, arg1);
}
static Create_func_numgeometries s_singleton;
protected:
Create_func_numgeometries() {}
virtual ~Create_func_numgeometries() {}
};
class Create_func_numinteriorring : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_numinteriorring(thd, arg1);
}
static Create_func_numinteriorring s_singleton;
protected:
Create_func_numinteriorring() {}
virtual ~Create_func_numinteriorring() {}
};
class Create_func_numpoints : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_numpoints(thd, arg1);
}
static Create_func_numpoints s_singleton;
protected:
Create_func_numpoints() {}
virtual ~Create_func_numpoints() {}
};
class Create_func_mbr_overlaps : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_mbr_rel(thd, arg1, arg2,
Item_func::SP_OVERLAPS_FUNC);
}
static Create_func_mbr_overlaps s_singleton;
protected:
Create_func_mbr_overlaps() {}
virtual ~Create_func_mbr_overlaps() {}
};
class Create_func_overlaps : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_precise_rel(thd, arg1, arg2,
Item_func::SP_OVERLAPS_FUNC);
}
static Create_func_overlaps s_singleton;
protected:
Create_func_overlaps() {}
virtual ~Create_func_overlaps() {}
};
class Create_func_pointn : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_decomp_n(thd, arg1, arg2,
Item_func::SP_POINTN);
}
static Create_func_pointn s_singleton;
protected:
Create_func_pointn() {}
virtual ~Create_func_pointn() {}
};
class Create_func_srid : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_srid(thd, arg1);
}
static Create_func_srid s_singleton;
protected:
Create_func_srid() {}
virtual ~Create_func_srid() {}
};
class Create_func_startpoint : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_spatial_decomp(thd, arg1,
Item_func::SP_STARTPOINT);
}
static Create_func_startpoint s_singleton;
protected:
Create_func_startpoint() {}
virtual ~Create_func_startpoint() {}
};
class Create_func_touches : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_precise_rel(thd, arg1, arg2,
Item_func::SP_TOUCHES_FUNC);
}
static Create_func_touches s_singleton;
protected:
Create_func_touches() {}
virtual ~Create_func_touches() {}
};
class Create_func_mbr_within : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_mbr_rel(thd, arg1, arg2,
Item_func::SP_WITHIN_FUNC);
}
static Create_func_mbr_within s_singleton;
protected:
Create_func_mbr_within() {}
virtual ~Create_func_mbr_within() {}
};
class Create_func_within : public Create_func_arg2
{
public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{
return new (thd->mem_root) Item_func_spatial_precise_rel(thd, arg1, arg2,
Item_func::SP_WITHIN_FUNC);
}
static Create_func_within s_singleton;
protected:
Create_func_within() {}
virtual ~Create_func_within() {}
};
class Create_func_x : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_x(thd, arg1);
}
static Create_func_x s_singleton;
protected:
Create_func_x() {}
virtual ~Create_func_x() {}
};
class Create_func_y : public Create_func_arg1
{
public:
Item *create_1_arg(THD *thd, Item *arg1) override
{
return new (thd->mem_root) Item_func_y(thd, arg1);
}
static Create_func_y s_singleton;
protected:
Create_func_y() {}
virtual ~Create_func_y() {}
};
/*****************************************************************/
/*************************************************************************/
#if !defined(DBUG_OFF)
Create_func_gis_debug Create_func_gis_debug::s_singleton;
#endif
Create_func_area Create_func_area::s_singleton;
Create_func_as_geojson Create_func_as_geojson::s_singleton;
Create_func_as_wkb Create_func_as_wkb::s_singleton;
Create_func_as_wkt Create_func_as_wkt::s_singleton;
Create_func_boundary Create_func_boundary::s_singleton;
Create_func_buffer Create_func_buffer::s_singleton;
Create_func_centroid Create_func_centroid::s_singleton;
Create_func_contains Create_func_contains::s_singleton;
Create_func_convexhull Create_func_convexhull::s_singleton;
Create_func_crosses Create_func_crosses::s_singleton;
Create_func_difference Create_func_difference::s_singleton;
Create_func_dimension Create_func_dimension::s_singleton;
Create_func_disjoint Create_func_disjoint::s_singleton;
Create_func_distance Create_func_distance::s_singleton;
Create_func_endpoint Create_func_endpoint::s_singleton;
Create_func_envelope Create_func_envelope::s_singleton;
Create_func_equals Create_func_equals::s_singleton;
Create_func_exteriorring Create_func_exteriorring::s_singleton;
Create_func_geometry_from_json Create_func_geometry_from_json::s_singleton;
Create_func_geometry_from_text Create_func_geometry_from_text::s_singleton;
Create_func_geometry_from_wkb Create_func_geometry_from_wkb::s_singleton;
Create_func_geometryn Create_func_geometryn::s_singleton;
Create_func_geometry_type Create_func_geometry_type::s_singleton;
Create_func_glength Create_func_glength::s_singleton;
Create_func_interiorringn Create_func_interiorringn::s_singleton;
Create_func_intersection Create_func_intersection::s_singleton;
Create_func_intersects Create_func_intersects::s_singleton;
Create_func_isclosed Create_func_isclosed::s_singleton;
Create_func_isempty Create_func_isempty::s_singleton;
Create_func_isring Create_func_isring::s_singleton;
Create_func_issimple Create_func_issimple::s_singleton;
Create_func_mbr_contains Create_func_mbr_contains::s_singleton;
Create_func_mbr_disjoint Create_func_mbr_disjoint::s_singleton;
Create_func_mbr_equals Create_func_mbr_equals::s_singleton;
Create_func_mbr_intersects Create_func_mbr_intersects::s_singleton;
Create_func_mbr_overlaps Create_func_mbr_overlaps::s_singleton;
Create_func_mbr_within Create_func_mbr_within::s_singleton;
Create_func_numgeometries Create_func_numgeometries::s_singleton;
Create_func_numinteriorring Create_func_numinteriorring::s_singleton;
Create_func_numpoints Create_func_numpoints::s_singleton;
Create_func_overlaps Create_func_overlaps::s_singleton;
Create_func_pointn Create_func_pointn::s_singleton;
Create_func_pointonsurface Create_func_pointonsurface::s_singleton;
Create_func_relate Create_func_relate::s_singleton;
Create_func_srid Create_func_srid::s_singleton;
Create_func_startpoint Create_func_startpoint::s_singleton;
Create_func_symdifference Create_func_symdifference::s_singleton;
Create_func_touches Create_func_touches::s_singleton;
Create_func_union Create_func_union::s_singleton;
Create_func_within Create_func_within::s_singleton;
Create_func_x Create_func_x::s_singleton;
Create_func_y Create_func_y::s_singleton;
/*************************************************************************/
#define GEOM_BUILDER(F) & F::s_singleton
static Native_func_registry func_array_geom[] =
{
#ifndef DBUG_OFF
{ { STRING_WITH_LEN("ST_GIS_DEBUG") }, GEOM_BUILDER(Create_func_gis_debug)},
#endif
{ { STRING_WITH_LEN("AREA") }, GEOM_BUILDER(Create_func_area)},
{ { STRING_WITH_LEN("ASBINARY") }, GEOM_BUILDER(Create_func_as_wkb)},
{ { STRING_WITH_LEN("ASTEXT") }, GEOM_BUILDER(Create_func_as_wkt)},
{ { STRING_WITH_LEN("ASWKB") }, GEOM_BUILDER(Create_func_as_wkb)},
{ { STRING_WITH_LEN("ASWKT") }, GEOM_BUILDER(Create_func_as_wkt)},
{ { STRING_WITH_LEN("BOUNDARY") }, GEOM_BUILDER(Create_func_boundary)},
{ { STRING_WITH_LEN("BUFFER") }, GEOM_BUILDER(Create_func_buffer)},
{ { STRING_WITH_LEN("CENTROID") }, GEOM_BUILDER(Create_func_centroid)},
{ { STRING_WITH_LEN("CONTAINS") }, GEOM_BUILDER(Create_func_contains)},
{ { STRING_WITH_LEN("CONVEXHULL") }, GEOM_BUILDER(Create_func_convexhull)},
{ { STRING_WITH_LEN("CROSSES") }, GEOM_BUILDER(Create_func_crosses)},
{ { STRING_WITH_LEN("DIMENSION") }, GEOM_BUILDER(Create_func_dimension)},
{ { STRING_WITH_LEN("DISJOINT") }, GEOM_BUILDER(Create_func_mbr_disjoint)},
{ { STRING_WITH_LEN("ENDPOINT") }, GEOM_BUILDER(Create_func_endpoint)},
{ { STRING_WITH_LEN("ENVELOPE") }, GEOM_BUILDER(Create_func_envelope)},
{ { STRING_WITH_LEN("EQUALS") }, GEOM_BUILDER(Create_func_equals)},
{ { STRING_WITH_LEN("EXTERIORRING") }, GEOM_BUILDER(Create_func_exteriorring)},
{ { STRING_WITH_LEN("GEOMCOLLFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("GEOMCOLLFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("GEOMETRYCOLLECTIONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("GEOMETRYCOLLECTIONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("GEOMETRYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("GEOMETRYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("GEOMETRYN") }, GEOM_BUILDER(Create_func_geometryn)},
{ { STRING_WITH_LEN("GEOMETRYTYPE") }, GEOM_BUILDER(Create_func_geometry_type)},
{ { STRING_WITH_LEN("GEOMFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("GEOMFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("GLENGTH") }, GEOM_BUILDER(Create_func_glength)},
{ { STRING_WITH_LEN("INTERIORRINGN") }, GEOM_BUILDER(Create_func_interiorringn)},
{ { STRING_WITH_LEN("INTERSECTS") }, GEOM_BUILDER(Create_func_mbr_intersects)},
{ { STRING_WITH_LEN("ISCLOSED") }, GEOM_BUILDER(Create_func_isclosed)},
{ { STRING_WITH_LEN("ISEMPTY") }, GEOM_BUILDER(Create_func_isempty)},
{ { STRING_WITH_LEN("ISRING") }, GEOM_BUILDER(Create_func_isring)},
{ { STRING_WITH_LEN("ISSIMPLE") }, GEOM_BUILDER(Create_func_issimple)},
{ { STRING_WITH_LEN("LINEFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("LINEFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("LINESTRINGFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("LINESTRINGFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("MBRCONTAINS") }, GEOM_BUILDER(Create_func_mbr_contains)},
{ { STRING_WITH_LEN("MBRDISJOINT") }, GEOM_BUILDER(Create_func_mbr_disjoint)},
{ { STRING_WITH_LEN("MBREQUAL") }, GEOM_BUILDER(Create_func_mbr_equals)},
{ { STRING_WITH_LEN("MBREQUALS") }, GEOM_BUILDER(Create_func_mbr_equals)},
{ { STRING_WITH_LEN("MBRINTERSECTS") }, GEOM_BUILDER(Create_func_mbr_intersects)},
{ { STRING_WITH_LEN("MBROVERLAPS") }, GEOM_BUILDER(Create_func_mbr_overlaps)},
{ { STRING_WITH_LEN("MBRTOUCHES") }, GEOM_BUILDER(Create_func_touches)},
{ { STRING_WITH_LEN("MBRWITHIN") }, GEOM_BUILDER(Create_func_mbr_within)},
{ { STRING_WITH_LEN("MLINEFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("MLINEFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("MPOINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("MPOINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("MPOLYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("MPOLYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("MULTILINESTRINGFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("MULTILINESTRINGFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("MULTIPOINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("MULTIPOINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("MULTIPOLYGONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("MULTIPOLYGONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("NUMGEOMETRIES") }, GEOM_BUILDER(Create_func_numgeometries)},
{ { STRING_WITH_LEN("NUMINTERIORRINGS") }, GEOM_BUILDER(Create_func_numinteriorring)},
{ { STRING_WITH_LEN("NUMPOINTS") }, GEOM_BUILDER(Create_func_numpoints)},
{ { STRING_WITH_LEN("OVERLAPS") }, GEOM_BUILDER(Create_func_mbr_overlaps)},
{ { STRING_WITH_LEN("POINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("POINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("POINTN") }, GEOM_BUILDER(Create_func_pointn)},
{ { STRING_WITH_LEN("POINTONSURFACE") }, GEOM_BUILDER(Create_func_pointonsurface)},
{ { STRING_WITH_LEN("POLYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("POLYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("POLYGONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("POLYGONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("SRID") }, GEOM_BUILDER(Create_func_srid)},
{ { STRING_WITH_LEN("ST_AREA") }, GEOM_BUILDER(Create_func_area)},
{ { STRING_WITH_LEN("STARTPOINT") }, GEOM_BUILDER(Create_func_startpoint)},
{ { STRING_WITH_LEN("ST_ASBINARY") }, GEOM_BUILDER(Create_func_as_wkb)},
{ { STRING_WITH_LEN("ST_ASGEOJSON") }, GEOM_BUILDER(Create_func_as_geojson)},
{ { STRING_WITH_LEN("ST_ASTEXT") }, GEOM_BUILDER(Create_func_as_wkt)},
{ { STRING_WITH_LEN("ST_ASWKB") }, GEOM_BUILDER(Create_func_as_wkb)},
{ { STRING_WITH_LEN("ST_ASWKT") }, GEOM_BUILDER(Create_func_as_wkt)},
{ { STRING_WITH_LEN("ST_BOUNDARY") }, GEOM_BUILDER(Create_func_boundary)},
{ { STRING_WITH_LEN("ST_BUFFER") }, GEOM_BUILDER(Create_func_buffer)},
{ { STRING_WITH_LEN("ST_CENTROID") }, GEOM_BUILDER(Create_func_centroid)},
{ { STRING_WITH_LEN("ST_CONTAINS") }, GEOM_BUILDER(Create_func_contains)},
{ { STRING_WITH_LEN("ST_CONVEXHULL") }, GEOM_BUILDER(Create_func_convexhull)},
{ { STRING_WITH_LEN("ST_CROSSES") }, GEOM_BUILDER(Create_func_crosses)},
{ { STRING_WITH_LEN("ST_DIFFERENCE") }, GEOM_BUILDER(Create_func_difference)},
{ { STRING_WITH_LEN("ST_DIMENSION") }, GEOM_BUILDER(Create_func_dimension)},
{ { STRING_WITH_LEN("ST_DISJOINT") }, GEOM_BUILDER(Create_func_disjoint)},
{ { STRING_WITH_LEN("ST_DISTANCE") }, GEOM_BUILDER(Create_func_distance)},
{ { STRING_WITH_LEN("ST_ENDPOINT") }, GEOM_BUILDER(Create_func_endpoint)},
{ { STRING_WITH_LEN("ST_ENVELOPE") }, GEOM_BUILDER(Create_func_envelope)},
{ { STRING_WITH_LEN("ST_EQUALS") }, GEOM_BUILDER(Create_func_equals)},
{ { STRING_WITH_LEN("ST_EQUALS") }, GEOM_BUILDER(Create_func_equals)},
{ { STRING_WITH_LEN("ST_EXTERIORRING") }, GEOM_BUILDER(Create_func_exteriorring)},
{ { STRING_WITH_LEN("ST_GEOMCOLLFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_GEOMCOLLFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_GEOMETRYCOLLECTIONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_GEOMETRYCOLLECTIONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_GEOMETRYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_GEOMETRYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_GEOMETRYN") }, GEOM_BUILDER(Create_func_geometryn)},
{ { STRING_WITH_LEN("ST_GEOMETRYTYPE") }, GEOM_BUILDER(Create_func_geometry_type)},
{ { STRING_WITH_LEN("ST_GEOMFROMGEOJSON") }, GEOM_BUILDER(Create_func_geometry_from_json)},
{ { STRING_WITH_LEN("ST_GEOMFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_GEOMFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_INTERIORRINGN") }, GEOM_BUILDER(Create_func_interiorringn)},
{ { STRING_WITH_LEN("ST_INTERSECTION") }, GEOM_BUILDER(Create_func_intersection)},
{ { STRING_WITH_LEN("ST_INTERSECTS") }, GEOM_BUILDER(Create_func_intersects)},
{ { STRING_WITH_LEN("ST_ISCLOSED") }, GEOM_BUILDER(Create_func_isclosed)},
{ { STRING_WITH_LEN("ST_ISEMPTY") }, GEOM_BUILDER(Create_func_isempty)},
{ { STRING_WITH_LEN("ST_ISRING") }, GEOM_BUILDER(Create_func_isring)},
{ { STRING_WITH_LEN("ST_ISSIMPLE") }, GEOM_BUILDER(Create_func_issimple)},
{ { STRING_WITH_LEN("ST_LENGTH") }, GEOM_BUILDER(Create_func_glength)},
{ { STRING_WITH_LEN("ST_LINEFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_LINEFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_LINESTRINGFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_LINESTRINGFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_MLINEFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_MLINEFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_MPOINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_MPOINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_MPOLYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_MPOLYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_MULTILINESTRINGFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_MULTILINESTRINGFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_MULTIPOINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_MULTIPOINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_MULTIPOLYGONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_MULTIPOLYGONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_NUMGEOMETRIES") }, GEOM_BUILDER(Create_func_numgeometries)},
{ { STRING_WITH_LEN("ST_NUMINTERIORRINGS") }, GEOM_BUILDER(Create_func_numinteriorring)},
{ { STRING_WITH_LEN("ST_NUMPOINTS") }, GEOM_BUILDER(Create_func_numpoints)},
{ { STRING_WITH_LEN("ST_OVERLAPS") }, GEOM_BUILDER(Create_func_overlaps)},
{ { STRING_WITH_LEN("ST_POINTFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_POINTFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_POINTN") }, GEOM_BUILDER(Create_func_pointn)},
{ { STRING_WITH_LEN("ST_POINTONSURFACE") }, GEOM_BUILDER(Create_func_pointonsurface)},
{ { STRING_WITH_LEN("ST_POLYFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_POLYFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_POLYGONFROMTEXT") }, GEOM_BUILDER(Create_func_geometry_from_text)},
{ { STRING_WITH_LEN("ST_POLYGONFROMWKB") }, GEOM_BUILDER(Create_func_geometry_from_wkb)},
{ { STRING_WITH_LEN("ST_RELATE") }, GEOM_BUILDER(Create_func_relate)},
{ { STRING_WITH_LEN("ST_SRID") }, GEOM_BUILDER(Create_func_srid)},
{ { STRING_WITH_LEN("ST_STARTPOINT") }, GEOM_BUILDER(Create_func_startpoint)},
{ { STRING_WITH_LEN("ST_SYMDIFFERENCE") }, GEOM_BUILDER(Create_func_symdifference)},
{ { STRING_WITH_LEN("ST_TOUCHES") }, GEOM_BUILDER(Create_func_touches)},
{ { STRING_WITH_LEN("ST_UNION") }, GEOM_BUILDER(Create_func_union)},
{ { STRING_WITH_LEN("ST_WITHIN") }, GEOM_BUILDER(Create_func_within)},
{ { STRING_WITH_LEN("ST_X") }, GEOM_BUILDER(Create_func_x)},
{ { STRING_WITH_LEN("ST_Y") }, GEOM_BUILDER(Create_func_y)},
{ { STRING_WITH_LEN("TOUCHES") }, GEOM_BUILDER(Create_func_touches)},
{ { STRING_WITH_LEN("WITHIN") }, GEOM_BUILDER(Create_func_within)},
{ { STRING_WITH_LEN("X") }, GEOM_BUILDER(Create_func_x)},
{ { STRING_WITH_LEN("Y") }, GEOM_BUILDER(Create_func_y)},
};
Native_func_registry_array
native_func_registry_array_geom(func_array_geom,
array_elements(func_array_geom));
#endif /*HAVE_SPATIAL*/