| 
      
      
      From: <asf...@us...> - 2010-06-04 23:15:50
       | 
| Revision: 51203
          http://firebird.svn.sourceforge.net/firebird/?rev=51203&view=rev
Author:   asfernandes
Date:     2010-06-04 23:14:48 +0000 (Fri, 04 Jun 2010)
Log Message:
-----------
Set svn:eol-style to native
Modified Paths:
--------------
    firebird/trunk/ChangeLog
    firebird/trunk/builds/install/arch-specific/darwin/License.txt
    firebird/trunk/extern/editline/configure
    firebird/trunk/extern/icu/as_is/os390/unpax-icu.sh
    firebird/trunk/extern/icu/source/extra/uconv/samples/iso8859-1.txt
    firebird/trunk/extern/icu/source/extra/uconv/samples/utf8/greek.txt
    firebird/trunk/extern/icu/source/test/unalignedtest/unaligned.c
Property Changed:
----------------
    firebird/trunk/ChangeLog
    firebird/trunk/Makefile.in
    firebird/trunk/acx_pthread.m4
    firebird/trunk/autogen.sh
    firebird/trunk/binreloc.m4
    firebird/trunk/builds/install/arch-specific/aix/Makefile.in
    firebird/trunk/builds/install/arch-specific/aix/classic/makeInstallImage.sh.in
    firebird/trunk/builds/install/arch-specific/aix/classic/rpmfiles.txt.in
    firebird/trunk/builds/install/arch-specific/aix/classic/rpmheader.txt.in
    firebird/trunk/builds/install/arch-specific/aix/misc/aixLibrary.sh.in
    firebird/trunk/builds/install/arch-specific/aix/misc/firebird.init.d.aix.in
    firebird/trunk/builds/install/arch-specific/aix/misc/postinstall.sh.in
    firebird/trunk/builds/install/arch-specific/aix/misc/postuninstall.sh.in
    firebird/trunk/builds/install/arch-specific/aix/misc/preinstall.sh.in
    firebird/trunk/builds/install/arch-specific/aix/misc/preuninstall.sh.in
    firebird/trunk/builds/install/arch-specific/aix/misc/rc.config.firebird.aix.in
    firebird/trunk/builds/install/arch-specific/aix/misc/tarinstall.sh.in
    firebird/trunk/builds/install/arch-specific/aix/misc/tarmaininstall.sh.in
    firebird/trunk/builds/install/arch-specific/aix/misc/tarmainuninstall.sh.in
    firebird/trunk/builds/install/arch-specific/aix/misc/taruninstall.sh.in
    firebird/trunk/builds/install/arch-specific/darwin/Description.plist
    firebird/trunk/builds/install/arch-specific/darwin/FB.info
    firebird/trunk/builds/install/arch-specific/darwin/Firebird.startupitem/Firebird
    firebird/trunk/builds/install/arch-specific/darwin/Firebird.startupitem/Resources/English.lproj/Localizable.strings
    firebird/trunk/builds/install/arch-specific/darwin/Firebird.startupitem/StartupParameters.plist
    firebird/trunk/builds/install/arch-specific/darwin/FrameworkInfo.plist
    firebird/trunk/builds/install/arch-specific/darwin/Info.plist
    firebird/trunk/builds/install/arch-specific/darwin/License.txt
    firebird/trunk/builds/install/arch-specific/darwin/Makefile.in
    firebird/trunk/builds/install/arch-specific/darwin/PkgInfo
    firebird/trunk/builds/install/arch-specific/darwin/Readme.txt
    firebird/trunk/builds/install/arch-specific/darwin/Welcome.txt
    firebird/trunk/builds/install/arch-specific/darwin/aliases.conf.in
    firebird/trunk/builds/install/arch-specific/darwin/buildno.c
    firebird/trunk/builds/install/arch-specific/darwin/buildsuffix.c
    firebird/trunk/builds/install/arch-specific/darwin/changeMultiConnectMode
    firebird/trunk/builds/install/arch-specific/darwin/fullvers.c
    firebird/trunk/builds/install/arch-specific/darwin/install-script
    firebird/trunk/builds/install/arch-specific/darwin/launchd.org.firebird.gds.plist
    firebird/trunk/builds/install/arch-specific/darwin/majorvers.c
    firebird/trunk/builds/install/arch-specific/darwin/minorvers.c
    firebird/trunk/builds/install/arch-specific/darwin/preinstall-script
    firebird/trunk/builds/install/arch-specific/darwin/preupgrade-script
    firebird/trunk/builds/install/arch-specific/darwin/revno.c
    firebird/trunk/builds/install/arch-specific/freebsd/Makefile.in
    firebird/trunk/builds/install/arch-specific/freebsd/freebsdLibrary.sh.in
    firebird/trunk/builds/install/arch-specific/freebsd/install.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/Makefile.in
    firebird/trunk/builds/install/arch-specific/hpux/classic/firebirdCS.psf.in
    firebird/trunk/builds/install/arch-specific/hpux/classic/makeinstallImage.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/classic/postInstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/classic/postUninstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/classic/preInstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/classic/preUninstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/classic/tarInstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/classic/tarUninstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/classic/tarmainInstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/classic/tarmainUninstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/misc/changedbaPassword.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/misc/changegdslibrarycompatibleLink.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/misc/createaliasDB.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/misc/firebird.init.d.hpux.in
    firebird/trunk/builds/install/arch-specific/hpux/misc/hpuxLibrary.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/misc/rc.config.firebird.hpux.in
    firebird/trunk/builds/install/arch-specific/hpux/super/makeinstallImage.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/super/postInstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/super/postUninstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/super/preInstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/super/preUninstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/super/tarInstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/super/tarUninstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/super/tarmainInstall.sh.in
    firebird/trunk/builds/install/arch-specific/hpux/super/tarmainUninstall.sh.in
    firebird/trunk/builds/install/arch-specific/linux/Makefile.in
    firebird/trunk/builds/install/arch-specific/linux/classic/rpmfiles.txt.in
    firebird/trunk/builds/install/arch-specific/linux/classic/rpmheader.txt.in
    firebird/trunk/builds/install/arch-specific/linux/misc/README
    firebird/trunk/builds/install/arch-specific/linux/misc/firebird.init.d.debian.in
    firebird/trunk/builds/install/arch-specific/linux/misc/firebird.init.d.generic.in
    firebird/trunk/builds/install/arch-specific/linux/misc/firebird.init.d.gentoo.in
    firebird/trunk/builds/install/arch-specific/linux/misc/firebird.init.d.mandrake.in
    firebird/trunk/builds/install/arch-specific/linux/misc/firebird.init.d.slackware.in
    firebird/trunk/builds/install/arch-specific/linux/misc/firebird.init.d.suse.in
    firebird/trunk/builds/install/arch-specific/linux/misc/firebird.xinetd.in
    firebird/trunk/builds/install/arch-specific/linux/misc/linuxLibrary.sh.in
    firebird/trunk/builds/install/arch-specific/linux/misc/makeInstallImage.sh.in
    firebird/trunk/builds/install/arch-specific/linux/misc/postinstall.sh.in
    firebird/trunk/builds/install/arch-specific/linux/misc/postuninstall.sh.in
    firebird/trunk/builds/install/arch-specific/linux/misc/preinstall.sh.in
    firebird/trunk/builds/install/arch-specific/linux/misc/preuninstall.sh.in
    firebird/trunk/builds/install/arch-specific/linux/misc/rc.config.firebird.in
    firebird/trunk/builds/install/arch-specific/linux/misc/tarMainInstall.sh.in
    firebird/trunk/builds/install/arch-specific/linux/misc/tarMainUninstall.sh.in
    firebird/trunk/builds/install/arch-specific/linux/misc/tarinstall.sh.in
    firebird/trunk/builds/install/arch-specific/linux/misc/taruninstall.sh.in
    firebird/trunk/builds/install/arch-specific/linux/super/rpmfiles.txt.in
    firebird/trunk/builds/install/arch-specific/linux/super/rpmheader.txt.in
    firebird/trunk/builds/install/arch-specific/mingw/Makefile.in
    firebird/trunk/builds/install/arch-specific/mingw/super/Readme.txt
    firebird/trunk/builds/install/arch-specific/netbsd/Makefile.in
    firebird/trunk/builds/install/arch-specific/netbsd/install.sh.in
    firebird/trunk/builds/install/arch-specific/solaris/CS/gds_db-tcp.xml
    firebird/trunk/builds/install/arch-specific/solaris/CS/pkginfo.in
    firebird/trunk/builds/install/arch-specific/solaris/CS/postinstall.in
    firebird/trunk/builds/install/arch-specific/solaris/CS/postremove.in
    firebird/trunk/builds/install/arch-specific/solaris/CS/preinstall.in
    firebird/trunk/builds/install/arch-specific/solaris/CS/prototype.icu.in
    firebird/trunk/builds/install/arch-specific/solaris/CS/prototype.in
    firebird/trunk/builds/install/arch-specific/solaris/Makefile.in
    firebird/trunk/builds/install/arch-specific/solaris/SS/gds_db-tcp.xml
    firebird/trunk/builds/install/arch-specific/solaris/SS/pkginfo.in
    firebird/trunk/builds/install/arch-specific/solaris/SS/postinstall.in
    firebird/trunk/builds/install/arch-specific/solaris/SS/postremove.in
    firebird/trunk/builds/install/arch-specific/solaris/SS/preinstall.in
    firebird/trunk/builds/install/arch-specific/solaris/SS/prototype.icu.in
    firebird/trunk/builds/install/arch-specific/solaris/SS/prototype.in
    firebird/trunk/builds/install/arch-specific/solaris/libgcc/pkginfolg.in
    firebird/trunk/builds/install/arch-specific/solaris/libgcc/prototypelg.in
    firebird/trunk/builds/install/arch-specific/solx86/Makefile.in
    firebird/trunk/builds/install/arch-specific/win32/After_Installation.url
    firebird/trunk/builds/install/arch-specific/win32/BuildExecutableInstall.bat
    firebird/trunk/builds/install/arch-specific/win32/FirebirdInstallEnvironmentChecks.inc
    firebird/trunk/builds/install/arch-specific/win32/FirebirdInstallSupportFunctions.inc
    firebird/trunk/builds/install/arch-specific/win32/FirebirdInstall_20.iss
    firebird/trunk/builds/install/arch-specific/win32/Readme.txt
    firebird/trunk/builds/install/arch-specific/win32/ba/Instalacija_ProcitajMe.txt
    firebird/trunk/builds/install/arch-specific/win32/ba/ProcitajMe.txt
    firebird/trunk/builds/install/arch-specific/win32/ba/custom_messages_ba.inc
    firebird/trunk/builds/install/arch-specific/win32/custom_messages.inc
    firebird/trunk/builds/install/arch-specific/win32/de/custom_messages_de.inc
    firebird/trunk/builds/install/arch-specific/win32/de/installation_liesmich.txt
    firebird/trunk/builds/install/arch-specific/win32/de/liesmich.txt
    firebird/trunk/builds/install/arch-specific/win32/es/custom_messages_es.inc
    firebird/trunk/builds/install/arch-specific/win32/es/leame.txt
    firebird/trunk/builds/install/arch-specific/win32/es/leame_instalacion.txt
    firebird/trunk/builds/install/arch-specific/win32/firebirdsql.org.url
    firebird/trunk/builds/install/arch-specific/win32/fr/custom_messages_fr.inc
    firebird/trunk/builds/install/arch-specific/win32/fr/documents-en-francais.txt
    firebird/trunk/builds/install/arch-specific/win32/fr/installation_lisezmoi.txt
    firebird/trunk/builds/install/arch-specific/win32/fr/lisezmoi.txt
    firebird/trunk/builds/install/arch-specific/win32/hu/custom_messages_hu.inc
    firebird/trunk/builds/install/arch-specific/win32/hu/olvass_el.txt
    firebird/trunk/builds/install/arch-specific/win32/hu/telepitesi_segedlet.txt
    firebird/trunk/builds/install/arch-specific/win32/i18n_readme.txt
    firebird/trunk/builds/install/arch-specific/win32/install_classic.bat
    firebird/trunk/builds/install/arch-specific/win32/install_super.bat
    firebird/trunk/builds/install/arch-specific/win32/installation_readme.txt
    firebird/trunk/builds/install/arch-specific/win32/installation_scripted.txt
    firebird/trunk/builds/install/arch-specific/win32/it/custom_messages_it.inc
    firebird/trunk/builds/install/arch-specific/win32/it/leggimi.txt
    firebird/trunk/builds/install/arch-specific/win32/it/leggimi_installazione.txt
    firebird/trunk/builds/install/arch-specific/win32/pl/custom_messages_pl.inc
    firebird/trunk/builds/install/arch-specific/win32/pl/czytajto.txt
    firebird/trunk/builds/install/arch-specific/win32/pl/instalacja_czytajto.txt
    firebird/trunk/builds/install/arch-specific/win32/pt/custom_messages_pt.inc
    firebird/trunk/builds/install/arch-specific/win32/pt/instalacao_leia-me.txt
    firebird/trunk/builds/install/arch-specific/win32/pt/leia-me.txt
    firebird/trunk/builds/install/arch-specific/win32/readme_snapshot.txt
    firebird/trunk/builds/install/arch-specific/win32/si/custom_messages_si.inc
    firebird/trunk/builds/install/arch-specific/win32/si/instalacija_precitajMe.txt
    firebird/trunk/builds/install/arch-specific/win32/strip_comments.sed
    firebird/trunk/builds/install/arch-specific/win32/uninstall.bat
    firebird/trunk/builds/install/misc/IDPLicense.txt
    firebird/trunk/builds/install/misc/IPLicense.txt
    firebird/trunk/builds/install/misc/aliases.conf.in
    firebird/trunk/builds/install/misc/changeDBAPassword.sh.in
    firebird/trunk/builds/install/misc/changeGdsLibraryCompatibleLink.sh.in
    firebird/trunk/builds/install/misc/changeMultiConnectMode.sh.in
    firebird/trunk/builds/install/misc/changeRunUser.sh.in
    firebird/trunk/builds/install/misc/classicLibrary.sh.in
    firebird/trunk/builds/install/misc/createAliasDB.sh.in
    firebird/trunk/builds/install/misc/fb_config.in
    firebird/trunk/builds/install/misc/fbintl.conf
    firebird/trunk/builds/install/misc/firebird.conf.in
    firebird/trunk/builds/install/misc/firebird.init.d.Solaris.in
    firebird/trunk/builds/install/misc/firebird.init.d.generic.in
    firebird/trunk/builds/install/misc/firebird.init.d.mandrake.in
    firebird/trunk/builds/install/misc/posixLibrary.sh.in
    firebird/trunk/builds/install/misc/restoreRootRunUser.sh.in
    firebird/trunk/builds/install/misc/superLibrary.sh.in
    firebird/trunk/builds/mac_os_x/CS/CS.pbproj/project.pbxproj
    firebird/trunk/builds/mac_os_x/CS/Helpers.make
    firebird/trunk/builds/mac_os_x/CS/gpre_wrapper.sh
    firebird/trunk/builds/mac_os_x/CS/make_wrapper.sh
    firebird/trunk/builds/mac_os_x/CS/stlport_vars.cpp
    firebird/trunk/builds/mac_os_x/CS/stub.c
    firebird/trunk/builds/make.new/config/install-sh
    firebird/trunk/builds/old_prefixes/README.txt
    firebird/trunk/builds/old_prefixes/prefix.aix
    firebird/trunk/builds/old_prefixes/prefix.aix_ppc
    firebird/trunk/builds/old_prefixes/prefix.darwin
    firebird/trunk/builds/old_prefixes/prefix.freebsd
    firebird/trunk/builds/old_prefixes/prefix.hp10
    firebird/trunk/builds/old_prefixes/prefix.hp9.0
    firebird/trunk/builds/old_prefixes/prefix.linux
    firebird/trunk/builds/old_prefixes/prefix.mu
    firebird/trunk/builds/old_prefixes/prefix.ncr3000
    firebird/trunk/builds/old_prefixes/prefix.netbsd
    firebird/trunk/builds/old_prefixes/prefix.sco
    firebird/trunk/builds/old_prefixes/prefix.sco_ev
    firebird/trunk/builds/old_prefixes/prefix.solaris
    firebird/trunk/builds/old_prefixes/prefix.solaris_mt
    firebird/trunk/builds/old_prefixes/prefix.solx86
    firebird/trunk/builds/old_prefixes/prefix.sun4
    firebird/trunk/builds/old_prefixes/prefix.sun4_acc
    firebird/trunk/builds/old_prefixes/prefix.win_nt
    firebird/trunk/builds/old_prefixes/prefix.win_nts
    firebird/trunk/builds/posix/Makefile.in.boot.gpre
    firebird/trunk/builds/posix/Makefile.in.client.fbudf
    firebird/trunk/builds/posix/Makefile.in.client.gbak
    firebird/trunk/builds/posix/Makefile.in.client.gfix
    firebird/trunk/builds/posix/Makefile.in.client.gpre
    firebird/trunk/builds/posix/Makefile.in.client.gsec
    firebird/trunk/builds/posix/Makefile.in.client.isql
    firebird/trunk/builds/posix/Makefile.in.client.qli
    firebird/trunk/builds/posix/Makefile.in.client.util
    firebird/trunk/builds/posix/Makefile.in.codes
    firebird/trunk/builds/posix/Makefile.in.embed.fbudf
    firebird/trunk/builds/posix/Makefile.in.embed.gbak
    firebird/trunk/builds/posix/Makefile.in.embed.gfix
    firebird/trunk/builds/posix/Makefile.in.embed.gpre
    firebird/trunk/builds/posix/Makefile.in.embed.isql
    firebird/trunk/builds/posix/Makefile.in.embed.qli
    firebird/trunk/builds/posix/Makefile.in.embed.util
    firebird/trunk/builds/posix/Makefile.in.examples
    firebird/trunk/builds/posix/Makefile.in.extern.editline
    firebird/trunk/builds/posix/Makefile.in.extern.icu
    firebird/trunk/builds/posix/Makefile.in.extlib
    firebird/trunk/builds/posix/Makefile.in.fbserver
    firebird/trunk/builds/posix/Makefile.in.fbtrace
    firebird/trunk/builds/posix/Makefile.in.firebird
    firebird/trunk/builds/posix/Makefile.in.intl
    firebird/trunk/builds/posix/Makefile.in.libfbclient
    firebird/trunk/builds/posix/Makefile.in.libfbembed
    firebird/trunk/builds/posix/Makefile.in.libfbstatic
    firebird/trunk/builds/posix/Makefile.in.msgs
    firebird/trunk/builds/posix/Makefile.in.plugins
    firebird/trunk/builds/posix/Makefile.in.plugins_examples
    firebird/trunk/builds/posix/Makefile.in.refDatabases
    firebird/trunk/builds/posix/Makefile.in.smp_server
    firebird/trunk/builds/posix/Makefile.in.static.gbak
    firebird/trunk/builds/posix/Makefile.in.static.gpre
    firebird/trunk/builds/posix/Makefile.in.static.isql
    firebird/trunk/builds/posix/darwin.defaults
    firebird/trunk/builds/posix/empty.vers
    firebird/trunk/builds/posix/fbintl.vers
    firebird/trunk/builds/posix/fbtrace.vers
    firebird/trunk/builds/posix/firebird.vers
    firebird/trunk/builds/posix/ib_util.vers
    firebird/trunk/builds/posix/make.defaults
    firebird/trunk/builds/posix/make.platform.solaris.examples
    firebird/trunk/builds/posix/make.rules
    firebird/trunk/builds/posix/make.shared.targets
    firebird/trunk/builds/posix/make.shared.variables
    firebird/trunk/builds/posix/postfix.darwin
    firebird/trunk/builds/posix/prefix.aix_powerpc
    firebird/trunk/builds/posix/prefix.aix_powerpc_xlc
    firebird/trunk/builds/posix/prefix.darwin_i386
    firebird/trunk/builds/posix/prefix.darwin_powerpc
    firebird/trunk/builds/posix/prefix.darwin_ppc64
    firebird/trunk/builds/posix/prefix.darwin_x86_64
    firebird/trunk/builds/posix/prefix.example
    firebird/trunk/builds/posix/prefix.freebsd
    firebird/trunk/builds/posix/prefix.freebsd_amd64
    firebird/trunk/builds/posix/prefix.hpux
    firebird/trunk/builds/posix/prefix.hpux_aCC
    firebird/trunk/builds/posix/prefix.hpux_ia64
    firebird/trunk/builds/posix/prefix.linux
    firebird/trunk/builds/posix/prefix.linux_amd64
    firebird/trunk/builds/posix/prefix.linux_arm
    firebird/trunk/builds/posix/prefix.linux_generic
    firebird/trunk/builds/posix/prefix.linux_ia64
    firebird/trunk/builds/posix/prefix.linux_mips
    firebird/trunk/builds/posix/prefix.linux_mipsel
    firebird/trunk/builds/posix/prefix.linux_powerpc
    firebird/trunk/builds/posix/prefix.linux_s390x
    firebird/trunk/builds/posix/prefix.linux_sparc32
    firebird/trunk/builds/posix/prefix.mingw
    firebird/trunk/builds/posix/prefix.netbsd
    firebird/trunk/builds/posix/prefix.solaris
    firebird/trunk/builds/posix/prefix.solaris-64gcc
    firebird/trunk/builds/posix/prefix.solx86
    firebird/trunk/builds/posix/prefix.solx86gcc
    firebird/trunk/builds/posix/prefix.solx86gcc_64
    firebird/trunk/builds/posix/udr_engine.hpux.vers
    firebird/trunk/builds/posix/udr_engine.vers
    firebird/trunk/builds/posix/vers.sh.in
    firebird/trunk/builds/win32/adjust_vc7_files.cmd
    firebird/trunk/builds/win32/blrtable.bat
    firebird/trunk/builds/win32/clean_all.bat
    firebird/trunk/builds/win32/compile.bat
    firebird/trunk/builds/win32/create_msgs.bat
    firebird/trunk/builds/win32/defs/build.def
    firebird/trunk/builds/win32/defs/burp.def
    firebird/trunk/builds/win32/defs/burp32.def
    firebird/trunk/builds/win32/defs/dsql.def
    firebird/trunk/builds/win32/defs/fbclient.def
    firebird/trunk/builds/win32/defs/fbclient_s.def
    firebird/trunk/builds/win32/defs/fbrmclib.def
    firebird/trunk/builds/win32/defs/gds32.def
    firebird/trunk/builds/win32/defs/ib_udf.def
    firebird/trunk/builds/win32/defs/ib_util.def
    firebird/trunk/builds/win32/defs/intl.def
    firebird/trunk/builds/win32/defs/isql.def
    firebird/trunk/builds/win32/defs/iutls.def
    firebird/trunk/builds/win32/defs/jrd.def
    firebird/trunk/builds/win32/defs/remote.def
    firebird/trunk/builds/win32/defs/udr_engine.def
    firebird/trunk/builds/win32/defs/utls.def
    firebird/trunk/builds/win32/make_all.bat
    firebird/trunk/builds/win32/make_boot.bat
    firebird/trunk/builds/win32/make_examples.bat
    firebird/trunk/builds/win32/make_icu.bat
    firebird/trunk/builds/win32/msvc7/Firebird2.sln
    firebird/trunk/builds/win32/msvc7/Firebird2Boot.sln
    firebird/trunk/builds/win32/msvc7/Firebird2_Examples.sln
    firebird/trunk/builds/win32/msvc7/alice.vcproj
    firebird/trunk/builds/win32/msvc7/btyacc.vcproj
    firebird/trunk/builds/win32/msvc7/build_msg.vcproj
    firebird/trunk/builds/win32/msvc7/burp.vcproj
    firebird/trunk/builds/win32/msvc7/codes.vcproj
    firebird/trunk/builds/win32/msvc7/common.vcproj
    firebird/trunk/builds/win32/msvc7/common_classic.vcproj
    firebird/trunk/builds/win32/msvc7/common_static.vcproj
    firebird/trunk/builds/win32/msvc7/config.vcproj
    firebird/trunk/builds/win32/msvc7/dsql_server.vcproj
    firebird/trunk/builds/win32/msvc7/dsql_server_classic.vcproj
    firebird/trunk/builds/win32/msvc7/empbuild.vcproj
    firebird/trunk/builds/win32/msvc7/engine.vcproj
    firebird/trunk/builds/win32/msvc7/engine_classic.vcproj
    firebird/trunk/builds/win32/msvc7/engine_embed.vcproj
    firebird/trunk/builds/win32/msvc7/fb2control.vcproj
    firebird/trunk/builds/win32/msvc7/fb_inet_server.vcproj
    firebird/trunk/builds/win32/msvc7/fb_lock_print.vcproj
    firebird/trunk/builds/win32/msvc7/fbclient.vcproj
    firebird/trunk/builds/win32/msvc7/fbclient_static.vcproj
    firebird/trunk/builds/win32/msvc7/fbembed.vcproj
    firebird/trunk/builds/win32/msvc7/fbguard.vcproj
    firebird/trunk/builds/win32/msvc7/fbrmclib.vcproj
    firebird/trunk/builds/win32/msvc7/fbserver.vcproj
    firebird/trunk/builds/win32/msvc7/fbsvcmgr.vcproj
    firebird/trunk/builds/win32/msvc7/fbtrace.vcproj
    firebird/trunk/builds/win32/msvc7/fbtracemgr.vcproj
    firebird/trunk/builds/win32/msvc7/fbudf.vcproj
    firebird/trunk/builds/win32/msvc7/gbak.vcproj
    firebird/trunk/builds/win32/msvc7/gbak_embed.vcproj
    firebird/trunk/builds/win32/msvc7/gds32.vcproj
    firebird/trunk/builds/win32/msvc7/gfix.vcproj
    firebird/trunk/builds/win32/msvc7/gpre.vcproj
    firebird/trunk/builds/win32/msvc7/gpre_boot.vcproj
    firebird/trunk/builds/win32/msvc7/gpre_embed.vcproj
    firebird/trunk/builds/win32/msvc7/gpre_static.vcproj
    firebird/trunk/builds/win32/msvc7/gsec.vcproj
    firebird/trunk/builds/win32/msvc7/gsplit.vcproj
    firebird/trunk/builds/win32/msvc7/gstat.vcproj
    firebird/trunk/builds/win32/msvc7/ib_udf.vcproj
    firebird/trunk/builds/win32/msvc7/ib_util.vcproj
    firebird/trunk/builds/win32/msvc7/instclient.vcproj
    firebird/trunk/builds/win32/msvc7/instreg.vcproj
    firebird/trunk/builds/win32/msvc7/instsvc.vcproj
    firebird/trunk/builds/win32/msvc7/intl.vcproj
    firebird/trunk/builds/win32/msvc7/intlbuild.vcproj
    firebird/trunk/builds/win32/msvc7/isql.vcproj
    firebird/trunk/builds/win32/msvc7/isql_embed.vcproj
    firebird/trunk/builds/win32/msvc7/lock.vcproj
    firebird/trunk/builds/win32/msvc7/lock_classic.vcproj
    firebird/trunk/builds/win32/msvc7/nbackup.vcproj
    firebird/trunk/builds/win32/msvc7/qli.vcproj
    firebird/trunk/builds/win32/msvc7/remote.vcproj
    firebird/trunk/builds/win32/msvc7/remote_classic.vcproj
    firebird/trunk/builds/win32/msvc7/utilities.vcproj
    firebird/trunk/builds/win32/msvc7/utilities_embed.vcproj
    firebird/trunk/builds/win32/msvc7/v5_examples.vcproj
    firebird/trunk/builds/win32/msvc8/DllNoEmbedManifest.vsprops
    firebird/trunk/builds/win32/msvc8/Firebird2.sln
    firebird/trunk/builds/win32/msvc8/Firebird2Boot.sln
    firebird/trunk/builds/win32/msvc8/Firebird2_Examples.sln
    firebird/trunk/builds/win32/msvc8/VCCRT_Shared_Body.wxi
    firebird/trunk/builds/win32/msvc8/VCCRT_Shared_Header.wxi
    firebird/trunk/builds/win32/msvc8/VCCRT_Win32.wxi
    firebird/trunk/builds/win32/msvc8/VCCRT_Win32.wxs
    firebird/trunk/builds/win32/msvc8/VCCRT_x64.wxi
    firebird/trunk/builds/win32/msvc8/VCCRT_x64.wxs
    firebird/trunk/builds/win32/msvc8/alice.vcproj
    firebird/trunk/builds/win32/msvc8/asInvoker.manifest
    firebird/trunk/builds/win32/msvc8/asInvokerManifest.vsprops
    firebird/trunk/builds/win32/msvc8/btyacc.vcproj
    firebird/trunk/builds/win32/msvc8/build_msg.vcproj
    firebird/trunk/builds/win32/msvc8/burp.vcproj
    firebird/trunk/builds/win32/msvc8/codes.vcproj
    firebird/trunk/builds/win32/msvc8/common.vcproj
    firebird/trunk/builds/win32/msvc8/common_classic.vcproj
    firebird/trunk/builds/win32/msvc8/common_static.vcproj
    firebird/trunk/builds/win32/msvc8/config.vcproj
    firebird/trunk/builds/win32/msvc8/dsql_server.vcproj
    firebird/trunk/builds/win32/msvc8/dsql_server_classic.vcproj
    firebird/trunk/builds/win32/msvc8/empbuild.vcproj
    firebird/trunk/builds/win32/msvc8/engine.vcproj
    firebird/trunk/builds/win32/msvc8/engine_classic.vcproj
    firebird/trunk/builds/win32/msvc8/engine_embed.vcproj
    firebird/trunk/builds/win32/msvc8/fb2control.vcproj
    firebird/trunk/builds/win32/msvc8/fb_inet_server.vcproj
    firebird/trunk/builds/win32/msvc8/fb_lock_print.vcproj
    firebird/trunk/builds/win32/msvc8/fbclient.vcproj
    firebird/trunk/builds/win32/msvc8/fbclient_static.vcproj
    firebird/trunk/builds/win32/msvc8/fbembed.vcproj
    firebird/trunk/builds/win32/msvc8/fbguard.vcproj
    firebird/trunk/builds/win32/msvc8/fbrmclib.vcproj
    firebird/trunk/builds/win32/msvc8/fbserver.vcproj
    firebird/trunk/builds/win32/msvc8/fbsvcmgr.vcproj
    firebird/trunk/builds/win32/msvc8/fbtrace.vcproj
    firebird/trunk/builds/win32/msvc8/fbtracemgr.vcproj
    firebird/trunk/builds/win32/msvc8/fbudf.vcproj
    firebird/trunk/builds/win32/msvc8/firebird2.vsprops
    firebird/trunk/builds/win32/msvc8/firebird2debug.vsprops
    firebird/trunk/builds/win32/msvc8/firebird2release.vsprops
    firebird/trunk/builds/win32/msvc8/gbak.vcproj
    firebird/trunk/builds/win32/msvc8/gbak_embed.vcproj
    firebird/trunk/builds/win32/msvc8/gds32.vcproj
    firebird/trunk/builds/win32/msvc8/gfix.vcproj
    firebird/trunk/builds/win32/msvc8/gpre.vcproj
    firebird/trunk/builds/win32/msvc8/gpre_boot.vcproj
    firebird/trunk/builds/win32/msvc8/gpre_embed.vcproj
    firebird/trunk/builds/win32/msvc8/gpre_static.vcproj
    firebird/trunk/builds/win32/msvc8/gsec.vcproj
    firebird/trunk/builds/win32/msvc8/gsplit.vcproj
    firebird/trunk/builds/win32/msvc8/gstat.vcproj
    firebird/trunk/builds/win32/msvc8/ib_udf.vcproj
    firebird/trunk/builds/win32/msvc8/ib_util.vcproj
    firebird/trunk/builds/win32/msvc8/instclient.vcproj
    firebird/trunk/builds/win32/msvc8/instreg.vcproj
    firebird/trunk/builds/win32/msvc8/instsvc.vcproj
    firebird/trunk/builds/win32/msvc8/intl.vcproj
    firebird/trunk/builds/win32/msvc8/intlbuild.vcproj
    firebird/trunk/builds/win32/msvc8/isql.vcproj
    firebird/trunk/builds/win32/msvc8/isql_embed.vcproj
    firebird/trunk/builds/win32/msvc8/lock.vcproj
    firebird/trunk/builds/win32/msvc8/lock_classic.vcproj
    firebird/trunk/builds/win32/msvc8/nbackup.vcproj
    firebird/trunk/builds/win32/msvc8/qli.vcproj
    firebird/trunk/builds/win32/msvc8/remote.vcproj
    firebird/trunk/builds/win32/msvc8/remote_classic.vcproj
    firebird/trunk/builds/win32/msvc8/requireAdministrator.manifest
    firebird/trunk/builds/win32/msvc8/requireAdministratorManifest.vsprops
    firebird/trunk/builds/win32/msvc8/udr_engine.vcproj
    firebird/trunk/builds/win32/msvc8/udrcpp_example.vcproj
    firebird/trunk/builds/win32/msvc8/utilities.vcproj
    firebird/trunk/builds/win32/msvc8/utilities_embed.vcproj
    firebird/trunk/builds/win32/msvc8/v5_examples.vcproj
    firebird/trunk/builds/win32/msvc9/DllNoEmbedManifest.vsprops
    firebird/trunk/builds/win32/msvc9/Firebird2.sln
    firebird/trunk/builds/win32/msvc9/Firebird2Boot.sln
    firebird/trunk/builds/win32/msvc9/Firebird2_Examples.sln
    firebird/trunk/builds/win32/msvc9/alice.vcproj
    firebird/trunk/builds/win32/msvc9/btyacc.vcproj
    firebird/trunk/builds/win32/msvc9/build_msg.vcproj
    firebird/trunk/builds/win32/msvc9/burp.vcproj
    firebird/trunk/builds/win32/msvc9/codes.vcproj
    firebird/trunk/builds/win32/msvc9/common.vcproj
    firebird/trunk/builds/win32/msvc9/common_classic.vcproj
    firebird/trunk/builds/win32/msvc9/common_static.vcproj
    firebird/trunk/builds/win32/msvc9/config.vcproj
    firebird/trunk/builds/win32/msvc9/dsql_server.vcproj
    firebird/trunk/builds/win32/msvc9/dsql_server_classic.vcproj
    firebird/trunk/builds/win32/msvc9/empbuild.vcproj
    firebird/trunk/builds/win32/msvc9/engine.vcproj
    firebird/trunk/builds/win32/msvc9/engine_classic.vcproj
    firebird/trunk/builds/win32/msvc9/engine_embed.vcproj
    firebird/trunk/builds/win32/msvc9/fb2control.vcproj
    firebird/trunk/builds/win32/msvc9/fb_inet_server.vcproj
    firebird/trunk/builds/win32/msvc9/fb_lock_print.vcproj
    firebird/trunk/builds/win32/msvc9/fbclient.vcproj
    firebird/trunk/builds/win32/msvc9/fbembed.vcproj
    firebird/trunk/builds/win32/msvc9/fbguard.vcproj
    firebird/trunk/builds/win32/msvc9/fbrmclib.vcproj
    firebird/trunk/builds/win32/msvc9/fbserver.vcproj
    firebird/trunk/builds/win32/msvc9/fbsvcmgr.vcproj
    firebird/trunk/builds/win32/msvc9/fbtrace.vcproj
    firebird/trunk/builds/win32/msvc9/fbtracemgr.vcproj
    firebird/trunk/builds/win32/msvc9/fbudf.vcproj
    firebird/trunk/builds/win32/msvc9/firebird2.vsprops
    firebird/trunk/builds/win32/msvc9/firebird2debug.vsprops
    firebird/trunk/builds/win32/msvc9/firebird2release.vsprops
    firebird/trunk/builds/win32/msvc9/gbak.vcproj
    firebird/trunk/builds/win32/msvc9/gbak_embed.vcproj
    firebird/trunk/builds/win32/msvc9/gfix.vcproj
    firebird/trunk/builds/win32/msvc9/gpre.vcproj
    firebird/trunk/bu...
 
[truncated message content] | 
| 
      
      
      From: <pau...@us...> - 2010-06-08 14:44:51
       | 
| Revision: 51232
          http://firebird.svn.sourceforge.net/firebird/?rev=51232&view=rev
Author:   paulbeach
Date:     2010-06-08 14:44:45 +0000 (Tue, 08 Jun 2010)
Log Message:
-----------
Grand Central Dispatch - 10.6 Darwin only
Modified Paths:
--------------
    firebird/trunk/builds/posix/postfix.darwin
    firebird/trunk/builds/posix/prefix.darwin_i386
    firebird/trunk/builds/posix/prefix.darwin_x86_64
    firebird/trunk/extern/icu/source/config/mh-darwin
Modified: firebird/trunk/builds/posix/postfix.darwin
===================================================================
--- firebird/trunk/builds/posix/postfix.darwin	2010-06-08 13:35:46 UTC (rev 51231)
+++ firebird/trunk/builds/posix/postfix.darwin	2010-06-08 14:44:45 UTC (rev 51232)
@@ -81,7 +81,6 @@
 	cp ../gen/firebird/bin/gpre $(FB_FW)/Resources/bin
 	cp ../gen/firebird/bin/qli $(FB_FW)/Resources/bin
 	cp ../gen/firebird/bin/fb_lock_print $(FB_FW)/Resources/bin
-	cp ../gen/firebird/bin/gds_drop $(FB_FW)/Resources/bin
 	cp ../gen/firebird/bin/gsec $(FB_FW)/Resources/bin
 	cp ../gen/firebird/bin/gstat $(FB_FW)/Resources/bin
 	cp ../gen/firebird/bin/nbackup $(FB_FW)/Resources/bin
@@ -146,7 +145,6 @@
 	cp ../gen/firebird/bin/isql $(FB_FW)/Resources/bin
 	cp ../gen/firebird/bin/gpre $(FB_FW)/Resources/bin
 	cp ../gen/firebird/bin/fb_lock_print $(FB_FW)/Resources/bin
-	#cp ../gen/firebird/bin/gds_drop $(FB_FW)/Resources/bin
 	#cp ../gen/firebird/bin/gds_relay $(FB_FW)/Resources/bin
 	cp ../gen/firebird/bin/gsec $(FB_FW)/Resources/bin
 	cp ../gen/firebird/bin/gstat $(FB_FW)/Resources/bin
Modified: firebird/trunk/builds/posix/prefix.darwin_i386
===================================================================
--- firebird/trunk/builds/posix/prefix.darwin_i386	2010-06-08 13:35:46 UTC (rev 51231)
+++ firebird/trunk/builds/posix/prefix.darwin_i386	2010-06-08 14:44:45 UTC (rev 51232)
@@ -22,27 +22,27 @@
 # 2. dnl the CPU_TYPE
 # 3. edit extern/icu/source/config and set the right 32bit flags (-arch i386)
 # 4. for  CFLAGS, CXXFLAGS. LDFLAGS export '-m32 -arch i386'
-# 5. export MACOSX_DEPLOYMENT_TARGET=10.4 
+# 5. export MACOSX_DEPLOYMENT_TARGET=10.6 
 
 DYLD_LIBRARY_PATH=$(FIREBIRD)/lib
 export DYLD_LIBRARY_PATH
 
-MACOSX_DEPLOYMENT_TARGET=10.4
+MACOSX_DEPLOYMENT_TARGET=10.6
 export MACOSX_DEPLOYMENT_TARGET
 
 OS_ServerFiles=inet_server.cpp
 
-PROD_FLAGS=-O3 -DDARWIN -pipe -p -MMD -fPIC -fno-common -arch i386 -mmacosx-version-min=10.4
-DEV_FLAGS=-ggdb -DDARWIN -pipe -p -MMD -fPIC -fno-common -Wall -arch i386 -mmacosx-version-min=10.4 -Wno-non-virtual-dtor
+PROD_FLAGS=-O3 -DDARWIN -pipe -p -MMD -fPIC -fno-common -arch i386 -mmacosx-version-min=10.6
+DEV_FLAGS=-ggdb -DDARWIN -pipe -p -MMD -fPIC -fno-common -Wall -arch i386 -mmacosx-version-min=10.6 -Wno-non-virtual-dtor
 CXXFLAGS:=$(CXXFLAGS) -fvisibility-inlines-hidden -fvisibility=hidden -fno-weak
-EMBED_UTIL_TARGETS=gstat gds_drop gds_relay gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
-CLIENT_UTIL_TARGETS=gds_drop gds_relay gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr \
+EMBED_UTIL_TARGETS=gstat gds_relay gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
+CLIENT_UTIL_TARGETS=gds_relay gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr \
 	fbtracemgr
 
 Physical_IO_Module=os/posix/unix.cpp
 PLATFORM_PATH=os/darwin
 
 LINK_OPTS:=-m32
-LD_FLAGS+=-m32 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
+LD_FLAGS+=-m32 -arch i386
 
 include $(ROOT)/gen/darwin.defaults
Modified: firebird/trunk/builds/posix/prefix.darwin_x86_64
===================================================================
--- firebird/trunk/builds/posix/prefix.darwin_x86_64	2010-06-08 13:35:46 UTC (rev 51231)
+++ firebird/trunk/builds/posix/prefix.darwin_x86_64	2010-06-08 14:44:45 UTC (rev 51232)
@@ -22,16 +22,16 @@
 DYLD_LIBRARY_PATH=$(FIREBIRD)/lib
 export DYLD_LIBRARY_PATH
 
-MACOSX_DEPLOYMENT_TARGET=10.5
+MACOSX_DEPLOYMENT_TARGET=10.6
 export MACOSX_DEPLOYMENT_TARGET
 
 OS_ServerFiles=inet_server.cpp
 
-PROD_FLAGS=-O3 -DDARWIN -pipe -p -MMD -fPIC -fno-common -mmacosx-version-min=10.5
-DEV_FLAGS=-ggdb -DDARWIN -pipe -p -MMD -fPIC -fno-common -Wall -mmacosx-version-min=10.5 -Wno-non-virtual-dtor
+PROD_FLAGS=-O3 -DDARWIN -pipe -p -MMD -fPIC -fno-common -mmacosx-version-min=10.6
+DEV_FLAGS=-ggdb -DDARWIN -pipe -p -MMD -fPIC -fno-common -Wall -mmacosx-version-min=10.6 -Wno-non-virtual-dtor
 CXXFLAGS:=$(CXXFLAGS) -fvisibility-inlines-hidden -fvisibility=hidden -fno-weak
-EMBED_UTIL_TARGETS=gstat gds_drop gds_relay gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
-CLIENT_UTIL_TARGETS=gds_drop gds_relay gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr \
+EMBED_UTIL_TARGETS=gstat gds_relay gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
+CLIENT_UTIL_TARGETS=gds_relay gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr \
 	fbtracemgr
 
 Physical_IO_Module=os/posix/unix.cpp
Modified: firebird/trunk/extern/icu/source/config/mh-darwin
===================================================================
--- firebird/trunk/extern/icu/source/config/mh-darwin	2010-06-08 13:35:46 UTC (rev 51231)
+++ firebird/trunk/extern/icu/source/config/mh-darwin	2010-06-08 14:44:45 UTC (rev 51232)
@@ -17,9 +17,9 @@
 # Set CFLAGS and CXXFLAGS for relevant MacOS architecture
 # and backwards compatibility. Set accordingly before building.
 
-# Default 64 bit Leopard/Snow Leopard - intel (MacOS 10.5+)
-CFLAGS += -arch x86_64 
-CXXFLAGS += -arch x86_64 
+# Default 64 bit Snow Leopard - intel (MacOS 10.6+)
+CFLAGS += -arch x86_64 -mmacosx-version-min=10.6
+CXXFLAGS += -arch x86_64 -mmacosx-version-min=10.6
 
 # 64 bit powerpc
 #CFLAGS += -arch ppc64  -mmacosx-version-min=10.5
@@ -27,8 +27,8 @@
 
 # 32bit intel default 
 # DARWIN flag added because of problem with putil.c
-#CFLAGS += -arch i386 -mmacosx-version-min=10.4 -DDARWIN
-#CXXFLAGS += -arch i386 -mmacosx-version-min=10.4
+#CFLAGS += -arch i386 -mmacosx-version-min=10.6 -DDARWIN
+#CXXFLAGS += -arch i386 -mmacosx-version-min=10.6
 
 # 32 bit powerpc
 #CFLAGS += -arch ppc -mmacosx-version-min=10.2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <asf...@us...> - 2010-06-17 01:18:47
       | 
| Revision: 51259
          http://firebird.svn.sourceforge.net/firebird/?rev=51259&view=rev
Author:   asfernandes
Date:     2010-06-17 01:18:40 +0000 (Thu, 17 Jun 2010)
Log Message:
-----------
Created class BlrWriter and reorganization (move BLR generation from statement to scratch)
Modified Paths:
--------------
    firebird/trunk/builds/posix/make.shared.variables
    firebird/trunk/builds/win32/msvc9/dsql_server.vcproj
    firebird/trunk/builds/win32/msvc9/dsql_server_classic.vcproj
    firebird/trunk/src/dsql/AggNodes.cpp
    firebird/trunk/src/dsql/DdlNodes.epp
    firebird/trunk/src/dsql/ExprNodes.cpp
    firebird/trunk/src/dsql/Nodes.h
    firebird/trunk/src/dsql/StmtNodes.cpp
    firebird/trunk/src/dsql/ddl.cpp
    firebird/trunk/src/dsql/dsql.cpp
    firebird/trunk/src/dsql/dsql.h
    firebird/trunk/src/dsql/gen.cpp
    firebird/trunk/src/dsql/gen_proto.h
    firebird/trunk/src/dsql/pass1.cpp
Added Paths:
-----------
    firebird/trunk/src/dsql/BlrWriter.cpp
    firebird/trunk/src/dsql/BlrWriter.h
Modified: firebird/trunk/builds/posix/make.shared.variables
===================================================================
--- firebird/trunk/builds/posix/make.shared.variables	2010-06-16 16:28:09 UTC (rev 51258)
+++ firebird/trunk/builds/posix/make.shared.variables	2010-06-17 01:18:40 UTC (rev 51259)
@@ -81,7 +81,7 @@
 DSQL_ServerFiles=	metd.epp DSqlDataTypeUtil.cpp \
                 ddl.cpp dsql.cpp errd.cpp gen.cpp hsh.cpp make.cpp \
 	            movd.cpp parse.cpp Parser.cpp pass1.cpp misc_func.cpp \
-	            DdlNodes.epp PackageNodes.epp AggNodes.cpp ExprNodes.cpp StmtNodes.cpp WinNodes.cpp
+	            DdlNodes.epp PackageNodes.epp AggNodes.cpp BlrWriter.cpp ExprNodes.cpp StmtNodes.cpp WinNodes.cpp
 
 
 DSQL_Files = $(DSQL_ClientFiles) $(DSQL_ServerFiles)
Modified: firebird/trunk/builds/win32/msvc9/dsql_server.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/dsql_server.vcproj	2010-06-16 16:28:09 UTC (rev 51258)
+++ firebird/trunk/builds/win32/msvc9/dsql_server.vcproj	2010-06-17 01:18:40 UTC (rev 51259)
@@ -271,6 +271,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\dsql\BlrWriter.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\dsql\ddl.cpp"
 				>
 			</File>
@@ -422,6 +426,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\dsql\BlrWriter.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\dsql\chars.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc9/dsql_server_classic.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/dsql_server_classic.vcproj	2010-06-16 16:28:09 UTC (rev 51258)
+++ firebird/trunk/builds/win32/msvc9/dsql_server_classic.vcproj	2010-06-17 01:18:40 UTC (rev 51259)
@@ -271,6 +271,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\dsql\BlrWriter.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\dsql\ddl.cpp"
 				>
 			</File>
@@ -422,6 +426,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\dsql\BlrWriter.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\dsql\chars.h"
 				>
 			</File>
Modified: firebird/trunk/src/dsql/AggNodes.cpp
===================================================================
--- firebird/trunk/src/dsql/AggNodes.cpp	2010-06-16 16:28:09 UTC (rev 51258)
+++ firebird/trunk/src/dsql/AggNodes.cpp	2010-06-17 01:18:40 UTC (rev 51259)
@@ -277,11 +277,11 @@
 	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
 
 	if (aggInfo.blr)	// Is this a standard aggregate function?
-		stuff(statement, (distinct ? aggInfo.distinctBlr : aggInfo.blr));
+		dsqlScratch->appendUChar((distinct ? aggInfo.distinctBlr : aggInfo.blr));
 	else	// This is a new window function.
 	{
-		stuff(statement, blr_agg_function);
-		stuff_cstring(statement, aggInfo.name);
+		dsqlScratch->appendUChar(blr_agg_function);
+		dsqlScratch->appendNullString(aggInfo.name);
 
 		unsigned count = 0;
 		for (dsql_nod*** i = dsqlChildNodes.begin(); i != dsqlChildNodes.end(); ++i)
@@ -290,7 +290,7 @@
 				++count;
 		}
 
-		stuff(statement, UCHAR(count));
+		dsqlScratch->appendUChar(UCHAR(count));
 	}
 
 	for (dsql_nod*** i = dsqlChildNodes.begin(); i != dsqlChildNodes.end(); ++i)
@@ -795,7 +795,7 @@
 	if (dsqlArg)
 		AggNode::genBlr();
 	else
-		dsqlScratch->getStatement()->append_uchar(blr_agg_count);
+		dsqlScratch->appendUChar(blr_agg_count);
 }
 
 void CountAggNode::getDesc(thread_db* tdbb, CompilerScratch* /*csb*/, dsc* desc)
Added: firebird/trunk/src/dsql/BlrWriter.cpp
===================================================================
--- firebird/trunk/src/dsql/BlrWriter.cpp	                        (rev 0)
+++ firebird/trunk/src/dsql/BlrWriter.cpp	2010-06-17 01:18:40 UTC (rev 51259)
@@ -0,0 +1,207 @@
+/*
+ * The contents of this file are subject to the Interbase Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy
+ * of the License at http://www.Inprise.com/IPL.html
+ *
+ * Software distributed under the License is distributed on an
+ * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * The Original Code was created by Inprise Corporation
+ * and its predecessors. Portions created by Inprise Corporation are
+ * Copyright (C) Inprise Corporation.
+ *
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ * Adriano dos Santos Fernandes - refactored from others modules.
+ */
+
+#include "firebird.h"
+#include "consts_pub.h"
+#include "dyn_consts.h"
+#include "gen/iberror.h"
+#include "../dsql/BlrWriter.h"
+#include "../jrd/common.h"
+#include "../jrd/blr.h"
+#include "../dsql/errd_proto.h"
+
+using namespace Firebird;
+
+namespace Jrd {
+
+
+// Write out a string valued attribute.
+void BlrWriter::appendString(UCHAR verb, const char* string, USHORT length)
+{
+	// TMN: Doesn't this look pretty awkward? If we are given
+	// a verb, the length is a ushort, else it's uchar.
+	if (verb)
+	{
+		appendUChar(verb);
+		appendUShort(length);
+	}
+	else
+	{
+		fb_assert(length <= MAX_UCHAR);
+		appendUChar(length);
+	}
+
+	if (string)
+		appendBytes(reinterpret_cast<const UCHAR*>(string), length);
+}
+
+// Input
+//   blr_ptr: current position of blr being generated
+//   verb: blr byte of which number is an argument
+//   number: value to be written to blr
+// Function
+//   Write out a numeric valued attribute.
+void BlrWriter::appendNumber(UCHAR verb, SSHORT number)
+{
+	if (verb)
+		appendUChar(verb);
+
+	appendUShortWithLength(number);
+}
+
+void BlrWriter::appendUShortWithLength(USHORT val)
+{
+	// append an USHORT value, prepended with the USHORT length of an USHORT
+	appendUShort(2);
+	appendUShort(val);
+}
+
+void BlrWriter::appendULongWithLength(ULONG val)
+{
+	// append an ULONG value, prepended with the USHORT length of an ULONG
+	appendUShort(4);
+	appendULong(val);
+}
+
+void BlrWriter::appendFileLength(ULONG length)
+{
+	appendUChar(isc_dyn_file_length);
+	appendULongWithLength(length);
+}
+
+void BlrWriter::appendFileStart(ULONG start)
+{
+	appendUChar(isc_dyn_file_start);
+	appendULongWithLength(start);
+}
+
+// Write out a string of blr as part of a ddl string, as in a view or computed field definition.
+void BlrWriter::beginBlr(UCHAR verb)
+{
+	if (verb)
+		appendUChar(verb);
+
+	baseOffset = blrData.getCount();
+
+	// put in a place marker for the size of the blr, since it is unknown
+	appendUShort(0);
+	appendUChar(isVersion4() ? blr_version4 : blr_version5);
+}
+
+// Complete the stuffing of a piece of blr by going back and inserting the length.
+void BlrWriter::endBlr()
+{
+	appendUChar(blr_eoc);
+
+	// go back and stuff in the proper length
+
+	UCHAR* blr_base = &blrData[baseOffset];
+	const ULONG length = (blrData.getCount() - baseOffset) - 2;
+
+	if (length > 0xFFFF)
+		ERRD_post(Arg::Gds(isc_too_big_blr) << Arg::Num(length) << Arg::Num(0xFFFF));
+
+	*blr_base++ = (UCHAR) length;
+	*blr_base = (UCHAR) (length >> 8);
+}
+
+void BlrWriter::beginDebug()
+{
+	fb_assert(debugData.isEmpty());
+
+	debugData.add(fb_dbg_version);
+	debugData.add(1);
+}
+
+void BlrWriter::endDebug()
+{
+	debugData.add(fb_dbg_end);
+}
+
+void BlrWriter::putDebugSrcInfo(USHORT line, USHORT col)
+{
+	debugData.add(fb_dbg_map_src2blr);
+
+	debugData.add(line);
+	debugData.add(line >> 8);
+
+	debugData.add(col);
+	debugData.add(col >> 8);
+
+	ULONG offset = (blrData.getCount() - baseOffset);
+
+	// for DDL statements we store BLR's length at the first 2 bytes
+	if (isDdlDyn())
+		offset -= 2;
+
+	debugData.add(offset);
+	debugData.add(offset >> 8);
+}
+
+void BlrWriter::putDebugVariable(USHORT number, const TEXT* name)
+{
+	fb_assert(name);
+
+	debugData.add(fb_dbg_map_varname);
+
+	debugData.add(number);
+	debugData.add(number >> 8);
+
+	USHORT len = strlen(name);
+	if (len > MAX_UCHAR)
+		len = MAX_UCHAR;
+	debugData.add(len);
+
+	debugData.add(reinterpret_cast<const UCHAR*>(name), len);
+}
+
+void BlrWriter::putDebugArgument(UCHAR type, USHORT number, const TEXT* name)
+{
+	fb_assert(name);
+
+	debugData.add(fb_dbg_map_argument);
+
+	debugData.add(type);
+	debugData.add(number);
+	debugData.add(number >> 8);
+
+	USHORT len = strlen(name);
+	if (len > MAX_UCHAR)
+		len = MAX_UCHAR;
+	debugData.add(len);
+
+	debugData.add(reinterpret_cast<const UCHAR*>(name), len);
+}
+
+void BlrWriter::appendDebugInfo()
+{
+	endDebug();
+
+	const size_t len = blrData.getCount() + debugData.getCount();
+	if (len + 4 < MAX_USHORT)
+	{
+		appendUChar(isc_dyn_debug_info);
+		appendUShort(debugData.getCount());
+		appendBytes(debugData.begin(), debugData.getCount());
+	}
+}
+
+
+}	// namespace Jrd
Property changes on: firebird/trunk/src/dsql/BlrWriter.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
Added: firebird/trunk/src/dsql/BlrWriter.h
===================================================================
--- firebird/trunk/src/dsql/BlrWriter.h	                        (rev 0)
+++ firebird/trunk/src/dsql/BlrWriter.h	2010-06-17 01:18:40 UTC (rev 51259)
@@ -0,0 +1,148 @@
+/*
+ * The contents of this file are subject to the Interbase Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy
+ * of the License at http://www.Inprise.com/IPL.html
+ *
+ * Software distributed under the License is distributed on an
+ * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * The Original Code was created by Inprise Corporation
+ * and its predecessors. Portions created by Inprise Corporation are
+ * Copyright (C) Inprise Corporation.
+ *
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ * Adriano dos Santos Fernandes - refactored from others modules.
+ */
+
+#ifndef DSQL_BLR_WRITER_H
+#define DSQL_BLR_WRITER_H
+
+#include "../jrd/common.h"
+#include "../common/classes/alloc.h"
+#include "../common/classes/array.h"
+#include "../common/classes/fb_string.h"
+#include "../common/classes/MetaName.h"
+
+namespace Jrd {
+
+class dsql_nod;
+
+
+// BLR/DYN writer.
+class BlrWriter : public Firebird::PermanentStorage
+{
+public:
+	explicit BlrWriter(MemoryPool& p)
+		: PermanentStorage(p),
+		  blrData(p),
+		  debugData(p),
+		  baseOffset(0)
+	{
+	}
+
+	void appendUChar(const UCHAR byte)
+	{
+		blrData.add(byte);
+	}
+
+	// Cram a word into the blr buffer.
+	void appendUShort(USHORT word)
+	{
+		appendUChar(word);
+		appendUChar(word >> 8);
+	}
+
+	void appendULong(ULONG val)
+	{
+		appendUShort(val);
+		appendUShort(val >> 16);
+	}
+
+	void appendUCharRepeated(UCHAR byte, int count)
+	{
+		for (int i = 0; i < count; ++i)
+			appendUChar(byte);
+	}
+
+	void appendBytes(const UCHAR* string, USHORT len)
+	{
+		blrData.add(string, len);
+	}
+
+	// Write out a string with one byte of length.
+	void appendNullString(const char* string)
+	{
+		size_t len = strlen(string);
+
+		// CVC: Maybe the Release version should truncate "len" to 255?
+		fb_assert(len >= 0 && len <= 255);
+
+		appendUChar(len);
+		appendBytes(reinterpret_cast<const UCHAR*>(string), len);
+	}
+
+	// Write out a string valued attribute.
+	void appendNullString(UCHAR verb, const char* string)
+	{
+		const USHORT length = string ? strlen(string) : 0;
+		appendString(verb, string, length);
+	}
+
+	// Write out a string in metadata charset with one byte of length.
+	void appendMetaString(const char* string)
+	{
+		appendString(0, string, strlen(string));
+	}
+
+	void appendString(UCHAR verb, const char* string, USHORT len);
+
+	void appendString(UCHAR verb, const Firebird::MetaName& name)
+	{
+		appendString(verb, name.c_str(), name.length());
+	}
+
+	void appendString(UCHAR verb, const Firebird::string& name)
+	{
+		appendString(verb, name.c_str(), name.length());
+	}
+
+	void appendNumber(UCHAR verb, SSHORT number);
+	void appendUShortWithLength(USHORT val);
+	void appendULongWithLength(ULONG val);
+	void appendFileLength(ULONG length);
+	void appendFileStart(ULONG start);
+
+	void beginBlr(UCHAR verb);
+	void endBlr();
+
+	void beginDebug();
+	void endDebug();
+	void putDebugSrcInfo(USHORT, USHORT);
+	void putDebugVariable(USHORT, const TEXT*);
+	void putDebugArgument(UCHAR, USHORT, const TEXT*);
+	void appendDebugInfo();
+
+	Firebird::HalfStaticArray<UCHAR, 1024>& getBlrData() { return blrData; }
+	Firebird::HalfStaticArray<UCHAR, 128>& getDebugData() { return debugData; }
+
+	ULONG getBaseOffset() const { return baseOffset; }
+	void setBaseOffset(ULONG value) { baseOffset = value; }
+
+protected:
+	virtual bool isVersion4() = 0;
+	virtual bool isDdlDyn() = 0;
+
+private:
+	Firebird::HalfStaticArray<UCHAR, 1024> blrData;
+	Firebird::HalfStaticArray<UCHAR, 128> debugData;
+	ULONG baseOffset;					// place to go back and stuff in blr length
+};
+
+
+} // namespace
+
+#endif // DSQL_BLR_WRITER_H
Property changes on: firebird/trunk/src/dsql/BlrWriter.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
Modified: firebird/trunk/src/dsql/DdlNodes.epp
===================================================================
--- firebird/trunk/src/dsql/DdlNodes.epp	2010-06-16 16:28:09 UTC (rev 51258)
+++ firebird/trunk/src/dsql/DdlNodes.epp	2010-06-17 01:18:40 UTC (rev 51259)
@@ -132,7 +132,7 @@
 	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
 
 	if (type.notNull)
-		statement->append_uchar(blr_not_nullable);
+		dsqlScratch->appendUChar(blr_not_nullable);
 
 	if (type.typeOfName.hasData())
 	{
@@ -140,34 +140,34 @@
 		{
 			if (type.collateSpecified)
 			{
-				statement->append_uchar(blr_column_name2);
-				statement->append_uchar(type.fullDomain ? blr_domain_full : blr_domain_type_of);
-				statement->append_meta_string(type.typeOfTable.c_str());
-				statement->append_meta_string(type.typeOfName.c_str());
-				statement->append_ushort(type.textType);
+				dsqlScratch->appendUChar(blr_column_name2);
+				dsqlScratch->appendUChar(type.fullDomain ? blr_domain_full : blr_domain_type_of);
+				dsqlScratch->appendMetaString(type.typeOfTable.c_str());
+				dsqlScratch->appendMetaString(type.typeOfName.c_str());
+				dsqlScratch->appendUShort(type.textType);
 			}
 			else
 			{
-				statement->append_uchar(blr_column_name);
-				statement->append_uchar(type.fullDomain ? blr_domain_full : blr_domain_type_of);
-				statement->append_meta_string(type.typeOfTable.c_str());
-				statement->append_meta_string(type.typeOfName.c_str());
+				dsqlScratch->appendUChar(blr_column_name);
+				dsqlScratch->appendUChar(type.fullDomain ? blr_domain_full : blr_domain_type_of);
+				dsqlScratch->appendMetaString(type.typeOfTable.c_str());
+				dsqlScratch->appendMetaString(type.typeOfName.c_str());
 			}
 		}
 		else
 		{
 			if (type.collateSpecified)
 			{
-				statement->append_uchar(blr_domain_name2);
-				statement->append_uchar(type.fullDomain ? blr_domain_full : blr_domain_type_of);
-				statement->append_meta_string(type.typeOfName.c_str());
-				statement->append_ushort(type.textType);
+				dsqlScratch->appendUChar(blr_domain_name2);
+				dsqlScratch->appendUChar(type.fullDomain ? blr_domain_full : blr_domain_type_of);
+				dsqlScratch->appendMetaString(type.typeOfName.c_str());
+				dsqlScratch->appendUShort(type.textType);
 			}
 			else
 			{
-				statement->append_uchar(blr_domain_name);
-				statement->append_uchar(type.fullDomain ? blr_domain_full : blr_domain_type_of);
-				statement->append_meta_string(type.typeOfName.c_str());
+				dsqlScratch->appendUChar(blr_domain_name);
+				dsqlScratch->appendUChar(type.fullDomain ? blr_domain_full : blr_domain_type_of);
+				dsqlScratch->appendMetaString(type.typeOfName.c_str());
 			}
 		}
 
@@ -181,39 +181,39 @@
 		case dtype_varying:
 		case dtype_blob:
 			if (!useSubType)
-				statement->append_uchar(blr_dtypes[type.type]);
+				dsqlScratch->appendUChar(blr_dtypes[type.type]);
 			else if (type.type == dtype_varying)
 			{
-				statement->append_uchar(blr_varying2);
-				statement->append_ushort(type.textType);
+				dsqlScratch->appendUChar(blr_varying2);
+				dsqlScratch->appendUShort(type.textType);
 			}
 			else if (type.type == dtype_cstring)
 			{
-				statement->append_uchar(blr_cstring2);
-				statement->append_ushort(type.textType);
+				dsqlScratch->appendUChar(blr_cstring2);
+				dsqlScratch->appendUShort(type.textType);
 			}
 			else if (type.type == dtype_blob)
 			{
-				statement->append_uchar(blr_blob2);
-				statement->append_ushort(type.subType);
-				statement->append_ushort(type.textType);
+				dsqlScratch->appendUChar(blr_blob2);
+				dsqlScratch->appendUShort(type.subType);
+				dsqlScratch->appendUShort(type.textType);
 			}
 			else
 			{
-				statement->append_uchar(blr_text2);
-				statement->append_ushort(type.textType);
+				dsqlScratch->appendUChar(blr_text2);
+				dsqlScratch->appendUShort(type.textType);
 			}
 
 			if (type.type == dtype_varying)
-				statement->append_ushort(type.length - sizeof(USHORT));
+				dsqlScratch->appendUShort(type.length - sizeof(USHORT));
 			else if (type.type != dtype_blob)
-				statement->append_ushort(type.length);
+				dsqlScratch->appendUShort(type.length);
 			break;
 
 		default:
-			statement->append_uchar(blr_dtypes[type.type]);
+			dsqlScratch->appendUChar(blr_dtypes[type.type]);
 			if (DTYPE_IS_EXACT(type.type) || dtype_quad == type.type)
-				statement->append_uchar(type.scale);
+				dsqlScratch->appendUChar(type.scale);
 			break;
 	}
 }
@@ -959,13 +959,13 @@
 				{
 					FUN.RDB$FUNCTION_BLR.NULL = FALSE;
 					attachment->storeBinaryBlob(tdbb, transaction, &FUN.RDB$FUNCTION_BLR,
-						statement->getBlrData().begin(),
-						statement->getBlrData().getCount());
+						dsqlScratch->getBlrData().begin(),
+						dsqlScratch->getBlrData().getCount());
 
 					FUN.RDB$DEBUG_INFO.NULL = FALSE;
 					attachment->storeBinaryBlob(tdbb, transaction, &FUN.RDB$DEBUG_INFO,
-						statement->getDebugData().begin(),
-						statement->getDebugData().getCount());
+						dsqlScratch->getDebugData().begin(),
+						dsqlScratch->getDebugData().getCount());
 				}
 			}
 
@@ -1110,20 +1110,20 @@
 			string defaultSource = string(defaultString->str_data, defaultString->str_length);
 			attachment->storeMetaDataBlob(tdbb, transaction, &ARG.RDB$DEFAULT_SOURCE, defaultSource);
 
-			statement->getBlrData().clear();
+			dsqlScratch->getBlrData().clear();
 
 			if (statement->getFlags() & DsqlCompiledStatement::FLAG_BLR_VERSION4)
-				statement->append_uchar(blr_version4);
+				dsqlScratch->appendUChar(blr_version4);
 			else
-				statement->append_uchar(blr_version5);
+				dsqlScratch->appendUChar(blr_version5);
 
 			GEN_expr(dsqlScratch, parameter.legacyDefault->nod_arg[e_dft_default]);
 
-			statement->append_uchar(blr_eoc);
+			dsqlScratch->appendUChar(blr_eoc);
 
 			attachment->storeBinaryBlob(tdbb, transaction, &ARG.RDB$DEFAULT_VALUE,
-				statement->getBlrData().begin(),
-				statement->getBlrData().getCount());
+				dsqlScratch->getBlrData().begin(),
+				dsqlScratch->getBlrData().getCount());
 		}
 	}
 	END_STORE
@@ -1145,49 +1145,49 @@
 
 	if (body)
 	{
-		statement->beginDebug();
-		statement->getBlrData().clear();
+		dsqlScratch->beginDebug();
+		dsqlScratch->getBlrData().clear();
 
 		if (statement->getFlags() & DsqlCompiledStatement::FLAG_BLR_VERSION4)
-			statement->append_uchar(blr_version4);
+			dsqlScratch->appendUChar(blr_version4);
 		else
-			statement->append_uchar(blr_version5);
+			dsqlScratch->appendUChar(blr_version5);
 
-		statement->append_uchar(blr_begin);
+		dsqlScratch->appendUChar(blr_begin);
 
 		if (parameters.getCount() != 0)
 		{
 			fb_assert(parameters.getCount() < size_t(MAX_USHORT / 2));
-			statement->append_uchar(blr_message);
-			statement->append_uchar(0);
-			statement->append_ushort(2 * parameters.getCount());
+			dsqlScratch->appendUChar(blr_message);
+			dsqlScratch->appendUChar(0);
+			dsqlScratch->appendUShort(2 * parameters.getCount());
 
 			for (unsigned i = 0; i < parameters.getCount(); ++i)
 			{
 				ParameterClause& parameter = parameters[i];
-				statement->put_debug_argument(fb_dbg_arg_input, i,
+				dsqlScratch->putDebugArgument(fb_dbg_arg_input, i,
 					parameter.name.c_str());
 				putType(parameter, true);
 
 				// add slot for null flag (parameter2)
-				statement->append_uchar(blr_short);
-				statement->append_uchar(0);
+				dsqlScratch->appendUChar(blr_short);
+				dsqlScratch->appendUChar(0);
 
 				variables.add(MAKE_variable(parameter.legacyField,
 					parameter.name.c_str(), VAR_input, 0, (USHORT) (2 * i), 0));
 			}
 		}
 
-		statement->append_uchar(blr_message);
-		statement->append_uchar(1);
-		statement->append_ushort(2);
+		dsqlScratch->appendUChar(blr_message);
+		dsqlScratch->appendUChar(1);
+		dsqlScratch->appendUShort(2);
 
-		statement->put_debug_argument(fb_dbg_arg_output, 0, "");
+		dsqlScratch->putDebugArgument(fb_dbg_arg_output, 0, "");
 		putType(returnType, true);
 
 		// add slot for null flag (parameter2)
-		statement->append_uchar(blr_short);
-		statement->append_uchar(0);
+		dsqlScratch->appendUChar(blr_short);
+		dsqlScratch->appendUChar(0);
 
 		dsql_nod* const var = MAKE_variable(returnType.legacyField, "", VAR_output, 1, 0, 0);
 		variables.add(var);
@@ -1195,11 +1195,11 @@
 
 		if (parameters.getCount() != 0)
 		{
-			statement->append_uchar(blr_receive);
-			statement->append_uchar(0);
+			dsqlScratch->appendUChar(blr_receive);
+			dsqlScratch->appendUChar(0);
 		}
 
-		statement->append_uchar(blr_begin);
+		dsqlScratch->appendUChar(blr_begin);
 
 		for (unsigned i = 0; i < parameters.getCount(); ++i)
 		{
@@ -1209,12 +1209,12 @@
 			{
 				// ASF: To validate input parameters we need only to read its value.
 				// Assigning it to null is an easy way to do this.
-				statement->append_uchar(blr_assignment);
-				statement->append_uchar(blr_parameter2);
-				statement->append_uchar(0);	// input
-				statement->append_ushort(i * 2);
-				statement->append_ushort(i * 2 + 1);
-				statement->append_uchar(blr_null);
+				dsqlScratch->appendUChar(blr_assignment);
+				dsqlScratch->appendUChar(blr_parameter2);
+				dsqlScratch->appendUChar(0);	// input
+				dsqlScratch->appendUShort(i * 2);
+				dsqlScratch->appendUShort(i * 2 + 1);
+				dsqlScratch->appendUChar(blr_null);
 			}
 		}
 
@@ -1227,24 +1227,24 @@
 
 		putLocalVariables(dsqlScratch, localDeclList, 1);
 
-		statement->append_uchar(blr_stall);
+		dsqlScratch->appendUChar(blr_stall);
 		// put a label before body of procedure,
 		// so that any EXIT statement can get out
-		statement->append_uchar(blr_label);
-		statement->append_uchar(0);
+		dsqlScratch->appendUChar(blr_label);
+		dsqlScratch->appendUChar(0);
 		dsqlScratch->loopLevel = 0;
 		dsqlScratch->cursorNumber = 0;
 
 		GEN_statement(dsqlScratch, PASS1_statement(dsqlScratch, body));
 
 		statement->setType(DsqlCompiledStatement::TYPE_DDL);
-		statement->append_uchar(blr_end);
-		genReturn(statement, false);
+		dsqlScratch->appendUChar(blr_end);
+		genReturn(dsqlScratch, false);
 
-		statement->append_uchar(blr_end);
-		statement->append_uchar(blr_eoc);
+		dsqlScratch->appendUChar(blr_end);
+		dsqlScratch->appendUChar(blr_eoc);
 
-		statement->endDebug();
+		dsqlScratch->endDebug();
 	}
 
 	invalid = false;
@@ -1761,13 +1761,13 @@
 				{
 					P.RDB$PROCEDURE_BLR.NULL = FALSE;
 					attachment->storeBinaryBlob(tdbb, transaction, &P.RDB$PROCEDURE_BLR,
-						statement->getBlrData().begin(),
-						statement->getBlrData().getCount());
+						dsqlScratch->getBlrData().begin(),
+						dsqlScratch->getBlrData().getCount());
 
 					P.RDB$DEBUG_INFO.NULL = FALSE;
 					attachment->storeBinaryBlob(tdbb, transaction, &P.RDB$DEBUG_INFO,
-						statement->getDebugData().begin(),
-						statement->getDebugData().getCount());
+						dsqlScratch->getDebugData().begin(),
+						dsqlScratch->getDebugData().getCount());
 
 					P.RDB$PROCEDURE_TYPE.NULL = FALSE;
 					P.RDB$PROCEDURE_TYPE = (USHORT)
@@ -1914,20 +1914,20 @@
 
 			DsqlCompiledStatement* statement = dsqlScratch->getStatement();
 
-			statement->getBlrData().clear();
+			dsqlScratch->getBlrData().clear();
 
 			if (statement->getFlags() & DsqlCompiledStatement::FLAG_BLR_VERSION4)
-				statement->append_uchar(blr_version4);
+				dsqlScratch->appendUChar(blr_version4);
 			else
-				statement->append_uchar(blr_version5);
+				dsqlScratch->appendUChar(blr_version5);
 
 			GEN_expr(dsqlScratch, parameter.legacyDefault->nod_arg[e_dft_default]);
 
-			statement->append_uchar(blr_eoc);
+			dsqlScratch->appendUChar(blr_eoc);
 
 			attachment->storeBinaryBlob(tdbb, transaction, &PRM.RDB$DEFAULT_VALUE,
-				statement->getBlrData().begin(),
-				statement->getBlrData().getCount());
+				dsqlScratch->getBlrData().begin(),
+				dsqlScratch->getBlrData().getCount());
 		}
 	}
 	END_STORE
@@ -1951,32 +1951,32 @@
 
 	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
 
-	statement->beginDebug();
-	statement->getBlrData().clear();
+	dsqlScratch->beginDebug();
+	dsqlScratch->getBlrData().clear();
 
 	if (statement->getFlags() & DsqlCompiledStatement::FLAG_BLR_VERSION4)
-		statement->append_uchar(blr_version4);
+		dsqlScratch->appendUChar(blr_version4);
 	else
-		statement->append_uchar(blr_version5);
+		dsqlScratch->appendUChar(blr_version5);
 
-	statement->append_uchar(blr_begin);
+	dsqlScratch->appendUChar(blr_begin);
 
 	if (parameters.getCount() != 0)
 	{
 		fb_assert(parameters.getCount() < MAX_USHORT / 2);
-		statement->append_uchar(blr_message);
-		statement->append_uchar(0);
-		statement->append_ushort(2 * parameters.getCount());
+		dsqlScratch->appendUChar(blr_message);
+		dsqlScratch->appendUChar(0);
+		dsqlScratch->appendUShort(2 * parameters.getCount());
 
 		for (unsigned i = 0; i < parameters.getCount(); ++i)
 		{
 			ParameterClause& parameter = parameters[i];
-			statement->put_debug_argument(fb_dbg_arg_input, i, parameter.name.c_str());
+			dsqlScratch->putDebugArgument(fb_dbg_arg_input, i, parameter.name.c_str());
 			putType(parameter, true);
 
 			// add slot for null flag (parameter2)
-			statement->append_uchar(blr_short);
-			statement->append_uchar(0);
+			dsqlScratch->appendUChar(blr_short);
+			dsqlScratch->appendUChar(0);
 
 			variables.add(MAKE_variable(parameter.legacyField,
 				parameter.name.c_str(), VAR_input, 0, (USHORT) (2 * i), 0));
@@ -1984,21 +1984,21 @@
 	}
 
 	fb_assert(returns.getCount() < MAX_USHORT / 2);
-	statement->append_uchar(blr_message);
-	statement->append_uchar(1);
-	statement->append_ushort(2 * returns.getCount() + 1);
+	dsqlScratch->appendUChar(blr_message);
+	dsqlScratch->appendUChar(1);
+	dsqlScratch->appendUShort(2 * returns.getCount() + 1);
 
 	if (returns.getCount() != 0)
 	{
 		for (unsigned i = 0; i < returns.getCount(); ++i)
 		{
 			ParameterClause& parameter = returns[i];
-			statement->put_debug_argument(fb_dbg_arg_output, i, parameter.name.c_str());
+			dsqlScratch->putDebugArgument(fb_dbg_arg_output, i, parameter.name.c_str());
 			putType(parameter, true);
 
 			// add slot for null flag (parameter2)
-			statement->append_uchar(blr_short);
-			statement->append_uchar(0);
+			dsqlScratch->appendUChar(blr_short);
+			dsqlScratch->appendUChar(0);
 
 			dsql_nod* const var = MAKE_variable(parameter.legacyField,
 				parameter.name.c_str(), VAR_output, 1, (USHORT) (2 * i), i);
@@ -2009,16 +2009,16 @@
 	}
 
 	// add slot for EOS
-	statement->append_uchar(blr_short);
-	statement->append_uchar(0);
+	dsqlScratch->appendUChar(blr_short);
+	dsqlScratch->appendUChar(0);
 
 	if (parameters.getCount() != 0)
 	{
-		statement->append_uchar(blr_receive);
-		statement->append_uchar(0);
+		dsqlScratch->appendUChar(blr_receive);
+		dsqlScratch->appendUChar(0);
 	}
 
-	statement->append_uchar(blr_begin);
+	dsqlScratch->appendUChar(blr_begin);
 
 	for (unsigned i = 0; i < parameters.getCount(); ++i)
 	{
@@ -2028,12 +2028,12 @@
 		{
 			// ASF: To validate an input parameter we need only to read its value.
 			// Assigning it to null is an easy way to do this.
-			statement->append_uchar(blr_assignment);
-			statement->append_uchar(blr_parameter2);
-			statement->append_uchar(0);	// input
-			statement->append_ushort(i * 2);
-			statement->append_ushort(i * 2 + 1);
-			statement->append_uchar(blr_null);
+			dsqlScratch->appendUChar(blr_assignment);
+			dsqlScratch->appendUChar(blr_parameter2);
+			dsqlScratch->appendUChar(0);	// input
+			dsqlScratch->appendUShort(i * 2);
+			dsqlScratch->appendUShort(i * 2 + 1);
+			dsqlScratch->appendUChar(blr_null);
 		}
 	}
 
@@ -2050,24 +2050,24 @@
 
 	putLocalVariables(dsqlScratch, localDeclList, returns.getCount());
 
-	statement->append_uchar(blr_stall);
+	dsqlScratch->appendUChar(blr_stall);
 	// put a label before body of procedure,
 	// so that any EXIT statement can get out
-	statement->append_uchar(blr_label);
-	statement->append_uchar(0);
+	dsqlScratch->appendUChar(blr_label);
+	dsqlScratch->appendUChar(0);
 	dsqlScratch->loopLevel = 0;
 	dsqlScratch->cur...
 
[truncated message content] | 
| 
      
      
      From: <asf...@us...> - 2010-06-26 01:52:14
       | 
| Revision: 51288
          http://firebird.svn.sourceforge.net/firebird/?rev=51288&view=rev
Author:   asfernandes
Date:     2010-06-26 01:52:06 +0000 (Sat, 26 Jun 2010)
Log Message:
-----------
Refactor CREATE/DROP COLLATION
Modified Paths:
--------------
    firebird/trunk/lang_helpers/gds_codes.ftn
    firebird/trunk/lang_helpers/gds_codes.pas
    firebird/trunk/src/dsql/DdlNodes.epp
    firebird/trunk/src/dsql/DdlNodes.h
    firebird/trunk/src/dsql/ddl.cpp
    firebird/trunk/src/dsql/node.h
    firebird/trunk/src/dsql/parse.y
    firebird/trunk/src/dsql/pass1.cpp
    firebird/trunk/src/include/gen/codetext.h
    firebird/trunk/src/include/gen/iberror.h
    firebird/trunk/src/include/gen/msgs.h
    firebird/trunk/src/include/gen/sql_code.h
    firebird/trunk/src/include/gen/sql_state.h
    firebird/trunk/src/jrd/Attachment.cpp
    firebird/trunk/src/jrd/Attachment.h
    firebird/trunk/src/jrd/drq.h
    firebird/trunk/src/jrd/dyn.epp
    firebird/trunk/src/jrd/dyn.h
    firebird/trunk/src/jrd/dyn_def.epp
    firebird/trunk/src/jrd/dyn_del.epp
    firebird/trunk/src/jrd/dyn_df_proto.h
    firebird/trunk/src/jrd/dyn_dl_proto.h
    firebird/trunk/src/msgs/messages2.sql
    firebird/trunk/src/msgs/system_errors2.sql
Modified: firebird/trunk/lang_helpers/gds_codes.ftn
===================================================================
--- firebird/trunk/lang_helpers/gds_codes.ftn	2010-06-26 01:24:31 UTC (rev 51287)
+++ firebird/trunk/lang_helpers/gds_codes.ftn	2010-06-26 01:52:06 UTC (rev 51288)
@@ -1638,8 +1638,18 @@
       PARAMETER (GDS__invalid_coll_attr                = 336068830)
       INTEGER*4 GDS__dyn_wrong_gtt_scope             
       PARAMETER (GDS__dyn_wrong_gtt_scope              = 336068840)
+      INTEGER*4 GDS__dyn_coll_used_table             
+      PARAMETER (GDS__dyn_coll_used_table              = 336068843)
+      INTEGER*4 GDS__dyn_coll_used_domain            
+      PARAMETER (GDS__dyn_coll_used_domain             = 336068844)
+      INTEGER*4 GDS__dyn_cannot_del_syscoll          
+      PARAMETER (GDS__dyn_cannot_del_syscoll           = 336068845)
+      INTEGER*4 GDS__dyn_cannot_del_def_coll         
+      PARAMETER (GDS__dyn_cannot_del_def_coll          = 336068846)
       INTEGER*4 GDS__dyn_table_not_found             
       PARAMETER (GDS__dyn_table_not_found              = 336068849)
+      INTEGER*4 GDS__dyn_coll_used_procedure         
+      PARAMETER (GDS__dyn_coll_used_procedure          = 336068851)
       INTEGER*4 GDS__dyn_scale_too_big               
       PARAMETER (GDS__dyn_scale_too_big                = 336068852)
       INTEGER*4 GDS__dyn_precision_too_small         
Modified: firebird/trunk/lang_helpers/gds_codes.pas
===================================================================
--- firebird/trunk/lang_helpers/gds_codes.pas	2010-06-26 01:24:31 UTC (rev 51287)
+++ firebird/trunk/lang_helpers/gds_codes.pas	2010-06-26 01:52:06 UTC (rev 51288)
@@ -826,7 +826,12 @@
 	gds_max_coll_per_charset             = 336068829;
 	gds_invalid_coll_attr                = 336068830;
 	gds_dyn_wrong_gtt_scope              = 336068840;
+	gds_dyn_coll_used_table              = 336068843;
+	gds_dyn_coll_used_domain             = 336068844;
+	gds_dyn_cannot_del_syscoll           = 336068845;
+	gds_dyn_cannot_del_def_coll          = 336068846;
 	gds_dyn_table_not_found              = 336068849;
+	gds_dyn_coll_used_procedure          = 336068851;
 	gds_dyn_scale_too_big                = 336068852;
 	gds_dyn_precision_too_small          = 336068853;
 	gds_dyn_miss_priv_warning            = 336068855;
Modified: firebird/trunk/src/dsql/DdlNodes.epp
===================================================================
--- firebird/trunk/src/dsql/DdlNodes.epp	2010-06-26 01:24:31 UTC (rev 51287)
+++ firebird/trunk/src/dsql/DdlNodes.epp	2010-06-26 01:52:06 UTC (rev 51288)
@@ -30,6 +30,7 @@
 #include "../jrd/msg_encode.h"
 #include "../jrd/obj.h"
 #include "../jrd/tra.h"
+#include "../jrd/IntlManager.h"
 #include "../jrd/PreparedStatement.h"
 #include "../jrd/blb_proto.h"
 #include "../jrd/cmp_proto.h"
@@ -2757,6 +2758,360 @@
 //----------------------
 
 
+void CreateCollationNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const
+{
+	text.printf(
+		"CreateCollationNode\n"
+		"  name: '%s'\n"
+		"  forCharSet: '%s'\n"
+		"  fromName: '%s'\n"
+		"  fromExternal: '%s'\n"
+		"  attributesOn: %x\n"
+		"  attributesOff: %x\n",
+		name.c_str(), forCharSet.c_str(), fromName.c_str(), fromExternal.c_str(),
+		attributesOn, attributesOff);
+}
+
+void CreateCollationNode::execute(thread_db* tdbb, jrd_tra* transaction)
+{
+	Attachment* attachment = transaction->tra_attachment;
+
+	// run all statements under savepoint control
+	AutoSavePoint savePoint(tdbb, transaction);
+
+	executeDdlTrigger(tdbb, transaction, DTW_BEFORE, DDL_TRIGGER_CREATE_COLLATION, name);
+
+	bool endStore = false;
+
+	try
+	{
+		AutoCacheRequest request(tdbb, drq_s_colls, DYN_REQUESTS);
+
+		STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+			X IN RDB$COLLATIONS
+		{
+			X.RDB$CHARACTER_SET_ID = forCharSetId;
+			strcpy(X.RDB$COLLATION_NAME, name.c_str());
+			X.RDB$SYSTEM_FLAG = 0;
+
+			X.RDB$SPECIFIC_ATTRIBUTES.NULL = TRUE;
+			X.RDB$BASE_COLLATION_NAME.NULL = TRUE;
+
+			CharSet* cs = INTL_charset_lookup(tdbb, forCharSetId);
+			SubtypeInfo info;
+
+			if (fromName.hasData())
+			{
+				if (MET_get_char_coll_subtype_info(tdbb,
+						INTL_CS_COLL_TO_TTYPE(forCharSetId, fromCollationId), &info) &&
+					info.specificAttributes.hasData())
+				{
+					UCharBuffer temp;
+					ULONG size = info.specificAttributes.getCount() * cs->maxBytesPerChar();
+
+					size = INTL_convert_bytes(tdbb, forCharSetId, temp.getBuffer(size), size,
+						CS_METADATA, info.specificAttributes.begin(),
+						info.specificAttributes.getCount(), status_exception::raise);
+					temp.shrink(size);
+					info.specificAttributes = temp;
+				}
+
+				strcpy(X.RDB$BASE_COLLATION_NAME, info.baseCollationName.c_str());
+				X.RDB$BASE_COLLATION_NAME.NULL = FALSE;
+			}
+			else if (fromExternal.hasData())
+			{
+				strcpy(X.RDB$BASE_COLLATION_NAME, fromExternal.c_str());
+				X.RDB$BASE_COLLATION_NAME.NULL = FALSE;
+			}
+
+			if (specificAttributes.hasData())
+			{
+				UCharBuffer temp;
+				ULONG size = specificAttributes.getCount() * cs->maxBytesPerChar();
+
+				size = INTL_convert_bytes(tdbb, forCharSetId, temp.getBuffer(size), size,
+					attachment->att_charset, specificAttributes.begin(),
+					specificAttributes.getCount(), status_exception::raise);
+				temp.shrink(size);
+				specificAttributes = temp;
+			}
+
+			info.charsetName = forCharSet.c_str();
+			info.collationName = name;
+			if (X.RDB$BASE_COLLATION_NAME.NULL)
+				info.baseCollationName = info.collationName;
+			else
+				info.baseCollationName = X.RDB$BASE_COLLATION_NAME;
+			info.ignoreAttributes = false;
+
+			if (!IntlManager::collationInstalled(info.baseCollationName.c_str(),
+					info.charsetName.c_str()))
+			{
+				// msg: 223: "Collation @1 not installed for character set @2"
+				status_exception::raise(
+					Arg::Gds(isc_no_meta_update) <<
+					Arg::Gds(ENCODE_ISC_MSG(223, DYN_MSG_FAC)) <<
+					info.baseCollationName << info.charsetName);
+			}
+
+			IntlUtil::SpecificAttributesMap map;
+
+			if (!IntlUtil::parseSpecificAttributes(
+					cs, info.specificAttributes.getCount(), info.specificAttributes.begin(), &map) ||
+				!IntlUtil::parseSpecificAttributes(
+					cs, specificAttributes.getCount(), specificAttributes.begin(), &map))
+			{
+				// msg: 222: "Invalid collation attributes"
+				status_exception::raise(
+					Arg::Gds(isc_no_meta_update) <<
+					Arg::Gds(ENCODE_ISC_MSG(222, DYN_MSG_FAC)));
+			}
+
+			const string s = IntlUtil::generateSpecificAttributes(cs, map);
+			string newSpecificAttributes;
+
+			if (!IntlManager::setupCollationAttributes(
+					info.baseCollationName.c_str(), info.charsetName.c_str(), s,
+					newSpecificAttributes))
+			{
+				// msg: 222: "Invalid collation attributes"
+				status_exception::raise(
+					Arg::Gds(isc_no_meta_update) <<
+					Arg::Gds(ENCODE_ISC_MSG(222, DYN_MSG_FAC)));
+			}
+
+			memcpy(info.specificAttributes.getBuffer(newSpecificAttributes.length()),
+				newSpecificAttributes.begin(), newSpecificAttributes.length());
+
+			if (info.specificAttributes.hasData())
+			{
+				X.RDB$SPECIFIC_ATTRIBUTES.NULL = FALSE;
+				attachment->storeMetaDataBlob(tdbb, transaction, &X.RDB$SPECIFIC_ATTRIBUTES,
+					string(info.specificAttributes.begin(), info.specificAttributes.getCount()),
+					forCharSetId);
+			}
+
+			info.attributes = (info.attributes | attributesOn) & (~attributesOff);
+			X.RDB$COLLATION_ATTRIBUTES = info.attributes;
+
+			// Do not allow invalid attributes here.
+			if (!INTL_texttype_validate(tdbb, &info))
+			{
+				// msg: 222: "Invalid collation attributes"
+				status_exception::raise(
+					Arg::Gds(isc_no_meta_update) <<
+					Arg::Gds(ENCODE_ISC_MSG(222, DYN_MSG_FAC)));
+			}
+
+			// ASF: User collations are created with the last number available,
+			// to minimize the possibility of conflicts with future system collations.
+			// The greater available number is 126 to avoid signed/unsigned problems.
+
+			X.RDB$COLLATION_ID.NULL = TRUE;
+			X.RDB$COLLATION_ID = 126;
+
+			AutoCacheRequest request2(tdbb, drq_l_max_coll_id, DYN_REQUESTS);
+
+			FOR(REQUEST_HANDLE request2)
+				Y IN RDB$COLLATIONS
+				WITH Y.RDB$CHARACTER_SET_ID = forCharSetId AND
+					 Y.RDB$COLLATION_ID NOT MISSING
+				SORTED BY DESCENDING Y.RDB$COLLATION_ID
+			{
+				if (Y.RDB$COLLATION_ID + 1 <= X.RDB$COLLATION_ID)
+				{
+					X.RDB$COLLATION_ID.NULL = FALSE;
+					break;
+				}
+				else
+					X.RDB$COLLATION_ID = Y.RDB$COLLATION_ID - 1;
+			}
+			END_FOR
+
+			if (X.RDB$COLLATION_ID.NULL)
+			{
+				status_exception::raise(
+					Arg::Gds(isc_no_meta_update) <<
+					Arg::Gds(isc_max_coll_per_charset));
+			}
+
+			endStore = true;
+		}
+		END_STORE
+	}
+	catch (const status_exception& ex)
+	{
+		// DEFINE COLLATION failed
+		rethrowMetaException(ex, ENCODE_ISC_MSG(219, DYN_MSG_FAC), endStore);
+	}
+
+	executeDdlTrigger(tdbb, transaction, DTW_AFTER, DDL_TRIGGER_CREATE_COLLATION, name);
+
+	savePoint.release();	// everything is ok
+
+	// Update DSQL cache
+	AutoPtr<dsql_str> str(MAKE_string(name.c_str(), name.length()));
+	METD_drop_collation(transaction, str);
+	MET_dsql_cache_release(tdbb, SYM_intlsym_collation, str->str_data);
+}
+
+DdlNode* CreateCollationNode::internalDsqlPass()
+{
+	const dsql_intlsym* resolvedCharSet = METD_get_charset(
+		dsqlScratch->getTransaction(), forCharSet.length(), forCharSet.c_str());
+
+	if (!resolvedCharSet)
+	{
+		// specified character set not found
+		ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-504) <<
+				  Arg::Gds(isc_charset_not_found) << forCharSet);
+	}
+
+	forCharSetId = resolvedCharSet->intlsym_charset_id;
+
+	if (fromName.hasData())
+	{
+		AutoPtr<dsql_str> str(MAKE_string(fromName.c_str(), fromName.length()));
+		const dsql_intlsym* resolvedCollation = METD_get_collation(
+			dsqlScratch->getTransaction(), str, forCharSetId);
+
+		if (!resolvedCollation)
+		{
+			// Specified collation not found
+			ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-204) <<
+					  Arg::Gds(isc_collation_not_found) << fromName << forCharSet);
+		}
+
+		fromCollationId = resolvedCollation->intlsym_collate_id;
+	}
+
+	return DdlNode::internalDsqlPass();
+}
+
+
+//----------------------
+
+
+void DropCollationNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const
+{
+	text.printf(
+		"DropCollationNode\n"
+		"  name: '%s'\n",
+		name.c_str());
+}
+
+void DropCollationNode::execute(thread_db* tdbb, jrd_tra* transaction)
+{
+	// run all statements under savepoint control
+	AutoSavePoint savePoint(tdbb, transaction);
+
+	bool found = false;
+	AutoCacheRequest request(tdbb, drq_e_colls, DYN_REQUESTS);
+
+	FOR (REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		COLL IN RDB$COLLATIONS
+		CROSS CS IN RDB$CHARACTER_SETS
+		WITH COLL.RDB$COLLATION_NAME EQ name.c_str() AND
+			 CS.RDB$CHARACTER_SET_ID EQ COLL.RDB$CHARACTER_SET_ID
+	{
+		executeDdlTrigger(tdbb, transaction, DTW_BEFORE, DDL_TRIGGER_DROP_COLLATION, name);
+
+		if (!COLL.RDB$SYSTEM_FLAG.NULL && COLL.RDB$SYSTEM_FLAG)
+		{
+			status_exception::raise(Arg::Gds(isc_no_meta_update) <<
+				Arg::Gds(isc_dyn_cannot_del_syscoll));
+		}
+
+		if (COLL.RDB$COLLATION_ID == 0 ||
+			(!CS.RDB$DEFAULT_COLLATE_NAME.NULL &&
+				MetaName(COLL.RDB$COLLATION_NAME) == MetaName(CS.RDB$DEFAULT_COLLATE_NAME)))
+		{
+			fb_utils::exact_name_limit(CS.RDB$CHARACTER_SET_NAME,
+				sizeof(CS.RDB$CHARACTER_SET_NAME));
+
+			status_exception::raise(Arg::Gds(isc_no_meta_update) <<
+				Arg::Gds(isc_dyn_cannot_del_def_coll) << CS.RDB$CHARACTER_SET_NAME);
+		}
+
+		found = true;
+		fb_utils::exact_name_limit(COLL.RDB$COLLATION_NAME, sizeof(COLL.RDB$COLLATION_NAME));
+
+		AutoCacheRequest request2(tdbb, drq_l_rfld_coll, DYN_REQUESTS);
+
+		FOR (REQUEST_HANDLE request2 TRANSACTION_HANDLE transaction)
+			RF IN RDB$RELATION_FIELDS CROSS F IN RDB$FIELDS
+			WITH RF.RDB$FIELD_SOURCE EQ F.RDB$FIELD_NAME AND
+				 F.RDB$CHARACTER_SET_ID EQ COLL.RDB$CHARACTER_SET_ID AND
+				 RF.RDB$COLLATION_ID EQ COLL.RDB$COLLATION_ID
+		{
+			fb_utils::exact_name_limit(RF.RDB$RELATION_NAME, sizeof(RF.RDB$RELATION_NAME));
+			fb_utils::exact_name_limit(RF.RDB$FIELD_NAME, sizeof(RF.RDB$FIELD_NAME));
+
+			status_exception::raise(Arg::Gds(isc_no_meta_update) <<
+				Arg::Gds(isc_dyn_coll_used_table) << COLL.RDB$COLLATION_NAME <<
+				RF.RDB$RELATION_NAME << RF.RDB$FIELD_NAME);
+		}
+		END_FOR
+
+		request2.reset(tdbb, drq_l_prm_coll, DYN_REQUESTS);
+
+		FOR (REQUEST_HANDLE request2 TRANSACTION_HANDLE transaction)
+			PRM IN RDB$PROCEDURE_PARAMETERS CROSS F IN RDB$FIELDS
+			WITH PRM.RDB$FIELD_SOURCE EQ F.RDB$FIELD_NAME AND
+				 F.RDB$CHARACTER_SET_ID EQ COLL.RDB$CHARACTER_SET_ID AND
+				 PRM.RDB$COLLATION_ID EQ COLL.RDB$COLLATION_ID
+		{
+			fb_utils::exact_name_limit(PRM.RDB$PARAMETER_NAME, sizeof(PRM.RDB$PARAMETER_NAME));
+
+			status_exception::raise(Arg::Gds(isc_no_meta_update) <<
+				Arg::Gds(isc_dyn_coll_used_procedure) <<
+				COLL.RDB$COLLATION_NAME <<
+				QualifiedName(PRM.RDB$PROCEDURE_NAME,
+					(PRM.RDB$PACKAGE_NAME.NULL ? NULL : PRM.RDB$PACKAGE_NAME)).toString().c_str() <<
+				PRM.RDB$PARAMETER_NAME);
+		}
+		END_FOR
+
+		request2.reset(tdbb, drq_l_fld_coll, DYN_REQUESTS);
+
+		FOR (REQUEST_HANDLE request2 TRANSACTION_HANDLE transaction)
+			F IN RDB$FIELDS
+			WITH F.RDB$CHARACTER_SET_ID EQ COLL.RDB$CHARACTER_SET_ID AND
+				 F.RDB$COLLATION_ID EQ COLL.RDB$COLLATION_ID
+		{
+			fb_utils::exact_name_limit(F.RDB$FIELD_NAME, sizeof(F.RDB$FIELD_NAME));
+
+			status_exception::raise(Arg::Gds(isc_no_meta_update) <<
+				Arg::Gds(isc_dyn_coll_used_domain) << COLL.RDB$COLLATION_NAME << F.RDB$FIELD_NAME);
+		}
+		END_FOR
+
+		ERASE COLL;
+	}
+	END_FOR
+
+	if (found)
+		executeDdlTrigger(tdbb, transaction, DTW_AFTER, DDL_TRIGGER_DROP_COLLATION, name);
+	else
+	{
+		status_exception::raise(
+			Arg::Gds(isc_no_meta_update) <<
+			Arg::Gds(isc_dyn_collation_not_found) << Arg::Str(name));
+	}
+
+	savePoint.release();	// everything is ok
+
+	// Update DSQL cache
+	AutoPtr<dsql_str> str(MAKE_string(name.c_str(), name.length()));
+	METD_drop_collation(transaction, str);
+	MET_dsql_cache_release(tdbb, SYM_intlsym_collation, str->str_data);
+}
+
+
+//----------------------
+
+
 void CreateSequenceNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const
 {
 	text.printf(
Modified: firebird/trunk/src/dsql/DdlNodes.h
===================================================================
--- firebird/trunk/src/dsql/DdlNodes.h	2010-06-26 01:24:31 UTC (rev 51287)
+++ firebird/trunk/src/dsql/DdlNodes.h	2010-06-26 01:52:06 UTC (rev 51288)
@@ -24,11 +24,14 @@
 #define DSQL_DDL_NODES_H
 
 #include "../jrd/common.h"
+#include "../jrd/dyn.h"
+#include "../jrd/msg_encode.h"
 #include "../dsql/node.h"
 #include "../dsql/make_proto.h"
 #include "../dsql/Nodes.h"
 #include "../common/classes/array.h"
 #include "../common/classes/TriState.h"
+#include "../dsql/errd_proto.h"
 
 namespace Jrd {
 
@@ -494,6 +497,91 @@
 };
 
 
+class CreateCollationNode : public DdlNode
+{
+public:
+	explicit CreateCollationNode(MemoryPool& p, const Firebird::string& sqlText,
+				const Firebird::MetaName& aName, const Firebird::MetaName& aForCharSet)
+		: DdlNode(p, sqlText),
+		  name(p, aName),
+		  forCharSet(p, aForCharSet),
+		  fromName(p),
+		  fromExternal(p),
+		  specificAttributes(p),
+		  attributesOn(0),
+		  attributesOff(0),
+		  forCharSetId(0),
+		  fromCollationId(0)
+	{
+	}
+
+public:
+	virtual void print(Firebird::string& text, Firebird::Array<dsql_nod*>& nodes) const;
+	virtual void execute(thread_db* tdbb, jrd_tra* transaction);
+
+	void setAttribute(USHORT attribute)
+	{
+		if ((attributesOn | attributesOff) & attribute)
+		{
+			// msg: 222: "Invalid collation attributes"
+			using namespace Firebird;
+			ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+				Arg::Gds(ENCODE_ISC_MSG(222, DYN_MSG_FAC)));
+		}
+
+		attributesOn |= attribute;
+	}
+
+	void unsetAttribute(USHORT attribute)
+	{
+		if ((attributesOn | attributesOff) & attribute)
+		{
+			// msg: 222: "Invalid collation attributes"
+			using namespace Firebird;
+			ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+				Arg::Gds(ENCODE_ISC_MSG(222, DYN_MSG_FAC)));
+		}
+
+		attributesOff |= attribute;
+	}
+
+protected:
+	virtual DdlNode* internalDsqlPass();
+
+public:
+	Firebird::MetaName name;
+	Firebird::MetaName forCharSet;
+	Firebird::MetaName fromName;
+	Firebird::string fromExternal;
+	Firebird::UCharBuffer specificAttributes;
+
+private:
+	USHORT attributesOn;
+	USHORT attributesOff;
+	USHORT forCharSetId;
+	USHORT fromCollationId;
+};
+
+
+class DropCollationNode : public DdlNode
+{
+public:
+	explicit DropCollationNode(MemoryPool& p, const Firebird::string& sqlText,
+				const Firebird::MetaName& aName)
+		: DdlNode(p, sqlText),
+		  name(p, aName)
+	{
+	}
+
+public:
+	virtual void print(Firebird::string& text, Firebird::Array<dsql_nod*>& nodes) const;
+	virtual void execute(thread_db* tdbb, jrd_tra* transaction);
+
+public:
+	Firebird::MetaName name;
+};
+
+
 class CreateSequenceNode : public DdlNode
 {
 public:
Modified: firebird/trunk/src/dsql/ddl.cpp
===================================================================
--- firebird/trunk/src/dsql/ddl.cpp	2010-06-26 01:24:31 UTC (rev 51287)
+++ firebird/trunk/src/dsql/ddl.cpp	2010-06-26 01:52:06 UTC (rev 51288)
@@ -132,7 +132,6 @@
 static void define_field(DsqlCompilerScratch*, dsql_nod*, SSHORT, const dsql_str*, const dsql_nod* pkcols);
 static void define_filter(DsqlCompilerScratch*);
 static SSHORT getBlobFilterSubType(DsqlCompilerScratch* dsqlScratch, const dsql_nod* node);
-static void define_collation(DsqlCompilerScratch*);
 static void define_role(DsqlCompilerScratch*);
 static void define_index(DsqlCompilerScratch*);
 static void define_rel_constraint(DsqlCompilerScratch*, dsql_nod*);
@@ -148,7 +147,6 @@
 	const dsql_nod*, const char*, const char*);
 static void define_view(DsqlCompilerScratch*, NOD_TYPE);
 static void define_view_trigger(DsqlCompilerScratch*, dsql_nod*, dsql_nod*, dsql_nod*);
-static void delete_collation(DsqlCompilerScratch*);
 static void delete_exception(DsqlCompilerScratch*, dsql_nod*, bool);
 static void delete_relation_view(DsqlCompilerScratch*, dsql_nod*, bool);
 static const dsql_nod* find_pk_columns(const dsql_nod* def_rel_elements);
@@ -270,13 +268,6 @@
 			METD_drop_relation(request->getTransaction(), string);
 			break;
 
-		case nod_del_collation:
-			// for delete, get rid of the cached collation metadata
-			string = (dsql_str*) statement->getDdlNode()->nod_arg[e_del_coll_name];
-			sym_type = SYM_intlsym_collation;
-			METD_drop_collation(request->getTransaction(), string);
-			break;
-
 		case nod_del_udf:
 		case nod_mod_udf:
 			// Signal UDF for obsolescence
@@ -1918,105 +1909,6 @@
 }
 
 
-static void define_collation(DsqlCompilerScratch* dsqlScratch)
-{
-/**************************************
- *
- *	d e f i n e _ c o l l a t i o n
- *
- **************************************
- *
- * Function
- *	Create a collation.
- *
- **************************************/
-
-	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
-
-	const dsql_nod* ddlNode = statement->getDdlNode();
-	const dsql_str* coll_name = (dsql_str*) ddlNode->nod_arg[e_def_coll_name];
-	const dsql_str* coll_for = (dsql_str*) ddlNode->nod_arg[e_def_coll_for];
-	const dsql_nod* coll_from = ddlNode->nod_arg[e_def_coll_from];
-	const dsql_nod* coll_attributes = ddlNode->nod_arg[e_def_coll_attributes];
-	const dsql_nod* coll_specific_attributes =
-		PASS1_node(dsqlScratch, ddlNode->nod_arg[e_def_coll_specific_attributes]);
-
-	const dsql_intlsym* resolved_charset =
-		METD_get_charset(dsqlScratch->getTransaction(), (USHORT) strlen(coll_for->str_data),
-			coll_for->str_data);
-
-	if (!resolved_charset)
-	{
-		// specified character set not found
-		ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-504) <<
-				  Arg::Gds(isc_charset_not_found) << Arg::Str(coll_for->str_data));
-	}
-
-	if (coll_specific_attributes)
-		coll_specific_attributes = coll_specific_attributes->nod_arg[0];
-
-	dsqlScratch->appendNullString(isc_dyn_def_collation, coll_name->str_data);
-	dsqlScratch->appendNumber(isc_dyn_coll_for_charset, resolved_charset->intlsym_charset_id);
-
-	if (coll_from)
-	{
-		const dsql_str* coll_name = reinterpret_cast<dsql_str*>(coll_from->nod_arg[0]);
-		if (coll_from->nod_type == nod_collation_from)
-		{
-			const dsql_intlsym* resolved_collation = METD_get_collation(
-				dsqlScratch->getTransaction(), coll_name, resolved_charset->intlsym_charset_id);
-
-			if (!resolved_collation)
-			{
-				// Specified collation not found
-				ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-204) <<
-						  Arg::Gds(isc_collation_not_found) << Arg::Str(coll_name->str_data) <<
-						  									   Arg::Str(resolved_charset->intlsym_name));
-			}
-
-			dsqlScratch->appendNumber(isc_dyn_coll_from,
-				INTL_CS_COLL_TO_TTYPE(resolved_collation->intlsym_charset_id,
-					resolved_collation->intlsym_collate_id));
-		}
-		else if (coll_from->nod_type == nod_collation_from_external)
-		{
-			dsqlScratch->appendNullString(isc_dyn_coll_from_external, coll_name->str_data);
-		}
-		else
-			fb_assert(false);
-	}
-
-	if (coll_attributes)
-	{
-		const dsql_nod* const* ptr = coll_attributes->nod_arg;
-		for (const dsql_nod* const* const end = ptr + coll_attributes->nod_count; ptr < end; ptr++)
-		{
-			const dsql_nod* attribute = *ptr;
-
-			switch (attribute->nod_type)
-			{
-				case nod_collation_attr:
-					dsqlScratch->appendNumber(isc_dyn_coll_attribute, (IPTR) attribute->nod_arg[0]);
-					break;
-
-				default:
-					break;
-			}
-		}
-	}
-
-	if (coll_specific_attributes)
-	{
-		dsqlScratch->appendNumber(isc_dyn_coll_specific_attributes_charset,
-			coll_specific_attributes->nod_desc.dsc_ttype());
-		dsqlScratch->appendNullString(isc_dyn_coll_specific_attributes,
-			((dsql_str*)coll_specific_attributes->nod_arg[0])->str_data);
-	}
-
-	dsqlScratch->appendUChar(isc_dyn_end);
-}
-
-
 static void define_index(DsqlCompilerScratch* dsqlScratch)
 {
 /**************************************
@@ -3258,26 +3150,6 @@
 }
 
 
-static void delete_collation(DsqlCompilerScratch* dsqlScratch)
-{
-/**************************************
- *
- *	d e l e t e _ c o l l a t i o n
- *
- **************************************
- *
- * Function
- *	Delete a collation.
- *
- **************************************/
-
-	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
-	const dsql_str* coll_name = (dsql_str*) statement->getDdlNode()->nod_arg[e_del_coll_name];
-	dsqlScratch->appendNullString(isc_dyn_del_collation, coll_name->str_data);
-	dsqlScratch->appendUChar(isc_dyn_end);
-}
-
-
 static void delete_exception (DsqlCompilerScratch* dsqlScratch, dsql_nod* node, bool silent_deletion)
 {
 /**************************************
@@ -3673,14 +3545,6 @@
 		modify_map(dsqlScratch);
 		break;
 
-	case nod_def_collation:
-		define_collation(dsqlScratch);
-		break;
-
-	case nod_del_collation:
-		delete_collation(dsqlScratch);
-		break;
-
 	case nod_add_user:
 		define_user(dsqlScratch, isc_dyn_user_add);
 		break;
Modified: firebird/trunk/src/dsql/node.h
===================================================================
--- firebird/trunk/src/dsql/node.h	2010-06-26 01:24:31 UTC (rev 51287)
+++ firebird/trunk/src/dsql/node.h	2010-06-26 01:52:06 UTC (rev 51288)
@@ -265,12 +265,6 @@
 	nod_redef_exception, // RECREATE EXCEPTION
 	nod_replace_exception, // CREATE OR ALTER EXCEPTION
 	nod_mod_udf,
-	nod_def_collation,
-	nod_del_collation,
-	nod_collation_from,
-	nod_collation_from_external,
-	nod_collation_attr,
-	nod_collation_specific_attr,
 	nod_strlen,
 	nod_trim,
 	nod_returning,
@@ -831,16 +825,6 @@
 	e_mod_udf_module,
 	e_mod_udf_count,
 
-	e_def_coll_name = 0,
-	e_def_coll_for,
-	e_def_coll_from,
-	e_def_coll_attributes,
-	e_def_coll_specific_attributes,
-	e_def_coll_count,
-
-	e_del_coll_name = 0,
-	e_del_coll_count,
-
 	e_strlen_type = 0,				// constant representing type of length
 	e_strlen_value,
 	e_strlen_count,
Modified: firebird/trunk/src/dsql/parse.y
===================================================================
--- firebird/trunk/src/dsql/parse.y	2010-06-26 01:24:31 UTC (rev 51287)
+++ firebird/trunk/src/dsql/parse.y	2010-06-26 01:52:06 UTC (rev 51288)
@@ -627,6 +627,7 @@
 	Jrd::ExprNode* exprNode;
 	Jrd::StmtNode* stmtNode;
 	Jrd::DdlNode* ddlNode;
+	Jrd::CreateCollationNode* createCollationNode;
 	Jrd::CreateAlterFunctionNode* createAlterFunctionNode;
 	Jrd::CreateAlterProcedureNode* createAlterProcedureNode;
 	Jrd::CreateAlterTriggerNode* createAlterTriggerNode;
@@ -659,10 +660,7 @@
 %type <legacyNode> case_abbreviation case_expression case_operand case_result case_specification
 %type <legacyNode> cast_specification char_length_expression character_keyword character_type
 %type <legacyNode> charset_clause check_constraint check_opt close_cursor col_opt collate_clause
-%type <legacyNode> collation_accent_attribute collation_attribute collation_attribute_list
-%type <legacyNode> collation_attribute_list_opt collation_case_attribute collation_clause
-%type <legacyNode> collation_pad_attribute collation_sequence_definition
-%type <legacyNode> collation_specific_attribute_opt column_constraint column_constraint_clause
+%type <legacyNode> column_constraint column_constraint_clause
 %type <legacyNode> column_constraint_def column_constraint_list column_def
 
 %type <legacyNode> column_list column_name column_parens column_parens_opt column_select
@@ -822,6 +820,16 @@
 %type <createAlterProcedureNode> alter_procedure_clause procedure_clause procedure_clause_start replace_procedure_clause
 %type <externalClause> external_clause
 
+%type <createCollationNode> collation_clause
+%type collation_sequence_definition(<createCollationNode>)
+%type collation_accent_attribute(<createCollationNode>)
+%type collation_attribute(<createCollationNode>)
+%type collation_attribute_list(<createCollationNode>)
+%type collation_attribute_list_opt(<createCollationNode>)
+%type collation_case_attribute(<createCollationNode>)
+%type collation_pad_attribute(<createCollationNode>)
+%type collation_specific_attribute_opt(<createCollationNode>)
+
 %type <triBoolVal> trigger_active
 %type <uint64Val> trigger_db_type trigger_ddl_type trigger_ddl_type_items trigger_type
 %type <uint64Val> trigger_type_prefix trigger_type_suffix
@@ -1213,7 +1221,7 @@
 		| ROLE role_clause
 			{ $$ = $2; }
 		| COLLATION collation_clause
-			{ $$ = $2; }
+			{ $$ = makeClassNode($2); }
 		| USER create_user_clause
 			{ $$ = $2; }
 		| PACKAGE package_clause
@@ -1426,62 +1434,71 @@
 
 // CREATE COLLATION
 
-collation_clause : symbol_collation_name FOR symbol_character_set_name
-		collation_sequence_definition
-		collation_attribute_list_opt collation_specific_attribute_opt
-			{ $$ = make_node (nod_def_collation,
-						(int) e_def_coll_count, $1, $3, $4, make_list($5), $6); }
-		;
+collation_clause
+	: symbol_collation_name FOR symbol_character_set_name
+			{
+				$<createCollationNode>$ = FB_NEW(getPool()) CreateCollationNode(
+					getPool(), compilingText, toName($1), toName($3));
+			}
+		collation_sequence_definition($4)
+		collation_attribute_list_opt($4) collation_specific_attribute_opt($4)
+			{ $$ = $4; }
+	;
 
-collation_sequence_definition :
-		FROM symbol_collation_name
-			{ $$ = make_node(nod_collation_from, 1, $2); }
-		| FROM EXTERNAL '(' sql_string ')'
-			{ $$ = make_node(nod_collation_from_external, 1, $4); }
-		|
-			{ $$ = NULL; }
-		;
+collation_sequence_definition($createCollation)
+	:
+	| FROM symbol_collation_name
+		{ $createCollation->fromName = toName($2); }
+	| FROM EXTERNAL '(' sql_string ')'
+		{ $createCollation->fromExternal = toString($4); }
+	;
 
-collation_attribute_list_opt :
-			{ $$ = NULL; }
-		| collation_attribute_list
-		;
+collation_attribute_list_opt($createCollation)
+	:
+	| collation_attribute_list($createCollation)
+	;
 
-collation_attribute_list : collation_attribute
-		| collation_attribute_list collation_attribute
-			{ $$ = make_node(nod_list, 2, $1, $2); }
-		;
+collation_attribute_list($createCollation)
+	: collation_attribute($createCollation)
+	| collation_attribute_list collation_attribute($createCollation)
+	;
 
-collation_attribute :
-		  collation_pad_attribute
-		| collation_case_attribute
-		| collation_accent_attribute
-		;
+collation_attribute($createCollation)
+	: collation_pad_attribute($createCollation)
+	| collation_case_attribute($createCollation)
+	| collation_accent_attribute($createCollation)
+	;
 
-collation_pad_attribute : NO PAD
-			{ $$ = make_node(nod_collation_attr, 1, -TEXTTYPE_ATTR_PAD_SPACE); }
-		| PAD SPACE
-			{ $$ = make_node(nod_collation_attr, 1, TEXTTYPE_ATTR_PAD_SPACE); }
-		;
+collation_pad_attribute($createCollation)
+	: NO PAD
+		{ $createCollation->unsetAttribute(TEXTTYPE_ATTR_PAD_SPACE); }
+	| PAD SPACE
+		{ $createCollation->setAttribute(TEXTTYPE_ATTR_PAD_SPACE); }
+	;
 
-collation_case_attribute : CASE SENSITIVE
-			{ $$ = make_node(nod_collation_attr, 1, -TEXTTYPE_ATTR_CASE_INSENSITIVE); }
-		| CASE INSENSITIVE
-			{ $$ = make_node(nod_collation_attr, 1, TEXTTYPE_ATTR_CASE_INSENSITIVE); }...
 
[truncated message content] | 
| 
      
      
      From: <asf...@us...> - 2010-06-27 03:47:49
       | 
| Revision: 51295
          http://firebird.svn.sourceforge.net/firebird/?rev=51295&view=rev
Author:   asfernandes
Date:     2010-06-27 03:47:40 +0000 (Sun, 27 Jun 2010)
Log Message:
-----------
MSVC10 support
Modified Paths:
--------------
    firebird/trunk/builds/win32/setenvvar.bat
    firebird/trunk/src/jrd/gds.cpp
    firebird/trunk/src/jrd/os/win32/mod_loader.cpp
Added Paths:
-----------
    firebird/trunk/builds/win32/msvc10/
    firebird/trunk/builds/win32/msvc10/DllNoEmbedManifest.props
    firebird/trunk/builds/win32/msvc10/Firebird2.sln
    firebird/trunk/builds/win32/msvc10/Firebird2Boot.sln
    firebird/trunk/builds/win32/msvc10/Firebird2_Examples.sln
    firebird/trunk/builds/win32/msvc10/alice.vcxproj
    firebird/trunk/builds/win32/msvc10/alice.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/btyacc.vcxproj
    firebird/trunk/builds/win32/msvc10/btyacc.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/build_msg.vcxproj
    firebird/trunk/builds/win32/msvc10/build_msg.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/burp.vcxproj
    firebird/trunk/builds/win32/msvc10/burp.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/codes.vcxproj
    firebird/trunk/builds/win32/msvc10/codes.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/common.vcxproj
    firebird/trunk/builds/win32/msvc10/common.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/common_classic.vcxproj
    firebird/trunk/builds/win32/msvc10/common_classic.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/common_static.vcxproj
    firebird/trunk/builds/win32/msvc10/common_static.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/config.vcxproj
    firebird/trunk/builds/win32/msvc10/config.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/dsql_server.vcxproj
    firebird/trunk/builds/win32/msvc10/dsql_server.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/dsql_server_classic.vcxproj
    firebird/trunk/builds/win32/msvc10/dsql_server_classic.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/empbuild.vcxproj
    firebird/trunk/builds/win32/msvc10/empbuild.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/engine.vcxproj
    firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj
    firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj
    firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fb2control.vcxproj
    firebird/trunk/builds/win32/msvc10/fb2control.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fb_inet_server.vcxproj
    firebird/trunk/builds/win32/msvc10/fb_inet_server.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fb_lock_print.vcxproj
    firebird/trunk/builds/win32/msvc10/fb_lock_print.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fbclient.vcxproj
    firebird/trunk/builds/win32/msvc10/fbclient.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fbembed.vcxproj
    firebird/trunk/builds/win32/msvc10/fbembed.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fbguard.vcxproj
    firebird/trunk/builds/win32/msvc10/fbguard.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fbrmclib.vcxproj
    firebird/trunk/builds/win32/msvc10/fbrmclib.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fbserver.vcxproj
    firebird/trunk/builds/win32/msvc10/fbserver.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fbsvcmgr.vcxproj
    firebird/trunk/builds/win32/msvc10/fbsvcmgr.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fbtrace.vcxproj
    firebird/trunk/builds/win32/msvc10/fbtrace.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fbtracemgr.vcxproj
    firebird/trunk/builds/win32/msvc10/fbtracemgr.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/fbudf.vcxproj
    firebird/trunk/builds/win32/msvc10/fbudf.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/firebird2.props
    firebird/trunk/builds/win32/msvc10/firebird2debug.props
    firebird/trunk/builds/win32/msvc10/firebird2release.props
    firebird/trunk/builds/win32/msvc10/gbak.vcxproj
    firebird/trunk/builds/win32/msvc10/gbak.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/gbak_embed.vcxproj
    firebird/trunk/builds/win32/msvc10/gbak_embed.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/gfix.vcxproj
    firebird/trunk/builds/win32/msvc10/gfix.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/gpre.vcxproj
    firebird/trunk/builds/win32/msvc10/gpre.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/gpre_boot.vcxproj
    firebird/trunk/builds/win32/msvc10/gpre_boot.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/gpre_embed.vcxproj
    firebird/trunk/builds/win32/msvc10/gpre_embed.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/gsec.vcxproj
    firebird/trunk/builds/win32/msvc10/gsec.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/gsplit.vcxproj
    firebird/trunk/builds/win32/msvc10/gsplit.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/gstat.vcxproj
    firebird/trunk/builds/win32/msvc10/gstat.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/ib_udf.vcxproj
    firebird/trunk/builds/win32/msvc10/ib_udf.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/ib_util.vcxproj
    firebird/trunk/builds/win32/msvc10/ib_util.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/instclient.vcxproj
    firebird/trunk/builds/win32/msvc10/instclient.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/instreg.vcxproj
    firebird/trunk/builds/win32/msvc10/instreg.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/instsvc.vcxproj
    firebird/trunk/builds/win32/msvc10/instsvc.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/intl.vcxproj
    firebird/trunk/builds/win32/msvc10/intl.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/intlbuild.vcxproj
    firebird/trunk/builds/win32/msvc10/intlbuild.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/isql.vcxproj
    firebird/trunk/builds/win32/msvc10/isql.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/isql_embed.vcxproj
    firebird/trunk/builds/win32/msvc10/isql_embed.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/lock.vcxproj
    firebird/trunk/builds/win32/msvc10/lock.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/lock_classic.vcxproj
    firebird/trunk/builds/win32/msvc10/lock_classic.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/nbackup.vcxproj
    firebird/trunk/builds/win32/msvc10/nbackup.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/qli.vcxproj
    firebird/trunk/builds/win32/msvc10/qli.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/remote.vcxproj
    firebird/trunk/builds/win32/msvc10/remote.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/udr_engine.vcxproj
    firebird/trunk/builds/win32/msvc10/udr_engine.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj
    firebird/trunk/builds/win32/msvc10/udrcpp_example.vcxproj.filters
    firebird/trunk/extern/icu/source/allinone/allinone_10.sln
    firebird/trunk/extern/icu/source/allinone/firebird2debug.props
    firebird/trunk/extern/icu/source/allinone/firebird2intl.props
    firebird/trunk/extern/icu/source/allinone/firebird2release.props
    firebird/trunk/extern/icu/source/common/common_10.vcxproj
    firebird/trunk/extern/icu/source/common/common_10.vcxproj.filters
    firebird/trunk/extern/icu/source/data/makedata_10.vcxproj
    firebird/trunk/extern/icu/source/data/makedata_10.vcxproj.filters
    firebird/trunk/extern/icu/source/extra/uconv/uconv_10.vcxproj
    firebird/trunk/extern/icu/source/extra/uconv/uconv_10.vcxproj.filters
    firebird/trunk/extern/icu/source/i18n/i18n_10.vcxproj
    firebird/trunk/extern/icu/source/i18n/i18n_10.vcxproj.filters
    firebird/trunk/extern/icu/source/io/io_10.vcxproj
    firebird/trunk/extern/icu/source/io/io_10.vcxproj.filters
    firebird/trunk/extern/icu/source/layout/layout_10.vcxproj
    firebird/trunk/extern/icu/source/layout/layout_10.vcxproj.filters
    firebird/trunk/extern/icu/source/layoutex/layoutex_10.vcxproj
    firebird/trunk/extern/icu/source/layoutex/layoutex_10.vcxproj.filters
    firebird/trunk/extern/icu/source/stubdata/stubdata_10.vcxproj
    firebird/trunk/extern/icu/source/stubdata/stubdata_10.vcxproj.filters
    firebird/trunk/extern/icu/source/test/cintltst/cintltst_10.vcxproj
    firebird/trunk/extern/icu/source/test/cintltst/cintltst_10.vcxproj.filters
    firebird/trunk/extern/icu/source/test/intltest/intltest_10.vcxproj
    firebird/trunk/extern/icu/source/test/intltest/intltest_10.vcxproj.filters
    firebird/trunk/extern/icu/source/test/iotest/iotest_10.vcxproj
    firebird/trunk/extern/icu/source/test/iotest/iotest_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/ctestfw/ctestfw_10.vcxproj
    firebird/trunk/extern/icu/source/tools/ctestfw/ctestfw_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/genbrk/genbrk_10.vcxproj
    firebird/trunk/extern/icu/source/tools/genbrk/genbrk_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/genccode/genccode_10.vcxproj
    firebird/trunk/extern/icu/source/tools/genccode/genccode_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/gencmn/decmn_10.vcxproj
    firebird/trunk/extern/icu/source/tools/gencmn/decmn_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/gencmn/gencmn_10.vcxproj
    firebird/trunk/extern/icu/source/tools/gencmn/gencmn_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/gencnval/gencnval_10.vcxproj
    firebird/trunk/extern/icu/source/tools/gencnval/gencnval_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/gennames/gennames_10.vcxproj
    firebird/trunk/extern/icu/source/tools/gennames/gennames_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/gennorm/gennorm_10.vcxproj
    firebird/trunk/extern/icu/source/tools/gennorm/gennorm_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/genpname/genpname_10.vcxproj
    firebird/trunk/extern/icu/source/tools/genpname/genpname_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/genprops/genprops_10.vcxproj
    firebird/trunk/extern/icu/source/tools/genprops/genprops_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/genrb/derb_10.vcxproj
    firebird/trunk/extern/icu/source/tools/genrb/derb_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/genrb/genrb_10.vcxproj
    firebird/trunk/extern/icu/source/tools/genrb/genrb_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/gensprep/gensprep_10.vcxproj
    firebird/trunk/extern/icu/source/tools/gensprep/gensprep_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/gentest/gentest_10.vcxproj
    firebird/trunk/extern/icu/source/tools/gentest/gentest_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/genuca/genuca_10.vcxproj
    firebird/trunk/extern/icu/source/tools/genuca/genuca_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/icuswap/icuswap_10.vcxproj
    firebird/trunk/extern/icu/source/tools/icuswap/icuswap_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/makeconv/makeconv_10.vcxproj
    firebird/trunk/extern/icu/source/tools/makeconv/makeconv_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/pkgdata/pkgdata_10.vcxproj
    firebird/trunk/extern/icu/source/tools/pkgdata/pkgdata_10.vcxproj.filters
    firebird/trunk/extern/icu/source/tools/toolutil/toolutil_10.vcxproj
    firebird/trunk/extern/icu/source/tools/toolutil/toolutil_10.vcxproj.filters
Added: firebird/trunk/builds/win32/msvc10/DllNoEmbedManifest.props
===================================================================
--- firebird/trunk/builds/win32/msvc10/DllNoEmbedManifest.props	                        (rev 0)
+++ firebird/trunk/builds/win32/msvc10/DllNoEmbedManifest.props	2010-06-27 03:47:40 UTC (rev 51295)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+    <GenerateManifest>false</GenerateManifest>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
Property changes on: firebird/trunk/builds/win32/msvc10/DllNoEmbedManifest.props
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
Added: firebird/trunk/builds/win32/msvc10/Firebird2.sln
===================================================================
--- firebird/trunk/builds/win32/msvc10/Firebird2.sln	                        (rev 0)
+++ firebird/trunk/builds/win32/msvc10/Firebird2.sln	2010-06-27 03:47:40 UTC (rev 51295)
@@ -0,0 +1,423 @@
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "alice", "alice.vcxproj", "{0D616380-1A5A-4230-A80B-021360E4E669}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "burp", "burp.vcxproj", "{D1507562-A363-4685-96AF-B036F5E5E47F}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common.vcxproj", "{15605F44-BFFD-444F-AD4C-55DC9D704465}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common_classic", "common_classic.vcxproj", "{F5746066-8613-4811-B27C-0ED70FF9F0FF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsql_server", "dsql_server.vcxproj", "{520DF501-5775-44FD-BDC6-37753A17696A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dsql_server_classic", "dsql_server_classic.vcxproj", "{488199DD-D9F3-41C8-AED6-8AFFFB294CFF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine", "engine.vcxproj", "{F8798A49-9D20-451E-A7BD-FEB5237103B5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine_classic", "engine_classic.vcxproj", "{E029E4E2-0C3F-4F7D-BC4C-D9C20F40EB4E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine_embed", "engine_embed.vcxproj", "{F55ACA54-70DF-4343-8E16-FA97C757CCF6}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fb_inet_server", "fb_inet_server.vcxproj", "{664D4A04-36E0-48EF-8BCA-D5C331EFAA24}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fb_lock_print", "fb_lock_print.vcxproj", "{E8397148-0E9C-449B-9F45-7FB377A08242}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fbclient", "fbclient.vcxproj", "{492E7BDA-8948-408D-A43E-4C0A5B86AFB8}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fbembed", "fbembed.vcxproj", "{C5A60E3D-7815-4127-B856-96277BEC1D11}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fbguard", "fbguard.vcxproj", "{BBD83ED3-8A48-4FE8-B4B7-CB27730986B2}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fbserver", "fbserver.vcxproj", "{23EC8DAA-6718-4EF3-979F-89F611C7D504}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fbudf", "fbudf.vcxproj", "{9DC67B05-AC3E-49A3-B0CC-83B25D757445}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gbak", "gbak.vcxproj", "{B732F5D2-B5D9-417F-B156-D790F466CB8E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gfix", "gfix.vcxproj", "{44A9E4AD-B932-4620-B319-431A153BB341}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gpre", "gpre.vcxproj", "{D84F0839-28A4-40B2-B5F4-F5E1E7F48FD0}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsec", "gsec.vcxproj", "{7043CC61-DEC1-4C6B-86B9-0E911D1094C9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gsplit", "gsplit.vcxproj", "{B7F22B7F-9937-4874-9A8B-6AB4E36E74A5}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gstat", "gstat.vcxproj", "{7E862973-37C4-4202-80E7-490ED4DEDA14}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ib_udf", "ib_udf.vcxproj", "{0D4A2D8E-6461-479E-9399-F7929174E050}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ib_util", "ib_util.vcxproj", "{EABA0FF3-1C4D-4FAB-8418-31C9061F3F0D}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "instreg", "instreg.vcxproj", "{19470DE6-1975-4F9B-B1BE-E87A83240B15}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "instsvc", "instsvc.vcxproj", "{72894398-38CA-47A6-95FE-9647DE2BE968}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "intl", "intl.vcxproj", "{DFFA2117-E6A8-4806-BB69-94DAC8F8F42A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "isql", "isql.vcxproj", "{DEE75AD5-F165-40E1-80B2-400E27725D5C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lock", "lock.vcxproj", "{604E1144-1A22-43AF-9A3E-08650EE4EE90}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lock_classic", "lock_classic.vcxproj", "{213C6F21-D83F-48C7-BBB5-B35AB1B706B1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "qli", "qli.vcxproj", "{EBB8361B-49D5-43A5-8771-940DF3E308EF}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "remote", "remote.vcxproj", "{4BCC693D-1745-45ED-8302-E5E2F979549A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nbackup", "nbackup.vcxproj", "{01A41DFA-8908-4576-A1F1-C8BC7EAE39A1}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "config", "config.vcxproj", "{E83187C1-AAC2-445D-B8B2-883EFC10C39A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "instclient", "instclient.vcxproj", "{C6A31374-178C-4680-A404-76BE24D0229B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fb2control", "fb2control.vcxproj", "{1AE02D41-7E24-43CC-9BCB-E4CEB6037D16}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fbrmclib", "fbrmclib.vcxproj", "{FAF9AD25-8238-49E9-9AC9-8C56E190440A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fbsvcmgr", "fbsvcmgr.vcxproj", "{EFB07DBC-36E3-4C54-B941-3CDAFAACF47B}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fbtrace", "fbtrace.vcxproj", "{53F75437-15B8-4A5C-86BF-E238CC68FCBC}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fbtracemgr", "fbtracemgr.vcxproj", "{58C7E370-0EDD-4F5E-8617-3F5071170205}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udr_engine", "udr_engine.vcxproj", "{20DEBF08-EF0A-4C94-ADEB-FE9BBA14588B}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{0D616380-1A5A-4230-A80B-021360E4E669}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0D616380-1A5A-4230-A80B-021360E4E669}.Debug|Win32.Build.0 = Debug|Win32
+		{0D616380-1A5A-4230-A80B-021360E4E669}.Debug|x64.ActiveCfg = Debug|x64
+		{0D616380-1A5A-4230-A80B-021360E4E669}.Debug|x64.Build.0 = Debug|x64
+		{0D616380-1A5A-4230-A80B-021360E4E669}.Release|Win32.ActiveCfg = Release|Win32
+		{0D616380-1A5A-4230-A80B-021360E4E669}.Release|Win32.Build.0 = Release|Win32
+		{0D616380-1A5A-4230-A80B-021360E4E669}.Release|x64.ActiveCfg = Release|x64
+		{0D616380-1A5A-4230-A80B-021360E4E669}.Release|x64.Build.0 = Release|x64
+		{D1507562-A363-4685-96AF-B036F5E5E47F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D1507562-A363-4685-96AF-B036F5E5E47F}.Debug|Win32.Build.0 = Debug|Win32
+		{D1507562-A363-4685-96AF-B036F5E5E47F}.Debug|x64.ActiveCfg = Debug|x64
+		{D1507562-A363-4685-96AF-B036F5E5E47F}.Debug|x64.Build.0 = Debug|x64
+		{D1507562-A363-4685-96AF-B036F5E5E47F}.Release|Win32.ActiveCfg = Release|Win32
+		{D1507562-A363-4685-96AF-B036F5E5E47F}.Release|Win32.Build.0 = Release|Win32
+		{D1507562-A363-4685-96AF-B036F5E5E47F}.Release|x64.ActiveCfg = Release|x64
+		{D1507562-A363-4685-96AF-B036F5E5E47F}.Release|x64.Build.0 = Release|x64
+		{15605F44-BFFD-444F-AD4C-55DC9D704465}.Debug|Win32.ActiveCfg = Debug|Win32
+		{15605F44-BFFD-444F-AD4C-55DC9D704465}.Debug|Win32.Build.0 = Debug|Win32
+		{15605F44-BFFD-444F-AD4C-55DC9D704465}.Debug|x64.ActiveCfg = Debug|x64
+		{15605F44-BFFD-444F-AD4C-55DC9D704465}.Debug|x64.Build.0 = Debug|x64
+		{15605F44-BFFD-444F-AD4C-55DC9D704465}.Release|Win32.ActiveCfg = Release|Win32
+		{15605F44-BFFD-444F-AD4C-55DC9D704465}.Release|Win32.Build.0 = Release|Win32
+		{15605F44-BFFD-444F-AD4C-55DC9D704465}.Release|x64.ActiveCfg = Release|x64
+		{15605F44-BFFD-444F-AD4C-55DC9D704465}.Release|x64.Build.0 = Release|x64
+		{F5746066-8613-4811-B27C-0ED70FF9F0FF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F5746066-8613-4811-B27C-0ED70FF9F0FF}.Debug|Win32.Build.0 = Debug|Win32
+		{F5746066-8613-4811-B27C-0ED70FF9F0FF}.Debug|x64.ActiveCfg = Debug|x64
+		{F5746066-8613-4811-B27C-0ED70FF9F0FF}.Debug|x64.Build.0 = Debug|x64
+		{F5746066-8613-4811-B27C-0ED70FF9F0FF}.Release|Win32.ActiveCfg = Release|Win32
+		{F5746066-8613-4811-B27C-0ED70FF9F0FF}.Release|Win32.Build.0 = Release|Win32
+		{F5746066-8613-4811-B27C-0ED70FF9F0FF}.Release|x64.ActiveCfg = Release|x64
+		{F5746066-8613-4811-B27C-0ED70FF9F0FF}.Release|x64.Build.0 = Release|x64
+		{520DF501-5775-44FD-BDC6-37753A17696A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{520DF501-5775-44FD-BDC6-37753A17696A}.Debug|Win32.Build.0 = Debug|Win32
+		{520DF501-5775-44FD-BDC6-37753A17696A}.Debug|x64.ActiveCfg = Debug|x64
+		{520DF501-5775-44FD-BDC6-37753A17696A}.Debug|x64.Build.0 = Debug|x64
+		{520DF501-5775-44FD-BDC6-37753A17696A}.Release|Win32.ActiveCfg = Release|Win32
+		{520DF501-5775-44FD-BDC6-37753A17696A}.Release|Win32.Build.0 = Release|Win32
+		{520DF501-5775-44FD-BDC6-37753A17696A}.Release|x64.ActiveCfg = Release|x64
+		{520DF501-5775-44FD-BDC6-37753A17696A}.Release|x64.Build.0 = Release|x64
+		{488199DD-D9F3-41C8-AED6-8AFFFB294CFF}.Debug|Win32.ActiveCfg = Debug|Win32
+		{488199DD-D9F3-41C8-AED6-8AFFFB294CFF}.Debug|Win32.Build.0 = Debug|Win32
+		{488199DD-D9F3-41C8-AED6-8AFFFB294CFF}.Debug|x64.ActiveCfg = Debug|x64
+		{488199DD-D9F3-41C8-AED6-8AFFFB294CFF}.Debug|x64.Build.0 = Debug|x64
+		{488199DD-D9F3-41C8-AED6-8AFFFB294CFF}.Release|Win32.ActiveCfg = Release|Win32
+		{488199DD-D9F3-41C8-AED6-8AFFFB294CFF}.Release|Win32.Build.0 = Release|Win32
+		{488199DD-D9F3-41C8-AED6-8AFFFB294CFF}.Release|x64.ActiveCfg = Release|x64
+		{488199DD-D9F3-41C8-AED6-8AFFFB294CFF}.Release|x64.Build.0 = Release|x64
+		{F8798A49-9D20-451E-A7BD-FEB5237103B5}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F8798A49-9D20-451E-A7BD-FEB5237103B5}.Debug|Win32.Build.0 = Debug|Win32
+		{F8798A49-9D20-451E-A7BD-FEB5237103B5}.Debug|x64.ActiveCfg = Debug|x64
+		{F8798A49-9D20-451E-A7BD-FEB5237103B5}.Debug|x64.Build.0 = Debug|x64
+		{F8798A49-9D20-451E-A7BD-FEB5237103B5}.Release|Win32.ActiveCfg = Release|Win32
+		{F8798A49-9D20-451E-A7BD-FEB5237103B5}.Release|Win32.Build.0 = Release|Win32
+		{F8798A49-9D20-451E-A7BD-FEB5237103B5}.Release|x64.ActiveCfg = Release|x64
+		{F8798A49-9D20-451E-A7BD-FEB5237103B5}.Release|x64.Build.0 = Release|x64
+		{E029E4E2-0C3F-4F7D-BC4C-D9C20F40EB4E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E029E4E2-0C3F-4F7D-BC4C-D9C20F40EB4E}.Debug|Win32.Build.0 = Debug|Win32
+		{E029E4E2-0C3F-4F7D-BC4C-D9C20F40EB4E}.Debug|x64.ActiveCfg = Debug|x64
+		{E029E4E2-0C3F-4F7D-BC4C-D9C20F40EB4E}.Debug|x64.Build.0 = Debug|x64
+		{E029E4E2-0C3F-4F7D-BC4C-D9C20F40EB4E}.Release|Win32.ActiveCfg = Release|Win32
+		{E029E4E2-0C3F-4F7D-BC4C-D9C20F40EB4E}.Release|Win32.Build.0 = Release|Win32
+		{E029E4E2-0C3F-4F7D-BC4C-D9C20F40EB4E}.Release|x64.ActiveCfg = Release|x64
+		{E029E4E2-0C3F-4F7D-BC4C-D9C20F40EB4E}.Release|x64.Build.0 = Release|x64
+		{F55ACA54-70DF-4343-8E16-FA97C757CCF6}.Debug|Win32.ActiveCfg = Debug|Win32
+		{F55ACA54-70DF-4343-8E16-FA97C757CCF6}.Debug|Win32.Build.0 = Debug|Win32
+		{F55ACA54-70DF-4343-8E16-FA97C757CCF6}.Debug|x64.ActiveCfg = Debug|x64
+		{F55ACA54-70DF-4343-8E16-FA97C757CCF6}.Debug|x64.Build.0 = Debug|x64
+		{F55ACA54-70DF-4343-8E16-FA97C757CCF6}.Release|Win32.ActiveCfg = Release|Win32
+		{F55ACA54-70DF-4343-8E16-FA97C757CCF6}.Release|Win32.Build.0 = Release|Win32
+		{F55ACA54-70DF-4343-8E16-FA97C757CCF6}.Release|x64.ActiveCfg = Release|x64
+		{F55ACA54-70DF-4343-8E16-FA97C757CCF6}.Release|x64.Build.0 = Release|x64
+		{664D4A04-36E0-48EF-8BCA-D5C331EFAA24}.Debug|Win32.ActiveCfg = Debug|Win32
+		{664D4A04-36E0-48EF-8BCA-D5C331EFAA24}.Debug|Win32.Build.0 = Debug|Win32
+		{664D4A04-36E0-48EF-8BCA-D5C331EFAA24}.Debug|x64.ActiveCfg = Debug|x64
+		{664D4A04-36E0-48EF-8BCA-D5C331EFAA24}.Debug|x64.Build.0 = Debug|x64
+		{664D4A04-36E0-48EF-8BCA-D5C331EFAA24}.Release|Win32.ActiveCfg = Release|Win32
+		{664D4A04-36E0-48EF-8BCA-D5C331EFAA24}.Release|Win32.Build.0 = Release|Win32
+		{664D4A04-36E0-48EF-8BCA-D5C331EFAA24}.Release|x64.ActiveCfg = Release|x64
+		{664D4A04-36E0-48EF-8BCA-D5C331EFAA24}.Release|x64.Build.0 = Release|x64
+		{E8397148-0E9C-449B-9F45-7FB377A08242}.Debug|Win32.ActiveCfg = Debug|Win32
+		{E8397148-0E9C-449B-9F45-7FB377A08242}.Debug|Win32.Build.0 = Debug|Win32
+		{E8397148-0E9C-449B-9F45-7FB377A08242}.Debug|x64.ActiveCfg = Debug|x64
+		{E8397148-0E9C-449B-9F45-7FB377A08242}.Debug|x64.Build.0 = Debug|x64
+		{E8397148-0E9C-449B-9F45-7FB377A08242}.Release|Win32.ActiveCfg = Release|Win32
+		{E8397148-0E9C-449B-9F45-7FB377A08242}.Release|Win32.Build.0 = Release|Win32
+		{E8397148-0E9C-449B-9F45-7FB377A08242}.Release|x64.ActiveCfg = Release|x64
+		{E8397148-0E9C-449B-9F45-7FB377A08242}.Release|x64.Build.0 = Release|x64
+		{492E7BDA-8948-408D-A43E-4C0A5B86AFB8}.Debug|Win32.ActiveCfg = Debug|Win32
+		{492E7BDA-8948-408D-A43E-4C0A5B86AFB8}.Debug|Win32.Build.0 = Debug|Win32
+		{492E7BDA-8948-408D-A43E-4C0A5B86AFB8}.Debug|x64.ActiveCfg = Debug|x64
+		{492E7BDA-8948-408D-A43E-4C0A5B86AFB8}.Debug|x64.Build.0 = Debug|x64
+		{492E7BDA-8948-408D-A43E-4C0A5B86AFB8}.Release|Win32.ActiveCfg = Release|Win32
+		{492E7BDA-8948-408D-A43E-4C0A5B86AFB8}.Release|Win32.Build.0 = Release|Win32
+		{492E7BDA-8948-408D-A43E-4C0A5B86AFB8}.Release|x64.ActiveCfg = Release|x64
+		{492E7BDA-8948-408D-A43E-4C0A5B86AFB8}.Release|x64.Build.0 = Release|x64
+		{C5A60E3D-7815-4127-B856-96277BEC1D11}.Debug|Win32.ActiveCfg = Debug|Win32
+		{C5A60E3D-7815-4127-B856-96277BEC1D11}.Debug|Win32.Build.0 = Debug|Win32
+		{C5A60E3D-7815-4127-B856-96277BEC1D11}.Debug|x64.ActiveCfg = Debug|x64
+		{C5A60E3D-7815-4127-B856-96277BEC1D11}.Debug|x64.Build.0 = Debug|x64
+		{C5A60E3D-7815-4127-B856-96277BEC1D11}.Release|Win32.ActiveCfg = Release|Win32
+		{C5A60E3D-7815-4127-B856-96277BEC1D11}.Release|Win32.Build.0 = Release|Win32
+		{C5A60E3D-7815-4127-B856-96277BEC1D11}.Release|x64.ActiveCfg = Release|x64
+		{C5A60E3D-7815-4127-B856-96277BEC1D11}.Release|x64.Build.0 = Release|x64
+		{BBD83ED3-8A48-4FE8-B4B7-CB27730986B2}.Debug|Win32.ActiveCfg = Debug|Win32
+		{BBD83ED3-8A48-4FE8-B4B7-CB27730986B2}.Debug|Win32.Build.0 = Debug|Win32
+		{BBD83ED3-8A48-4FE8-B4B7-CB27730986B2}.Debug|x64.ActiveCfg = Debug|x64
+		{BBD83ED3-8A48-4FE8-B4B7-CB27730986B2}.Debug|x64.Build.0 = Debug|x64
+		{BBD83ED3-8A48-4FE8-B4B7-CB27730986B2}.Release|Win32.ActiveCfg = Release|Win32
+		{BBD83ED3-8A48-4FE8-B4B7-CB27730986B2}.Release|Win32.Build.0 = Release|Win32
+		{BBD83ED3-8A48-4FE8-B4B7-CB27730986B2}.Release|x64.ActiveCfg = Release|x64
+		{BBD83ED3-8A48-4FE8-B4B7-CB27730986B2}.Release|x64.Build.0 = Release|x64
+		{23EC8DAA-6718-4EF3-979F-89F611C7D504}.Debug|Win32.ActiveCfg = Debug|Win32
+		{23EC8DAA-6718-4EF3-979F-89F611C7D504}.Debug|Win32.Build.0 = Debug|Win32
+		{23EC8DAA-6718-4EF3-979F-89F611C7D504}.Debug|x64.ActiveCfg = Debug|x64
+		{23EC8DAA-6718-4EF3-979F-89F611C7D504}.Debug|x64.Build.0 = Debug|x64
+		{23EC8DAA-6718-4EF3-979F-89F611C7D504}.Release|Win32.ActiveCfg = Release|Win32
+		{23EC8DAA-6718-4EF3-979F-89F611C7D504}.Release|Win32.Build.0 = Release|Win32
+		{23EC8DAA-6718-4EF3-979F-89F611C7D504}.Release|x64.ActiveCfg = Release|x64
+		{23EC8DAA-6718-4EF3-979F-89F611C7D504}.Release|x64.Build.0 = Release|x64
+		{9DC67B05-AC3E-49A3-B0CC-83B25D757445}.Debug|Win32.ActiveCfg = Debug|Win32
+		{9DC67B05-AC3E-49A3-B0CC-83B25D757445}.Debug|Win32.Build.0 = Debug|Win32
+		{9DC67B05-AC3E-49A3-B0CC-83B25D757445}.Debug|x64.ActiveCfg = Debug|x64
+		{9DC67B05-AC3E-49A3-B0CC-83B25D757445}.Debug|x64.Build.0 = Debug|x64
+		{9DC67B05-AC3E-49A3-B0CC-83B25D757445}.Release|Win32.ActiveCfg = Release|Win32
+		{9DC67B05-AC3E-49A3-B0CC-83B25D757445}.Release|Win32.Build.0 = Release|Win32
+		{9DC67B05-AC3E-49A3-B0CC-83B25D757445}.Release|x64.ActiveCfg = Release|x64
+		{9DC67B05-AC3E-49A3-B0CC-83B25D757445}.Release|x64.Build.0 = Release|x64
+		{B732F5D2-B5D9-417F-B156-D790F466CB8E}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B732F5D2-B5D9-417F-B156-D790F466CB8E}.Debug|Win32.Build.0 = Debug|Win32
+		{B732F5D2-B5D9-417F-B156-D790F466CB8E}.Debug|x64.ActiveCfg = Debug|x64
+		{B732F5D2-B5D9-417F-B156-D790F466CB8E}.Debug|x64.Build.0 = Debug|x64
+		{B732F5D2-B5D9-417F-B156-D790F466CB8E}.Release|Win32.ActiveCfg = Release|Win32
+		{B732F5D2-B5D9-417F-B156-D790F466CB8E}.Release|Win32.Build.0 = Release|Win32
+		{B732F5D2-B5D9-417F-B156-D790F466CB8E}.Release|x64.ActiveCfg = Release|x64
+		{B732F5D2-B5D9-417F-B156-D790F466CB8E}.Release|x64.Build.0 = Release|x64
+		{44A9E4AD-B932-4620-B319-431A153BB341}.Debug|Win32.ActiveCfg = Debug|Win32
+		{44A9E4AD-B932-4620-B319-431A153BB341}.Debug|Win32.Build.0 = Debug|Win32
+		{44A9E4AD-B932-4620-B319-431A153BB341}.Debug|x64.ActiveCfg = Debug|x64
+		{44A9E4AD-B932-4620-B319-431A153BB341}.Debug|x64.Build.0 = Debug|x64
+		{44A9E4AD-B932-4620-B319-431A153BB341}.Release|Win32.ActiveCfg = Release|Win32
+		{44A9E4AD-B932-4620-B319-431A153BB341}.Release|Win32.Build.0 = Release|Win32
+		{44A9E4AD-B932-4620-B319-431A153BB341}.Release|x64.ActiveCfg = Release|x64
+		{44A9E4AD-B932-4620-B319-431A153BB341}.Release|x64.Build.0 = Release|x64
+		{D84F0839-28A4-40B2-B5F4-F5E1E7F48FD0}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D84F0839-28A4-40B2-B5F4-F5E1E7F48FD0}.Debug|Win32.Build.0 = Debug|Win32
+		{D84F0839-28A4-40B2-B5F4-F5E1E7F48FD0}.Debug|x64.ActiveCfg = Debug|x64
+		{D84F0839-28A4-40B2-B5F4-F5E1E7F48FD0}.Debug|x64.Build.0 = Debug|x64
+		{D84F0839-28A4-40B2-B5F4-F5E1E7F48FD0}.Release|Win32.ActiveCfg = Release|Win32
+		{D84F08...
 
[truncated message content] | 
| 
      
      
      From: <asf...@us...> - 2010-07-06 00:49:41
       | 
| Revision: 51312
          http://firebird.svn.sourceforge.net/firebird/?rev=51312&view=rev
Author:   asfernandes
Date:     2010-07-06 00:49:33 +0000 (Tue, 06 Jul 2010)
Log Message:
-----------
Refactor CREATE/ALTER/DROP DOMAIN
Modified Paths:
--------------
    firebird/trunk/builds/win32/msvc10/common.vcxproj
    firebird/trunk/builds/win32/msvc10/common_classic.vcxproj
    firebird/trunk/builds/win32/msvc10/common_static.vcxproj
    firebird/trunk/builds/win32/msvc8/common.vcproj
    firebird/trunk/builds/win32/msvc8/common_classic.vcproj
    firebird/trunk/builds/win32/msvc8/common_static.vcproj
    firebird/trunk/builds/win32/msvc9/common.vcproj
    firebird/trunk/builds/win32/msvc9/common_classic.vcproj
    firebird/trunk/builds/win32/msvc9/common_static.vcproj
    firebird/trunk/src/dsql/BlrWriter.h
    firebird/trunk/src/dsql/DdlNodes.epp
    firebird/trunk/src/dsql/DdlNodes.h
    firebird/trunk/src/dsql/Nodes.h
    firebird/trunk/src/dsql/Parser.h
    firebird/trunk/src/dsql/ddl.cpp
    firebird/trunk/src/dsql/dsql.h
    firebird/trunk/src/dsql/node.h
    firebird/trunk/src/dsql/parse.y
    firebird/trunk/src/dsql/pass1.cpp
    firebird/trunk/src/jrd/Attachment.cpp
    firebird/trunk/src/jrd/Attachment.h
    firebird/trunk/src/jrd/drq.h
    firebird/trunk/src/jrd/dyn.epp
    firebird/trunk/src/jrd/dyn_def.epp
    firebird/trunk/src/jrd/dyn_del.epp
    firebird/trunk/src/jrd/dyn_df_proto.h
    firebird/trunk/src/jrd/dyn_dl_proto.h
    firebird/trunk/src/jrd/dyn_md_proto.h
    firebird/trunk/src/jrd/dyn_mod.epp
    firebird/trunk/src/jrd/ini.epp
Added Paths:
-----------
    firebird/trunk/src/common/classes/ByteChunk.h
Modified: firebird/trunk/builds/win32/msvc10/common.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/common.vcxproj	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/builds/win32/msvc10/common.vcxproj	2010-07-06 00:49:33 UTC (rev 51312)
@@ -181,6 +181,7 @@
     <ClInclude Include="..\..\..\src\common\classes\alloc.h" />
     <ClInclude Include="..\..\..\src\common\classes\array.h" />
     <ClInclude Include="..\..\..\src\common\classes\BaseStream.h" />
+    <ClInclude Include="..\..\..\src\common\classes\ByteChunk.h" />
     <ClInclude Include="..\..\..\src\common\classes\ClumpletReader.h" />
     <ClInclude Include="..\..\..\src\common\classes\ClumpletWriter.h" />
     <ClInclude Include="..\..\..\src\common\classes\condition.h" />
Modified: firebird/trunk/builds/win32/msvc10/common_classic.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/common_classic.vcxproj	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/builds/win32/msvc10/common_classic.vcxproj	2010-07-06 00:49:33 UTC (rev 51312)
@@ -181,6 +181,7 @@
     <ClInclude Include="..\..\..\src\common\classes\alloc.h" />
     <ClInclude Include="..\..\..\src\common\classes\array.h" />
     <ClInclude Include="..\..\..\src\common\classes\BaseStream.h" />
+    <ClInclude Include="..\..\..\src\common\classes\ByteChunk.h" />
     <ClInclude Include="..\..\..\src\common\classes\ClumpletReader.h" />
     <ClInclude Include="..\..\..\src\common\classes\ClumpletWriter.h" />
     <ClInclude Include="..\..\..\src\common\classes\condition.h" />
Modified: firebird/trunk/builds/win32/msvc10/common_static.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/common_static.vcxproj	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/builds/win32/msvc10/common_static.vcxproj	2010-07-06 00:49:33 UTC (rev 51312)
@@ -178,6 +178,7 @@
     <ClInclude Include="..\..\..\src\common\classes\alloc.h" />
     <ClInclude Include="..\..\..\src\common\classes\array.h" />
     <ClInclude Include="..\..\..\src\common\classes\BaseStream.h" />
+    <ClInclude Include="..\..\..\src\common\classes\ByteChunk.h" />
     <ClInclude Include="..\..\..\src\common\classes\ClumpletReader.h" />
     <ClInclude Include="..\..\..\src\common\classes\ClumpletWriter.h" />
     <ClInclude Include="..\..\..\src\common\config\config.h" />
Modified: firebird/trunk/builds/win32/msvc8/common.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc8/common.vcproj	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/builds/win32/msvc8/common.vcproj	2010-07-06 00:49:33 UTC (rev 51312)
@@ -429,6 +429,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\ByteChunk.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\ClumpletReader.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc8/common_classic.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc8/common_classic.vcproj	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/builds/win32/msvc8/common_classic.vcproj	2010-07-06 00:49:33 UTC (rev 51312)
@@ -429,6 +429,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\ByteChunk.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\ClumpletReader.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc8/common_static.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc8/common_static.vcproj	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/builds/win32/msvc8/common_static.vcproj	2010-07-06 00:49:33 UTC (rev 51312)
@@ -410,6 +410,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\ByteChunk.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\ClumpletReader.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc9/common.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/common.vcproj	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/builds/win32/msvc9/common.vcproj	2010-07-06 00:49:33 UTC (rev 51312)
@@ -430,6 +430,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\ByteChunk.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\ClumpletReader.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc9/common_classic.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/common_classic.vcproj	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/builds/win32/msvc9/common_classic.vcproj	2010-07-06 00:49:33 UTC (rev 51312)
@@ -430,6 +430,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\ByteChunk.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\ClumpletReader.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc9/common_static.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/common_static.vcproj	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/builds/win32/msvc9/common_static.vcproj	2010-07-06 00:49:33 UTC (rev 51312)
@@ -411,6 +411,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\ByteChunk.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\ClumpletReader.h"
 				>
 			</File>
Added: firebird/trunk/src/common/classes/ByteChunk.h
===================================================================
--- firebird/trunk/src/common/classes/ByteChunk.h	                        (rev 0)
+++ firebird/trunk/src/common/classes/ByteChunk.h	2010-07-06 00:49:33 UTC (rev 51312)
@@ -0,0 +1,55 @@
+/*
+ *  The contents of this file are subject to the Initial
+ *  Developer's Public License Version 1.0 (the "License");
+ *  you may not use this file except in compliance with the
+ *  License. You may obtain a copy of the License at
+ *  http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
+ *
+ *  Software distributed under the License is distributed AS IS,
+ *  WITHOUT WARRANTY OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing rights
+ *  and limitations under the License.
+ *
+ *  The Original Code was created by Adriano dos Santos Fernandes
+ *  for the Firebird Open Source RDBMS project.
+ *
+ *  Copyright (c) 2010 Adriano dos Santos Fernandes <adr...@gm...>
+ *  and all contributors signed below.
+ *
+ *  All Rights Reserved.
+ *  Contributor(s): ______________________________________.
+ */
+
+#ifndef COMMON_BYTE_CHUNK_H
+#define COMMON_BYTE_CHUNK_H
+
+#include "../common/classes/array.h"
+
+namespace Firebird {
+
+// Wrapper for different kinds of byte buffers.
+struct ByteChunk
+{
+	// Separate pointer/length buffer.
+	ByteChunk(const UCHAR* aData, size_t aLength)
+		: data(aData),
+		  length(aLength)
+	{
+	}
+
+	// Array<UCHAR> buffer.
+	// This constructor is intentionally not-explicit.
+	template <typename Storage>
+	ByteChunk(const Firebird::Array<UCHAR, Storage>& array)
+		: data(array.begin()),
+		  length(array.getCount())
+	{
+	}
+
+	const UCHAR* const data;
+	const size_t length;
+};
+
+}	// namespace Firebird
+
+#endif	// COMMON_BYTE_CHUNK_H
Property changes on: firebird/trunk/src/common/classes/ByteChunk.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
Modified: firebird/trunk/src/dsql/BlrWriter.h
===================================================================
--- firebird/trunk/src/dsql/BlrWriter.h	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/src/dsql/BlrWriter.h	2010-07-06 00:49:33 UTC (rev 51312)
@@ -132,8 +132,9 @@
 	ULONG getBaseOffset() const { return baseOffset; }
 	void setBaseOffset(ULONG value) { baseOffset = value; }
 
+	virtual bool isVersion4() = 0;
+
 protected:
-	virtual bool isVersion4() = 0;
 	virtual bool isDdlDyn() = 0;
 
 private:
Modified: firebird/trunk/src/dsql/DdlNodes.epp
===================================================================
--- firebird/trunk/src/dsql/DdlNodes.epp	2010-07-05 18:37:35 UTC (rev 51311)
+++ firebird/trunk/src/dsql/DdlNodes.epp	2010-07-06 00:49:33 UTC (rev 51312)
@@ -34,6 +34,7 @@
 #include "../jrd/PreparedStatement.h"
 #include "../jrd/blb_proto.h"
 #include "../jrd/cmp_proto.h"
+#include "../jrd/dsc_proto.h"
 #include "../jrd/dyn_dl_proto.h"
 #include "../jrd/dyn_ut_proto.h"
 #include "../jrd/exe_proto.h"
@@ -82,7 +83,89 @@
 	status_exception::raise(newVector);
 }
 
+// Update RDB$FIELDS received by reference.
+static void updateRdbFields(const TypeClause& type,
+	SSHORT& fieldType,
+	SSHORT& fieldLength,
+	SSHORT& fieldSubTypeNull, SSHORT& fieldSubType,
+	SSHORT& fieldScaleNull, SSHORT& fieldScale,
+	SSHORT& characterSetIdNull, SSHORT& characterSetId,
+	SSHORT& characterLengthNull, SSHORT& characterLength,
+	SSHORT& fieldPrecisionNull, SSHORT& fieldPrecision,
+	SSHORT& collationIdNull, SSHORT& collationId,
+	SSHORT& segmentLengthNull, SSHORT& segmentLength)
+{
+	// Initialize all nullable fields.
+	fieldSubTypeNull = fieldScaleNull = characterSetIdNull = characterLengthNull =
+		fieldPrecisionNull = collationIdNull = segmentLengthNull = TRUE;
 
+	if (type.type == dtype_blob)
+	{
+		fieldSubTypeNull = FALSE;
+		fieldSubType = type.subType;
+
+		fieldScaleNull = FALSE;
+		fieldScale = 0;
+
+		if (type.subType == isc_blob_text)
+		{
+			characterSetIdNull = FALSE;
+			characterSetId = type.charSetId;
+
+			collationIdNull = !type.collateSpecified;
+			collationId = type.collationId;
+		}
+
+		if (type.segLength != 0)
+		{
+			segmentLengthNull = FALSE;
+			segmentLength = type.segLength;
+		}
+	}
+	else if (type.type <= dtype_any_text)
+	{
+		fieldSubTypeNull = FALSE;
+		fieldSubType = type.subType;
+
+		fieldScaleNull = FALSE;
+		fieldScale = 0;
+
+		characterLengthNull = FALSE;
+		characterLength = type.charLength;
+
+		characterSetIdNull = FALSE;
+		characterSetId = type.charSetId;
+
+		collationIdNull = !type.collateSpecified;
+		collationId = type.collationId;
+	}
+	else
+	{
+		fieldScaleNull = FALSE;
+		fieldScale = type.scale;
+
+		if (DTYPE_IS_EXACT(type.type))
+		{
+			fieldPrecisionNull = FALSE;
+			fieldPrecision = type.precision;
+
+			fieldSubTypeNull = FALSE;
+			fieldSubType = type.subType;
+		}
+	}
+
+	if (type.type == dtype_varying)
+	{
+		fb_assert(type.length <= MAX_SSHORT);
+		fieldLength = (SSHORT) (type.length - sizeof(USHORT));
+	}
+	else
+		fieldLength = type.length;
+
+	fieldType = blr_dtypes[type.type];
+}
+
+
 //----------------------
 
 
@@ -225,94 +308,44 @@
 }
 
 
-MetaName DdlNode::storeGlobalField(thread_db* tdbb, jrd_tra* transaction, const TypeClause& parameter)
+MetaName DdlNode::storeGlobalField(thread_db* tdbb, jrd_tra* transaction, const TypeClause& field,
+	MetaName& name)
 {
-	MetaName name;
+	bool endStore = false;
 
-	AutoCacheRequest requestHandle(tdbb, drq_s_fld_src, DYN_REQUESTS);
-
-	STORE (REQUEST_HANDLE requestHandle TRANSACTION_HANDLE transaction)
-		FLD IN RDB$FIELDS
+	try
 	{
-		FLD.RDB$FIELD_SUB_TYPE.NULL = TRUE;
-		FLD.RDB$FIELD_SCALE.NULL = TRUE;
-		FLD.RDB$CHARACTER_SET_ID.NULL = TRUE;
-		FLD.RDB$CHARACTER_LENGTH.NULL = TRUE;
-		FLD.RDB$FIELD_PRECISION.NULL = TRUE;
-		FLD.RDB$COLLATION_ID.NULL = TRUE;
-		FLD.RDB$SEGMENT_LENGTH.NULL = TRUE;
+		if (name.isEmpty())
+			DYN_UTIL_generate_field_name(tdbb, NULL, name);
 
-		FLD.RDB$SYSTEM_FLAG = 0;
+		AutoCacheRequest requestHandle(tdbb, drq_s_fld_src, DYN_REQUESTS);
 
-		DYN_UTIL_generate_field_name(tdbb, NULL, name);
-		strcpy(FLD.RDB$FIELD_NAME, name.c_str());
-
-		if (parameter.type == dtype_blob)
+		STORE (REQUEST_HANDLE requestHandle TRANSACTION_HANDLE transaction)
+			FLD IN RDB$FIELDS
 		{
-			FLD.RDB$FIELD_SUB_TYPE.NULL = FALSE;
-			FLD.RDB$FIELD_SUB_TYPE = parameter.subType;
+			FLD.RDB$SYSTEM_FLAG = 0;
+			strcpy(FLD.RDB$FIELD_NAME, name.c_str());
 
-			FLD.RDB$FIELD_SCALE.NULL = FALSE;
-			FLD.RDB$FIELD_SCALE = 0;
+			updateRdbFields(field,
+				FLD.RDB$FIELD_TYPE,
+				FLD.RDB$FIELD_LENGTH,
+				FLD.RDB$FIELD_SUB_TYPE.NULL, FLD.RDB$FIELD_SUB_TYPE,
+				FLD.RDB$FIELD_SCALE.NULL, FLD.RDB$FIELD_SCALE,
+				FLD.RDB$CHARACTER_SET_ID.NULL, FLD.RDB$CHARACTER_SET_ID,
+				FLD.RDB$CHARACTER_LENGTH.NULL, FLD.RDB$CHARACTER_LENGTH,
+				FLD.RDB$FIELD_PRECISION.NULL, FLD.RDB$FIELD_PRECISION,
+				FLD.RDB$COLLATION_ID.NULL, FLD.RDB$COLLATION_ID,
+				FLD.RDB$SEGMENT_LENGTH.NULL, FLD.RDB$SEGMENT_LENGTH);
 
-			if (parameter.subType == isc_blob_text)
-			{
-				FLD.RDB$CHARACTER_SET_ID.NULL = FALSE;
-				FLD.RDB$CHARACTER_SET_ID = parameter.charSetId;
-
-				FLD.RDB$COLLATION_ID.NULL = !parameter.collateSpecified;
-				FLD.RDB$COLLATION_ID = parameter.collationId;
-			}
-
-			if (parameter.segLength != 0)
-			{
-				FLD.RDB$SEGMENT_LENGTH.NULL = FALSE;
-				FLD.RDB$SEGMENT_LENGTH = parameter.segLength;
-			}
+			endStore = true;
 		}
-		else if (parameter.type <= dtype_any_text)
-		{
-			FLD.RDB$FIELD_SUB_TYPE.NULL = FALSE;
-			FLD.RDB$FIELD_SUB_TYPE = parameter.subType;
-
-			FLD.RDB$FIELD_SCALE.NULL = FALSE;
-			FLD.RDB$FIELD_SCALE = 0;
-
-			FLD.RDB$CHARACTER_LENGTH.NULL = FALSE;
-			FLD.RDB$CHARACTER_LENGTH = parameter.charLength;
-
-			FLD.RDB$CHARACTER_SET_ID.NULL = FALSE;
-			FLD.RDB$CHARACTER_SET_ID = parameter.charSetId;
-
-			FLD.RDB$COLLATION_ID.NULL = !parameter.collateSpecified;
-			FLD.RDB$COLLATION_ID = parameter.collationId;
-		}
-		else
-		{
-			FLD.RDB$FIELD_SCALE.NULL = FALSE;
-			FLD.RDB$FIELD_SCALE = parameter.scale;
-
-			if (DTYPE_IS_EXACT(parameter.type))
-			{
-				FLD.RDB$FIELD_PRECISION.NULL = FALSE;
-				FLD.RDB$FIELD_PRECISION = parameter.precision;
-
-				FLD.RDB$FIELD_SUB_TYPE.NULL = FALSE;
-				FLD.RDB$FIELD_SUB_TYPE = parameter.subType;
-			}
-		}
-
-		if (parameter.type == dtype_varying)
-		{
-			fb_assert(parameter.length <= MAX_SSHORT);
-			FLD.RDB$FIELD_LENGTH = (SSHORT) (parameter.length - sizeof(USHORT));
-		}
-		else
-			FLD.RDB$FIELD_LENGTH = parameter.length;
-
-		FLD.RDB$FIELD_TYPE = blr_dtypes[parameter.type];
+		END_STORE
 	}
-	END_STORE
+	catch (const status_exception& ex)
+	{
+		// STORE RDB$FIELDS failed
+		rethrowMetaException(ex, ENCODE_ISC_MSG(13, DYN_MSG_FAC), endStore);
+	}
 
 	return name;
 }
@@ -956,13 +989,11 @@
 				{
 					FUN.RDB$FUNCTION_BLR.NULL = FALSE;
 					attachment->storeBinaryBlob(tdbb, transaction, &FUN.RDB$FUNCTION_BLR,
-						dsqlScratch->getBlrData().begin(),
-						dsqlScratch->getBlrData().getCount());
+						dsqlScratch->getBlrData());
 
 					FUN.RDB$DEBUG_INFO.NULL = FALSE;
 					attachment->storeBinaryBlob(tdbb, transaction, &FUN.RDB$DEBUG_INFO,
-						dsqlScratch->getDebugData().begin(),
-						dsqlScratch->getDebugData().getCount());
+						dsqlScratch->getDebugData());
 				}
 			}
 
@@ -1069,7 +1100,8 @@
 				strcpy(ARG.RDB$FIELD_SOURCE, parameter.typeOfName.c_str());
 			else
 			{
-				const MetaName fieldName = storeGlobalField(tdbb, transaction, parameter);
+				MetaName fieldName;
+				storeGlobalField(tdbb, transaction, parameter, fieldName);
 				strcpy(ARG.RDB$FIELD_SOURCE, fieldName.c_str());
 			}
 		}
@@ -1119,8 +1151,7 @@
 			dsqlScratch->appendUChar(blr_eoc);
 
 			attachment->storeBinaryBlob(tdbb, transaction, &ARG.RDB$DEFAULT_VALUE,
-				dsqlScratch->getBlrData().begin(),
-				dsqlScratch->getBlrData().getCount());
+				dsqlScratch->getBlrData());
 		}
 	}
 	END_STORE
@@ -1756,13 +1787,11 @@
 				{
 					P.RDB$PROCEDURE_BLR.NULL = FALSE;
 					attachment->storeBinaryBlob(tdbb, transaction, &P.RDB$PROCEDURE_BLR,
-						dsqlScratch->getBlrData().begin(),
-						dsqlScratch->getBlrData().getCount());
+						dsqlScratch->getBlrData());
 
 					P.RDB$DEBUG_INFO.NULL = FALSE;
 					attachment->storeBinaryBlob(tdbb, transaction, &P.RDB$DEBUG_INFO,
-						dsqlScratch->getDebugData().begin(),
-						dsqlScratch->getDebugData().getCount());
+						dsqlScratch->getDebugData());
 
 					P.RDB$PROCEDURE_TYPE.NULL = FALSE;
 					P.RDB$PROCEDURE_TYPE = (USHORT)
@@ -1874,7 +1903,8 @@
 				strcpy(PRM.RDB$FIELD_SOURCE, parameter.typeOfName.c_str());
 			else
 			{
-				const MetaName fieldName = storeGlobalField(tdbb, transaction, parameter);
+				MetaName fieldName;
+				storeGlobalField(tdbb, transaction, parameter, fieldName);
 				strcpy(PRM.RDB$FIELD_SOURCE, fieldName.c_str());
 			}
 		}
@@ -1921,8 +1951,7 @@
 			dsqlScratch->appendUChar(blr_eoc);
 
 			attachment->storeBinaryBlob(tdbb, transaction, &PRM.RDB$DEFAULT_VALUE,
-				dsqlScratch->getBlrData().begin(),
-				dsqlScratch->getBlrData().getCount());
+				dsqlScratch->getBlrData());
 		}
 	}
 	END_STORE
@@ -2458,13 +2487,11 @@
 				{
 					TRG.RDB$TRIGGER_BLR.NULL = FALSE;
 					attachment->storeBinaryBlob(tdbb, transaction, &TRG.RDB$TRIGGER_BLR,
-						dsqlScratch->getBlrData().begin(),
-						dsqlScratch->getBlrData().getCount());
+						dsqlScratch->getBlrData());
 
 					TRG.RDB$DEBUG_INFO.NULL = FALSE;
 					attachment->storeBinaryBlob(tdbb, transaction, &TRG.RDB$DEBUG_INFO,
-						dsqlScratch->getDebugData().begin(),
-						dsqlScratch->getDebugData().getCount());
+						dsqlScratch->getDebugData());
 				}
 
 				if (source.hasData())
@@ -3105,6 +3132,1027 @@
 //----------------------
 
 
+void CreateDomainNode::print(string& text, Array<dsql_nod*>& nodes) const
+{
+	string nameTypeStr;
+	nameType.print(nameTypeStr);
+
+	text =
+		"CreateDomainNode\n"
+		"  " + nameTypeStr + "\n";
+}
+
+void CreateDomainNode::execute(thread_db* tdbb, jrd_tra* transaction)
+{
+	Attachment* attachment = transaction->tra_attachment;
+
+	if (fb_utils::implicit_domain(nameType.name.c_str()))
+	{
+		status_exception::raise(
+			Arg::Gds(isc_sqlerr) << Arg::Num(-637) <<
+			Arg::Gds(isc_dsql_implicit_domain_name) << nameType.name);
+	}
+
+	const dsql_nod* elements = nameType.legacyField->fld_ranges;
+	const USHORT dims = elements ? elements->nod_count / 2 : 0;
+
+	if (nameType.legacyDefault && dims != 0)
+	{
+		// Default value is not allowed for array type in domain %s
+		status_exception::raise(Arg::Gds(isc_no_meta_update) <<
+								Arg::Gds(ENCODE_ISC_MSG(226, DYN_MSG_FAC)) << nameType.name);
+	}
+
+	if (dims > MAX_ARRAY_DIMENSIONS)
+	{
+		status_exception::raise(
+			Arg::Gds(isc_sqlerr) << Arg::Num(-604) <<
+			Arg::Gds(isc_dsql_max_arr_dim_exceeded));
+	}
+
+	nameType.resolve(dsqlScratch);
+
+	dsqlScratch->domainValue.dsc_dtype = nameType.type;
+	dsqlScratch->domainValue.dsc_length = nameType.length;
+	dsqlScratch->domainValue.dsc_scale = nameType.scale;
+
+	// run all statements under savepoint control
+	AutoSavePoint savePoint(tdbb, transaction);
+
+	executeDdlTrigger(tdbb, transaction, DTW_BEFORE, DDL_TRIGGER_CREATE_DOMAIN, nameType.name);
+
+	storeGlobalField(tdbb, transaction, nameType, nameType.name);
+
+	if (nameType.legacyDefault || check || notNull || dims != 0)
+	{
+		AutoCacheRequest request(tdbb, drq_m_fld, DYN_REQUESTS);
+
+		FOR (REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+			FLD IN RDB$FIELDS
+			WITH FLD.RDB$FIELD_NAME EQ nameType.name.c_str()
+		{
+			MODIFY FLD
+				if (nameType.legacyDefault)
+				{
+					dsql_str* defaultString =
+						(dsql_str*) nameType.legacyDefault->nod_arg[e_dft_default_source];
+					string defaultSource = string(defaultString->str_data, defaultString->str_length);
+
+					FLD.RDB$DEFAULT_SOURCE.NULL = FALSE;
+					attachment->storeMetaDataBlob(tdbb, transaction, &FLD.RDB$DEFAULT_SOURCE, defaultSource);
+
+					dsqlScratch->getBlrData().clear();
+					dsqlScratch->appendUChar(dsqlScratch->isVersion4() ? blr_version4 : blr_version5);
+
+					dsql_nod* node = PASS1_node(dsqlScratch, nameType.legacyDefault->nod_arg[e_dft_default]);
+
+					GEN_hidden_variables(dsqlScratch, true);
+					GEN_expr(dsqlScratch, node);
+
+					dsqlScratch->appendUChar(blr_eoc);
+
+					FLD.RDB$DEFAULT_VALUE.NULL = FALSE;
+					attachment->storeBinaryBlob(tdbb, transaction, &FLD.RDB$DEFAULT_VALUE,
+						dsqlScratch->getBlrData());
+				}
+
+				if (check)
+				{
+					dsql_str* checkString = (dsql_str*) check->nod_arg[e_cnstr_source];
+					string checkSource = string(checkString->str_data, checkString->str_length);
+
+					FLD.RDB$VALIDATION_SOURCE.NULL = FALSE;
+					attachment->storeMetaDataBlob(tdbb, transaction, &FLD.RDB$VALIDATION_SOURCE, checkSource);
+
+					dsqlScratch->getBlrData().clear();
+					dsqlScratch->appendUChar(dsqlScratch->isVersion4() ? blr_version4 : blr_version5);
+
+					// Increment the context level for this statement, so that the context number for
+					// any RSE generated for a SELECT within the CHECK clause will be greater than 0.
+					// In the environment of a domain check constraint, context number 0 is reserved
+					// for the "blr_fid, 0, 0, 0," which is emitted for a nod_dom_value, corresponding
+					// to an occurance of the VALUE keyword in the body of the check constraint.
+					// -- chrisj 1999-08-20
+					++dsqlScratch->contextNumber;
+
+					dsql_nod* node = PASS1_node(dsqlScratch, check->nod_arg[e_cnstr_condition]);
+
+					GEN_hidden_variables(dsqlScratch, true);
+					GEN_expr(dsqlScratch, node);
+
+					dsqlScratch->appendUChar(blr_eoc);
+
+					FLD.RDB$VALIDATION_BLR.NULL = FALSE;
+					attachment->storeBinaryBlob(tdbb, transaction, &FLD.RDB$VALIDATION_BLR,
+						dsqlScratch->getBlrData());
+				}
+
+				if (notNull)
+				{
+					FLD.RDB$NULL_FLAG.NULL = FALSE;
+					FLD.RDB$NULL_FLAG = 1;
+				}
+
+				if (dims != 0)
+				{
+					FLD.RDB$DIMENSIONS.NULL = FALSE;
+					FLD.RDB$DIMENSIONS = dims;
+				}
+			END_MODIFY
+		}
+		END_FOR
+	}
+
+	if (elements)	// Is the type an array?
+	{
+		AutoCacheRequest request(tdbb, drq_s_fld_dym, DYN_REQUESTS);
+
+		SSHORT position = 0;
+		const dsql_nod* const* ptr = elements->nod_arg;
+		for (const dsql_nod* const* const end = ptr + elements->nod_count; ptr < end; ++ptr, ++position)
+		{
+			const dsql_nod* element = *ptr++;
+			const SLONG lrange = element->getSlong();
+			element = *ptr;
+			const SLONG hrange = element->getSlong();
+
+			if (lrange >= hrange)
+			{
+				status_exception::raise(
+					Arg::Gds(isc_sqlerr) << Arg::Num(-604) <<
+					Arg::Gds(isc_dsql_arr_range_error));
+			}
+
+			bool endStore = false;
+
+			try
+			{
+				STORE (REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+					DIM IN RDB$FIELD_DIMENSIONS
+				{
+					strcpy(DIM.RDB$FIELD_NAME, nameType.name.c_str());
+					DIM.RDB$DIMENSION = position;
+					DIM.RDB$UPPER_BOUND = hrange;
+					DIM.RDB$LOWER_BOUND = lrange;
+
+					endStore = true;
+				}
+				END_STORE
+
+			}
+			catch (const status_exception& ex)
+			{
+				// STORE RDB$FIELD_DIMENSIONS failed
+				rethrowMetaException(ex, ENCODE_ISC_MSG(3, DYN_MSG_FAC), endStore);
+			}
+		}
+	}
+
+	executeDdlTrigger(tdbb, transaction, DTW_AFTER, DDL_TRIGGER_CREATE_DOMAIN, nameType.name);
+
+	savePoint.release();	// everything is ok
+}
+
+
+//----------------------
+
+
+// Compare the original field type with the new field type to determine if the original type can be
+// changed to the new type.
+//
+// The following conversions are not allowed:
+//   Blob to anything
+//   Array to anything
+//   Date to anything
+//   Char to any numeric
+//   Varchar to any numeric
+//   Anything to Blob
+//   Anything to Array
+//
+// This function throws an exception if the conversion can not be made.
+//
+// ASF: We should stop using dyn_fld here as soon DYN stops to be a caller of this function.
+void AlterDomainNode::checkUpdate(const dyn_fld& origFld, const dyn_fld& newFld)
+{
+	ULONG errorCode = FB_SUCCESS;
+
+	// Check to make sure that the old and new types are compatible
+	switch (origFld.dyn_dtype)
+	{
+	// CHARACTER types
+	case blr_text:
+	case blr_varying:
+	case blr_cstring:
+		switch (newFld.dyn_dtype)
+		{
+		case blr_blob:
+		case blr_blob_id:
+			// Cannot change datatype for column %s.
+			// The operation cannot be performed on BLOB, or ARRAY columns.
+			errorCode = isc_dyn_dtype_invalid;
+			break;
+
+		case blr_sql_date:
+		case blr_sql_time:
+		case blr_timestamp:
+		case blr_int64:
+		case blr_long:
+		case blr_short:
+		case blr_d_float:
+		case blr_double:
+		case blr_float:
+			// Cannot convert column %s from character to non-character data.
+			errorCode = isc_dyn_dtype_conv_invalid;
+			break;
+
+		// If the original field is a character field and the new field is a character field,
+		// is there enough space in the new field?
+		case blr_text:
+		case blr_varying:
+		case blr_cstring:
+			{
+				// CVC: Because our caller invoked DSC_make_descriptor() on newFld previously,
+				// we should have the added bytes for varchar. For cstring, we are done, since
+				// DSC_make_descriptor(DSC_string_length) != DSC_string_length(DSC_make_descriptor).
+
+				const USHORT maxflen = DSC_string_length(&origFld.dyn_dsc);
+
+				// We can have this assertion since this case is for both string fields.
+				const ULONG new_len = DSC_string_length(&newFld.dyn_dsc);
+				fb_assert(new_len - maxflen == (ULONG) newFld.dyn_charbytelen - origFld.dyn_charbytelen);
+				// if (newFld.dyn_dsc.dsc_length < maxflen)
+				if (new_len < maxflen)
+				{
+					// msg 208: New size specified for column %s must be at least %d characters.
+					errorCode = isc_dyn_char_fld_too_small;
+				}
+			}
+			break;
+
+		default:
+			fb_assert(FALSE);
+			errorCode = 87;			// MODIFY RDB$FIELDS FAILED
+			break;
+		}
+		break;
+
+	// BLOB and ARRAY types
+	case blr_blob:
+	case blr_blob_id:
+		// Cannot change datatype for column %s.
+		// The operation cannot be performed on BLOB, or ARRAY columns.
+		errorCode = isc_dyn_dtype_invalid;
+		break;
+
+	// DATE types
+	case blr_sql_date:
+	case blr_sql_time:
+	case blr_timestamp:
+		switch (newFld.dyn_dtype)
+		{
+		case blr_sql_date:
+			if (origFld.dyn_dtype == blr_sql_time)
+			{
+				// Cannot change datatype for column %s.  Conversion from base type %s to base type %s is not supported.
+				errorCode = isc_dyn_invalid_dtype_conversion;
+			}
+			break;
+
+		case blr_sql_time:
+			if (origFld.dyn_dtype == blr_sql_date)
+			{
+				// Cannot change datatype for column %s.  Conversion from base type %s to base type %s is not supported.
+				errorCode = isc_dyn_invalid_dtype_conversion;
+			}
+			break;
+
+		case blr_timestamp:
+			if (origFld.dyn_dtype == blr_sql_time)
+			{
+				// Cannot change datatype for column %s.  Conversion from base type %s to base type %s is not supported.
+				errorCode = isc_dyn_invalid_dtype_conversion;
+			}
+			break;
+
+		// If the original field is a date field and the new field is a character field,
+		// is there enough space in the new field?
+		case blr_text:
+		case blr_text2:
+		case blr_varying:
+		case blr_varying2:
+		case blr_cstring:
+		case blr_cstring2:
+			{
+				const USHORT maxflen = DSC_string_length(&origFld.dyn_dsc);
+
+				// CVC: Solve bug #910423, missing DSC_string_length call.
+				// if (newFld.dyn_dsc.dsc_length < maxflen)
+				if (DSC_string_length(&newFld.dyn_dsc) < maxflen)
+				{
+					// msg 208: New size specified for column %s must be at least %d characters.
+					errorCode = isc_dyn_char_fld_too_small;
+				}
+			}
+
+			break;
+
+		default:
+			// Cannot change datatype for column %s.  Conversion from base type %s to base type %s is not supported.
+			errorCode = isc_dyn_invalid_dtype_conversion;
+			break;
+		}
+		break;
+
+	// NUMERIC types
+	case blr_int64:
+	case blr_long:
+	case blr_short:
+	case blr_d_float:
+	case blr_double:
+	case blr_float:
+		switch (newFld.dyn_dtype)
+		{
+		case blr_blob:
+		case blr_blob_id:
+			// Cannot change datatype for column %s.
+			// The operation cannot be performed on BLOB, or ARRAY columns.
+			errorCode = isc_dyn_dtype_invalid;
+			break;
+
+		case blr_sql_date:
+		case blr_sql_time:
+		case blr_timestamp:
+			// Cannot change datatype for column %s.  Conversion from base type %s to base type %s is not supported.
+			errorCode = isc_dyn_invalid_dtype_conversion;
+			break;
+
+		// If the original field is a numeric field and the new field is a numeric field,
+		// is there enough space in the new field (do not allow the base type to decrease)
+
+		case blr_short:
+			switch (origFld.dyn_dtype)
+			{
+			case blr_short:
+				errorCode = checkUpdateNumericType(origFld, newFld);
+				break;
+
+			default:
+				// Cannot change datatype for column %s.  Conversion from base type %s to base type %s is not supported.
+				errorCode = isc_dyn_invalid_dtype_conversion;
+				...
 
[truncated message content] | 
| 
      
      
      From: <ale...@us...> - 2010-07-09 12:51:12
       | 
| Revision: 51322
          http://firebird.svn.sourceforge.net/firebird/?rev=51322&view=rev
Author:   alexpeshkoff
Date:     2010-07-09 12:51:05 +0000 (Fri, 09 Jul 2010)
Log Message:
-----------
ODS change: made RDB$USERS system table, added virtual table SEC$USERS
Modified Paths:
--------------
    firebird/trunk/builds/posix/Makefile.in.firebird
    firebird/trunk/builds/posix/make.shared.variables
    firebird/trunk/src/dbs/security.sql
    firebird/trunk/src/include/gen/ids.h
    firebird/trunk/src/jrd/DatabaseSnapshot.cpp
    firebird/trunk/src/jrd/DatabaseSnapshot.h
    firebird/trunk/src/jrd/Relation.h
    firebird/trunk/src/jrd/UserManagement.cpp
    firebird/trunk/src/jrd/UserManagement.h
    firebird/trunk/src/jrd/constants.h
    firebird/trunk/src/jrd/fields.h
    firebird/trunk/src/jrd/idx.h
    firebird/trunk/src/jrd/ini.epp
    firebird/trunk/src/jrd/met.epp
    firebird/trunk/src/jrd/names.h
    firebird/trunk/src/jrd/opt.cpp
    firebird/trunk/src/jrd/recsrc/RecordSource.h
    firebird/trunk/src/jrd/relations.h
    firebird/trunk/src/jrd/svc.cpp
    firebird/trunk/src/jrd/types.h
    firebird/trunk/src/msgs/facilities2.sql
    firebird/trunk/src/msgs/messages2.sql
    firebird/trunk/src/utilities/gsec/gsec.cpp
    firebird/trunk/src/utilities/gsec/gsec.h
    firebird/trunk/src/utilities/gsec/gsecswi.h
    firebird/trunk/src/utilities/gsec/secur_proto.h
    firebird/trunk/src/utilities/gsec/security.epp
Added Paths:
-----------
    firebird/trunk/src/jrd/recsrc/UsersTableScan.cpp
Modified: firebird/trunk/builds/posix/Makefile.in.firebird
===================================================================
--- firebird/trunk/builds/posix/Makefile.in.firebird	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/builds/posix/Makefile.in.firebird	2010-07-09 12:51:05 UTC (rev 51322)
@@ -76,9 +76,7 @@
 #    use the static files as a last resort.
 #
 #  The bootstrap version of gpre (gpre_boot) is used to build all the
-#    engine files, except security.bin.  security.epp requires the security
-#    database which is not available at this time.  The code in jrd/alt.cpp
-#    that references the functions in security.bin has been #ifdef'ed out.
+#    engine file.  
 #    During this phase of the build process the limited version of alt.bin
 #    is used.  The full version of alt.bin is compiled later in the build
 #    process after the security database is available.  After the
Modified: firebird/trunk/builds/posix/make.shared.variables
===================================================================
--- firebird/trunk/builds/posix/make.shared.variables	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/builds/posix/make.shared.variables	2010-07-09 12:51:05 UTC (rev 51322)
@@ -53,7 +53,7 @@
 		recsrc/MergeJoin.cpp recsrc/NestedLoopJoin.cpp \
 		recsrc/ProcedureScan.cpp recsrc/RecordSource.cpp recsrc/RecursiveStream.cpp \
 		recsrc/SingularStream.cpp recsrc/SkipRowsStream.cpp recsrc/SortedStream.cpp recsrc/Union.cpp \
-		recsrc/VirtualTableScan.cpp recsrc/WindowedStream.cpp
+		recsrc/VirtualTableScan.cpp recsrc/UsersTableScan.cpp recsrc/WindowedStream.cpp
 
 JRD_ServerSources = $(addprefix jrd/, $(JRD_ServerFiles))
 JRD_ServerSources += gpre/pretty.cpp
@@ -357,7 +357,7 @@
 # MOD 29-July-2002
 
 # Stub for services entrypoints missing in static library
-STUB_Sources = jrd/svc_stub.cpp
+STUB_Sources = jrd/svc_stub.cpp utilities/gsec/security.epp
 STUB_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(STUB_Sources))))
 
 
Modified: firebird/trunk/src/dbs/security.sql
===================================================================
--- firebird/trunk/src/dbs/security.sql	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/dbs/security.sql	2010-07-09 12:51:05 UTC (rev 51322)
@@ -22,57 +22,6 @@
  *		(see http://www.volny.cz/iprenosil/interbase/ for details).
  */
 
-/* Domain definitions */
-CREATE DOMAIN RDB$COMMENT AS BLOB SUB_TYPE TEXT SEGMENT SIZE 80 CHARACTER SET UNICODE_FSS;
-CREATE DOMAIN RDB$NAME_PART AS VARCHAR(32) CHARACTER SET UNICODE_FSS DEFAULT _UNICODE_FSS '';
-CREATE DOMAIN RDB$GID AS INTEGER;
-CREATE DOMAIN RDB$PASSWD AS VARCHAR(64) CHARACTER SET BINARY;
-CREATE DOMAIN RDB$UID AS INTEGER;
-CREATE DOMAIN RDB$USER_NAME AS VARCHAR(128) CHARACTER SET UNICODE_FSS;
-CREATE DOMAIN RDB$USER_PRIVILEGE AS INTEGER;
-
-
-/*  Table: RDB$USERS */
-CREATE TABLE RDB$USERS (
-	RDB$USER_NAME 		RDB$USER_NAME NOT NULL PRIMARY KEY,
-	/* local system user name for setuid for file permissions */
-	RDB$SYS_USER_NAME	RDB$USER_NAME,
-	RDB$GROUP_NAME		RDB$USER_NAME,
-	RDB$UID 			RDB$UID,
-	RDB$GID 			RDB$GID,
-	RDB$PASSWD 			RDB$PASSWD NOT NULL,
-
-	/* Privilege level of user - mark a user as having DBA privilege */
-	RDB$PRIVILEGE 		RDB$USER_PRIVILEGE,
-
-	RDB$COMMENT 		RDB$COMMENT,
-	RDB$FIRST_NAME 		RDB$NAME_PART,
-	RDB$MIDDLE_NAME		RDB$NAME_PART,
-	RDB$LAST_NAME		RDB$NAME_PART);
-
-COMMIT;
-
-/*  View: USERS. Let's user modify his own password. */
-CREATE VIEW USERS (USER_NAME, SYS_USER_NAME, GROUP_NAME, UID, GID, PASSWD,
-		PRIVILEGE, COMMENT, FIRST_NAME, MIDDLE_NAME, LAST_NAME, FULL_NAME) AS
-	SELECT RDB$USER_NAME, RDB$SYS_USER_NAME, RDB$GROUP_NAME, RDB$UID, RDB$GID, RDB$PASSWD,
-		RDB$PRIVILEGE, RDB$COMMENT, RDB$FIRST_NAME, RDB$MIDDLE_NAME, RDB$LAST_NAME,
-		COALESCE (RDB$first_name || _UNICODE_FSS ' ', '') ||
-		COALESCE (RDB$middle_name || _UNICODE_FSS ' ', '') ||
-		COALESCE (RDB$last_name, '')
-	FROM RDB$USERS
-	WHERE CURRENT_USER = 'SYSDBA'
-	   OR CURRENT_ROLE = 'RDB$ADMIN'
-	   OR CURRENT_USER = RDB$USERS.RDB$USER_NAME;
-
-/*	Access rights */
-GRANT ALL ON RDB$USERS to VIEW USERS;
-GRANT SELECT ON USERS to PUBLIC;
-GRANT UPDATE(PASSWD, GROUP_NAME, UID, GID, FIRST_NAME, MIDDLE_NAME, LAST_NAME)
-	ON USERS TO PUBLIC;
-
-COMMIT;
-
 /*	Needed record - with PASSWD = random + SHA1 (random + 'SYSDBA' + crypt('masterke')) */
 INSERT INTO RDB$USERS(RDB$USER_NAME, RDB$PASSWD, RDB$FIRST_NAME, RDB$MIDDLE_NAME, RDB$LAST_NAME)
 	VALUES ('SYSDBA', 'NLtwcs9LrxLMOYhG0uGM9i6KS7mf3QAKvFVpmRg=', 'Sql', 'Server', 'Administrator');
Modified: firebird/trunk/src/include/gen/ids.h
===================================================================
--- firebird/trunk/src/include/gen/ids.h	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/include/gen/ids.h	2010-07-09 12:51:05 UTC (rev 51322)
@@ -592,3 +592,28 @@
 	const USHORT  f_pkg_desc = 6;
 
 
+// Relation 43 (RDB$USERS)
+
+	const USHORT  f_user_name = 0;
+	const USHORT  f_group_name = 1;
+	const USHORT  f_uid = 2;
+	const USHORT  f_gid = 3;
+	const USHORT  f_passwd_type = 4;
+	const USHORT  f_passwd = 5;
+	const USHORT  f_first_name = 6;
+	const USHORT  f_middle_name = 7;
+	const USHORT  f_last_name = 8;
+	const USHORT  f_user_desc = 9;
+
+
+// Relation 44 (SEC$USERS)
+
+	const USHORT  f_sec_user_name = 0;
+	const USHORT  f_sec_group_name = 1;
+	const USHORT  f_sec_uid = 2;
+	const USHORT  f_sec_gid = 3;
+	const USHORT  f_sec_first_name = 4;
+	const USHORT  f_sec_middle_name = 5;
+	const USHORT  f_sec_last_name = 6;
+
+
Modified: firebird/trunk/src/jrd/DatabaseSnapshot.cpp
===================================================================
--- firebird/trunk/src/jrd/DatabaseSnapshot.cpp	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/DatabaseSnapshot.cpp	2010-07-09 12:51:05 UTC (rev 51322)
@@ -370,7 +370,7 @@
 
 
 DatabaseSnapshot::DatabaseSnapshot(thread_db* tdbb, MemoryPool& pool)
-	: snapshot(pool), idMap(pool), idCounter(0)
+	: DataDump(pool), snapshot(pool)
 {
 	SET_TDBB(tdbb);
 
@@ -589,7 +589,7 @@
 	jrd_rel* relation = MET_lookup_relation_id(tdbb, rel_id, false);
 	fb_assert(relation);
 	MET_scan_relation(tdbb, relation);
-	fb_assert(relation->isVirtual());
+	fb_assert(relation->isVirtual() && !relation->isUsers());
 	Format* format = MET_current(tdbb, relation);
 	fb_assert(format);
 
@@ -601,7 +601,7 @@
 }
 
 
-void DatabaseSnapshot::clearRecord(Record* record)
+void DataDump::clearRecord(Record* record)
 {
 	fb_assert(record);
 
@@ -612,7 +612,7 @@
 }
 
 
-void DatabaseSnapshot::putField(thread_db* tdbb, Record* record, const DumpField& field,
+void DataDump::putField(thread_db* tdbb, Record* record, const DumpField& field,
 								int& charset, bool set_charset)
 {
 	fb_assert(record);
Modified: firebird/trunk/src/jrd/DatabaseSnapshot.h
===================================================================
--- firebird/trunk/src/jrd/DatabaseSnapshot.h	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/DatabaseSnapshot.h	2010-07-09 12:51:05 UTC (rev 51322)
@@ -18,6 +18,7 @@
  *
  *  All Rights Reserved.
  *  Contributor(s): ______________________________________.
+ *		Alex Peshkoff, 2010 - divided into class DataDump and the remaining part of DatabaseSnapshot
  */
 
 #ifndef JRD_DATABASE_SNAPSHOT_H
@@ -26,24 +27,36 @@
 #include "../common/classes/array.h"
 #include "../common/classes/init.h"
 #include "../jrd/isc_s_proto.h"
+#include "../common/classes/timestamp.h"
+#include "../jrd/val.h"
 
 namespace Jrd {
 
 // forward declarations
 class jrd_rel;
+class Record;
 class RecordBuffer;
 class RuntimeStatistics;
 
-class DatabaseSnapshot
+class DataDump
 {
+public:
 	enum ValueType {VALUE_GLOBAL_ID, VALUE_INTEGER, VALUE_TIMESTAMP, VALUE_STRING};
 
+	DataDump(MemoryPool& pool)
+		: idMap(pool), idCounter(0) { }
+
 	struct DumpField
 	{
+		DumpField(USHORT p_id, ValueType p_type, USHORT p_length, const void* p_data)
+			: id(p_id), type(p_type), length(p_length), data(p_data) { }
+		DumpField()
+			: id(0), type(VALUE_GLOBAL_ID), length(0), data(NULL) { }
+
 		USHORT id;
 		ValueType type;
 		USHORT length;
-		void* data;
+		const void* data;
 	};
 
 	class DumpRecord
@@ -178,6 +191,16 @@
 		ULONG sizeLimit;
 	};
 
+	void clearRecord(Record*);
+	void putField(thread_db*, Record*, const DumpField&, int&, bool = false);
+
+private:
+	Firebird::GenericMap<Firebird::Pair<Firebird::NonPooled<SINT64, SLONG> > > idMap;
+	int idCounter;
+};
+
+class DatabaseSnapshot : public DataDump
+{
 	struct RelationData
 	{
 		int rel_id;
@@ -321,8 +344,6 @@
 
 private:
 	RecordBuffer* allocBuffer(thread_db*, MemoryPool&, int);
-	void clearRecord(Record*);
-	void putField(thread_db*, Record*, const DumpField&, int&, bool = false);
 
 	static void dumpData(thread_db*);
 
@@ -338,8 +359,6 @@
 	static void putMemoryUsage(const Firebird::MemoryStats&, Writer&, int, int);
 
 	Firebird::Array<RelationData> snapshot;
-	Firebird::GenericMap<Firebird::Pair<Firebird::NonPooled<SINT64, SLONG> > > idMap;
-	int idCounter;
 };
 
 } // namespace
Modified: firebird/trunk/src/jrd/Relation.h
===================================================================
--- firebird/trunk/src/jrd/Relation.h	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/Relation.h	2010-07-09 12:51:05 UTC (rev 51322)
@@ -176,8 +176,8 @@
 {
 public:
 	USHORT			rel_id;
-	USHORT			rel_flags;
 	USHORT			rel_current_fmt;	// Current format number
+	ULONG			rel_flags;
 	Format*			rel_current_format;	// Current record format
 	Firebird::MetaName	rel_name;		// ascii relation name
 	vec<Format*>*	rel_formats;		// Known record formats
@@ -219,6 +219,7 @@
 	bool isSystem() const;
 	bool isTemporary() const;
 	bool isVirtual() const;
+	bool isUsers() const;
 
 	// global temporary relations attributes
 	RelationPages* getPages(thread_db* tdbb, SLONG tran = -1, bool allocPages = true);
@@ -282,22 +283,23 @@
 
 // rel_flags
 
-const USHORT REL_scanned				= 0x0001;	// Field expressions scanned (or being scanned)
-const USHORT REL_system					= 0x0002;
-const USHORT REL_deleted				= 0x0004;	// Relation known gonzo
-const USHORT REL_get_dependencies		= 0x0008;	// New relation needs dependencies during scan
-const USHORT REL_force_scan				= 0x0010;	// system relation has been updated since ODS change, force a scan
-const USHORT REL_check_existence		= 0x0020;	// Existence lock released pending drop of relation
-const USHORT REL_blocking				= 0x0040;	// Blocking someone from dropping relation
-const USHORT REL_sys_triggers			= 0x0080;	// The relation has system triggers to compile
-const USHORT REL_sql_relation			= 0x0100;	// Relation defined as sql table
-const USHORT REL_check_partners			= 0x0200;	// Rescan primary dependencies and foreign references
-const USHORT REL_being_scanned			= 0x0400;	// relation scan in progress
-const USHORT REL_sys_trigs_being_loaded	= 0x0800;	// System triggers being loaded
-const USHORT REL_deleting				= 0x1000;	// relation delete in progress
-const USHORT REL_temp_tran				= 0x2000;	// relation is a GTT delete rows
-const USHORT REL_temp_conn				= 0x4000;	// relation is a GTT preserve rows
-const USHORT REL_virtual				= 0x8000;	// relation is virtual
+const ULONG REL_scanned					= 0x0001;	// Field expressions scanned (or being scanned)
+const ULONG REL_system					= 0x0002;
+const ULONG REL_deleted					= 0x0004;	// Relation known gonzo
+const ULONG REL_get_dependencies		= 0x0008;	// New relation needs dependencies during scan
+const ULONG REL_force_scan				= 0x0010;	// system relation has been updated since ODS change, force a scan
+const ULONG REL_check_existence			= 0x0020;	// Existence lock released pending drop of relation
+const ULONG REL_blocking				= 0x0040;	// Blocking someone from dropping relation
+const ULONG REL_sys_triggers			= 0x0080;	// The relation has system triggers to compile
+const ULONG REL_sql_relation			= 0x0100;	// Relation defined as sql table
+const ULONG REL_check_partners			= 0x0200;	// Rescan primary dependencies and foreign references
+const ULONG REL_being_scanned			= 0x0400;	// relation scan in progress
+const ULONG REL_sys_trigs_being_loaded	= 0x0800;	// System triggers being loaded
+const ULONG REL_deleting				= 0x1000;	// relation delete in progress
+const ULONG REL_temp_tran				= 0x2000;	// relation is a GTT delete rows
+const ULONG REL_temp_conn				= 0x4000;	// relation is a GTT preserve rows
+const ULONG REL_virtual					= 0x8000;	// relation is virtual
+const ULONG REL_users					= 0x00010000;	// relation is users list
 
 
 inline bool jrd_rel::isSystem() const
@@ -312,9 +314,14 @@
 
 inline bool jrd_rel::isVirtual() const
 {
-	return (rel_flags & REL_virtual);
+	return (rel_flags & (REL_virtual | REL_users));
 }
 
+inline bool jrd_rel::isUsers() const
+{
+	return (rel_flags & REL_users);
+}
+
 inline RelationPages* jrd_rel::getPages(thread_db* tdbb, SLONG tran, bool allocPages)
 {
 	if (!isTemporary())
Modified: firebird/trunk/src/jrd/UserManagement.cpp
===================================================================
--- firebird/trunk/src/jrd/UserManagement.cpp	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/UserManagement.cpp	2010-07-09 12:51:05 UTC (rev 51322)
@@ -30,31 +30,36 @@
 #include "../jrd/msg_encode.h"
 #include "../utilities/gsec/gsec.h"
 #include "../utilities/gsec/secur_proto.h"
+#include "../jrd/met_proto.h"
+#include "../jrd/ini.h"
+#include "gen/ids.h"
 
 using namespace Jrd;
 using namespace Firebird;
 
 
 UserManagement::UserManagement(jrd_tra* tra)
-	: database(0), transaction(0), commands(*tra->tra_pool)
+	: DataDump(*tra->tra_pool), database(0), transaction(0), buffer(0), 
+	  threadDbb(NULL), realUser(NULL), commands(*tra->tra_pool)
 {
-	char securityDatabaseName[MAXPATHLEN];
-	Auth::SecurityDatabase::getPath(securityDatabaseName);
-	ISC_STATUS_ARRAY status;
 	Attachment* att = tra->tra_attachment;
-
-	ClumpletWriter dpb(ClumpletReader::dpbList, MAX_DPB_SIZE);
-	dpb.insertByte(isc_dpb_gsec_attach, TRUE);
-	dpb.insertString(isc_dpb_trusted_auth, att->att_user->usr_user_name);
-	if (att->att_user->usr_flags & USR_trole)
+	if (!att || !att->att_user)
 	{
-		dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE));
+		(Arg::Gds(isc_random) << "Unknown user name for given transaction").raise();
 	}
-	else if (!att->att_user->usr_sql_role_name.empty())
+	if (!att->att_user->locksmith())
 	{
-		dpb.insertString(isc_dpb_trusted_role, att->att_user->usr_sql_role_name);
+		realUser = att->att_user->usr_user_name.c_str();
 	}
 
+	char securityDatabaseName[MAXPATHLEN];
+	Auth::SecurityDatabase::getPath(securityDatabaseName);
+
+	ClumpletWriter dpb(ClumpletReader::dpbList, MAX_DPB_SIZE);
+	dpb.insertByte(isc_dpb_gsec_attach, TRUE);
+	dpb.insertString(isc_dpb_trusted_auth, SYSDBA_USER_NAME);
+
+	ISC_STATUS_ARRAY status;
 	if (isc_attach_database(status, 0, securityDatabaseName, &database,
 							dpb.getBufferLength(), reinterpret_cast<const char*>(dpb.getBuffer())))
 	{
@@ -92,6 +97,8 @@
 			status_exception::raise(status);
 		}
 	}
+
+	delete buffer;
 }
 
 void UserManagement::commit()
@@ -119,6 +126,25 @@
 	return ret;
 }
 
+void UserManagement::checkSecurityResult(int errcode, ISC_STATUS* status, const char* userName)
+{
+	Arg::StatusVector tmp;
+
+	if (!errcode)
+	{
+	    return;
+	}
+
+	tmp << Arg::Gds(ENCODE_ISC_MSG(errcode, GSEC_MSG_FAC));
+	if (errcode == GsecMsg22)
+	{
+		tmp << userName;
+	}
+	tmp.append(Arg::StatusVector(&status[0]));
+
+	tmp.raise();
+}
+
 void UserManagement::execute(USHORT id)
 {
 	if (!transaction || !commands[id])
@@ -138,30 +164,108 @@
 #else
 	ISC_STATUS_ARRAY status;
 	int errcode = (!commands[id]->user_name_entered) ? GsecMsg18 :
-		SECURITY_exec_line(status, database, transaction, commands[id], NULL, NULL);
+		SECURITY_exec_line(status, realUser, database, transaction, commands[id], NULL, NULL);
 
-	switch (errcode)
+	checkSecurityResult(errcode, status, commands[id]->user_name);
+
+	delete commands[id];
+	commands[id] = NULL;
+#endif
+}
+
+void UserManagement::display(void* arg, const internal_user_data* u, bool/*firstTime*/)
+{
+	UserManagement* instance = reinterpret_cast<UserManagement*>(arg);
+	fb_assert(instance && instance->buffer);
+
+	instance->display(u);
+}
+
+void UserManagement::display(const internal_user_data* u)
+{
+	Record* record = buffer->getTempRecord();
+	clearRecord(record);
+
+	int attachment_charset = ttype_none;
+
+	if (u->user_name_entered)
+		putField(threadDbb, record, 
+				 DumpField(f_sec_user_name, VALUE_STRING, strlen(u->user_name), u->user_name), 
+				 attachment_charset);
+	if (u->group_name_entered)
+		putField(threadDbb, record, 
+				 DumpField(f_sec_group_name, VALUE_STRING, strlen(u->group_name), u->group_name), 
+				 attachment_charset);
+	if (u->uid_entered)
+		putField(threadDbb, record, 
+				 DumpField(f_sec_uid, VALUE_INTEGER, sizeof(int), &u->uid), 
+				 attachment_charset);
+	if (u->gid_entered)
+		putField(threadDbb, record, 
+				 DumpField(f_sec_gid, VALUE_INTEGER, sizeof(int), &u->gid), 
+				 attachment_charset);
+	if (u->first_name_entered)
+		putField(threadDbb, record, 
+				 DumpField(f_sec_first_name, VALUE_STRING, strlen(u->first_name), u->first_name), 
+				 attachment_charset);
+	if (u->middle_name_entered)
+		putField(threadDbb, record, 
+				 DumpField(f_sec_middle_name, VALUE_STRING, strlen(u->middle_name), u->middle_name), 
+				 attachment_charset);
+	if (u->last_name_entered)
+		putField(threadDbb, record, 
+				 DumpField(f_sec_last_name, VALUE_STRING, strlen(u->last_name), u->last_name), 
+				 attachment_charset);
+
+	buffer->store(record);
+}
+
+RecordBuffer* UserManagement::getList(thread_db* tdbb)
+{
+#ifdef EMBEDDED
+	// this restriction for embedded is temporarty and will gone when new build system will be introduced
+	status_exception::raise(Arg::Gds(isc_random) << "User management not supported in embedded library");
+#else
+	if (buffer)
 	{
-	case 0: // nothing
-	    break;
-	case GsecMsg22:
-		{
-			Arg::StatusVector tmp;
-			tmp << Arg::Gds(ENCODE_ISC_MSG(errcode, GSEC_MSG_FAC)) << Arg::Str(commands[id]->user_name);
-			tmp.append(Arg::StatusVector(&status[0]));
-			tmp.raise();
-		}
+		return buffer;
+	}
 
-	default:
+	try
+	{
+		threadDbb = tdbb;
+
+		jrd_rel* relation = MET_lookup_relation_id(threadDbb, rel_sec_users, false);
+		fb_assert(relation);
+
+		MET_scan_relation(threadDbb, relation);
+		fb_assert(relation->isUsers());
+
+		Format* format = MET_current(threadDbb, relation);
+		fb_assert(format);
+
+		MemoryPool* pool = threadDbb->getTransaction()->tra_pool;
+		fb_assert(pool);
+
+		buffer = FB_NEW(*pool) RecordBuffer(*pool, format);
+		fb_assert(buffer);
+
+		ISC_STATUS_ARRAY status;
+		internal_user_data u;
+		u.operation = DIS_OPER;
+		int errcode = SECURITY_exec_line(status, realUser, database, transaction, &u, display, this);
+		checkSecurityResult(errcode, status, u.user_name);
+	}
+	catch (const Exception&)
+	{
+		if (buffer)
 		{
-			Arg::StatusVector tmp;
-			tmp << Arg::Gds(ENCODE_ISC_MSG(errcode, GSEC_MSG_FAC));
-			tmp.append(Arg::StatusVector(&status[0]));
-			tmp.raise();
+			delete buffer;
+			buffer = NULL;
 		}
+		throw;
 	}
 
-	delete commands[id];
-	commands[id] = NULL;
+	return buffer;
 #endif
 }
Modified: firebird/trunk/src/jrd/UserManagement.h
===================================================================
--- firebird/trunk/src/jrd/UserManagement.h	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/UserManagement.h	2010-07-09 12:51:05 UTC (rev 51322)
@@ -25,7 +25,9 @@
 
 #include "firebird.h"
 #include "../common/classes/array.h"
+#include "../common/classes/fb_string.h"
 #include "../jrd/ibase.h"
+#include "../jrd/DatabaseSnapshot.h"
 
 struct internal_user_data;
 
@@ -33,9 +35,10 @@
 
 class thread_db;
 class jrd_tra;
+class RecordBuffer;
 
 // User management argument for deferred work
-class UserManagement
+class UserManagement : public DataDump
 {
 public:
 	explicit UserManagement(jrd_tra* tra);
@@ -47,10 +50,19 @@
 	void execute(USHORT id);
 	// commit transaction in security database
 	void commit();
+	// return users list for SEC$USERS
+	RecordBuffer* getList(thread_db* tdbb);
 
 private:
 	FB_API_HANDLE database, transaction;
+	RecordBuffer* buffer;
+	thread_db* threadDbb;
+	const char* realUser;
 	Firebird::HalfStaticArray<internal_user_data*, 8> commands;
+
+	static void display(void* arg, const internal_user_data* u, bool firstTime);
+	void display(const internal_user_data* u);
+	static void checkSecurityResult(int errcode, ISC_STATUS* status, const char* userName);
 };
 
 }	// namespace
Modified: firebird/trunk/src/jrd/constants.h
===================================================================
--- firebird/trunk/src/jrd/constants.h	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/constants.h	2010-07-09 12:51:05 UTC (rev 51322)
@@ -202,7 +202,8 @@
 	rel_external = 2,
 	rel_virtual = 3,
 	rel_global_temp_preserve = 4,
-	rel_global_temp_delete = 5
+	rel_global_temp_delete = 5,
+	rel_vrt_users = 6
 };
 
 // procedure types
Modified: firebird/trunk/src/jrd/fields.h
===================================================================
--- firebird/trunk/src/jrd/fields.h	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/fields.h	2010-07-09 12:51:05 UTC (rev 51322)
@@ -166,3 +166,9 @@
 	FIELD(fld_arg_mechanism	, nam_arg_mechanism	, dtype_short	, sizeof(SSHORT)			, 0							, NULL		, true)
 
 	FIELD(fld_identity_type	, nam_identity_type	, dtype_short	, sizeof(SSHORT)			, 0							, NULL		, true)
+
+	FIELD(fld_uid			, nam_uid			, dtype_long	, sizeof(SLONG)				, 0							, NULL		, true)
+	FIELD(fld_gid			, nam_gid			, dtype_long	, sizeof(SLONG)				, 0							, NULL		, true)
+	FIELD(fld_passwd_type	, nam_passwd_type	, dtype_text	, 32						, dsc_text_type_ascii		, NULL		, true)
+	FIELD(fld_passwd		, nam_passwd		, dtype_blob	, BLOB_SIZE					, isc_blob_untyped			, NULL		, true)
+	FIELD(fld_name_part		, nam_name_part		, dtype_text	, 32						, dsc_text_type_metadata	, NULL		, true)
Modified: firebird/trunk/src/jrd/idx.h
===================================================================
--- firebird/trunk/src/jrd/idx.h	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/idx.h	2010-07-09 12:51:05 UTC (rev 51322)
@@ -345,6 +345,10 @@
 		SEGMENT(f_prm_procedure, idx_metadata),	// procedure name
 		SEGMENT(f_prm_name, idx_metadata),		// parameter name
 		SEGMENT(f_prm_pkg_name, idx_metadata)	// package name
+	}},
+	// define index RDB$INDEX_52 for RDB$USERS unique RDB$USER_NAME;
+	INDEX(52, ODS_12_0, rel_users, idx_unique, 1)
+		SEGMENT(f_user_name, idx_metadata)		// procedure name
 	}}
 
 	// Last index in ODS 12.0 is RDB$INDEX_51
Modified: firebird/trunk/src/jrd/ini.epp
===================================================================
--- firebird/trunk/src/jrd/ini.epp	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/ini.epp	2010-07-09 12:51:05 UTC (rev 51322)
@@ -71,7 +71,7 @@
 
 static void add_index_set(thread_db*);
 static void add_security_to_sys_rel(thread_db*, const Firebird::MetaName&,
-		const TEXT*, const UCHAR*, const SSHORT);
+		const TEXT*, const UCHAR*, const SSHORT, const bool);
 static void store_generator(thread_db*, const gen*, AutoRequest&);
 static void store_global_field(thread_db*, const gfld*, AutoRequest&);
 static void store_intlnames(thread_db*);
@@ -468,10 +468,39 @@
 	*acl++ = ACL_end;
 	length = acl - buffer;
 
-	add_security_to_sys_rel(tdbb, ownerName, "RDB$ROLES", buffer, length);
-	add_security_to_sys_rel(tdbb, ownerName, "RDB$PAGES", buffer, length);
+	add_security_to_sys_rel(tdbb, ownerName, "RDB$ROLES", buffer, length, true);
+	add_security_to_sys_rel(tdbb, ownerName, "RDB$PAGES", buffer, length, true);
 	// DFW writes here
-	add_security_to_sys_rel(tdbb, ownerName, "RDB$FORMATS", buffer, length);
+	add_security_to_sys_rel(tdbb, ownerName, "RDB$FORMATS", buffer, length, true);
+
+	// nobody except DBA should access it
+	acl = buffer;
+	*acl++ = ACL_version;
+	*acl++ = ACL_id_list;
+	*acl++ = id_person;
+
+	length = ownerName.length();
+	if (length > MAX_UCHAR)
+		length = MAX_UCHAR;
+
+	*acl++ = (UCHAR)length;
+	if (length)
+	{
+		const TEXT* p_1 = ownerName.c_str();
+		memcpy(acl, p_1, length);
+		acl += length;
+	}
+	*acl++ = ACL_end;
+	*acl++ = ACL_priv_list;
+	*acl++ = priv_protect;
+	*acl++ = priv_control;
+	*acl++ = priv_delete;
+	*acl++ = priv_write;
+	*acl++ = priv_read;
+	*acl++ = ACL_end;
+	*acl++ = ACL_end;
+	length = acl - buffer;
+	add_security_to_sys_rel(tdbb, ownerName, "RDB$USERS", buffer, length, false);
 }
 
 
@@ -863,7 +892,8 @@
 									const Firebird::MetaName&	user_name,
 									const TEXT*	rel_name,
 									const UCHAR*	acl,
-									const SSHORT	acl_length)
+									const SSHORT	acl_length,
+									const bool		pub_select)
 {
 /**************************************
  *
@@ -935,7 +965,7 @@
 
 	handle1.reset();
 
-	for (int cnt = 0; cnt < 6; cnt++)
+	for (int cnt = 0; cnt < (pub_select ? 6 : 5); cnt++)
 	{
 		STORE(REQUEST_HANDLE handle1) PRIV IN RDB$USER_PRIVILEGES
 			switch (cnt)
Modified: firebird/trunk/src/jrd/met.epp
===================================================================
--- firebird/trunk/src/jrd/met.epp	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/met.epp	2010-07-09 12:51:05 UTC (rev 51322)
@@ -3607,6 +3607,9 @@
 				case rel_view:
 					fb_assert(relation->rel_view_rse);
 					break;
+				case rel_vrt_users:
+					relation->rel_flags |= REL_users;
+					break;
 				case rel_virtual:
 					relation->rel_flags |= REL_virtual;
 					break;
Modified: firebird/trunk/src/jrd/names.h
===================================================================
--- firebird/trunk/src/jrd/names.h	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/names.h	2010-07-09 12:51:05 UTC (rev 51322)
@@ -257,6 +257,18 @@
 NAME("RDB$ARGUMENT_NAME", nam_arg_name)
 NAME("RDB$IDENTITY_TYPE", nam_identity_type)
 
+NAME("RDB$USERS", nam_users)
+NAME("RDB$USER_NAME", nam_user_name)
+NAME("RDB$GROUP_NAME", nam_group_name)
+NAME("RDB$UID", nam_uid)
+NAME("RDB$GID", nam_gid)
+NAME("RDB$PASSWD_TYPE", nam_passwd_type)
+NAME("RDB$PASSWD", nam_passwd)
+NAME("RDB$FIRST_NAME", nam_first_name)
+NAME("RDB$MIDDLE_NAME", nam_middle_name)
+NAME("RDB$LAST_NAME", nam_last_name)
+NAME("RDB$NAME_PART", nam_name_part)
+
 NAME("MON$ATTACHMENTS", nam_mon_attachments)
 NAME("MON$ATTACHMENT_ID", nam_mon_att_id)
 NAME("MON$ATTACHMENT_NAME", nam_mon_att_name)
@@ -331,6 +343,7 @@
 NAME("MON$TRANSACTIONS", nam_mon_transactions)
 NAME("MON$TRANSACTION_ID", nam_mon_tra_id)
 NAME("MON$USER", nam_mon_user)
+NAME("SEC$USERS", nam_sec_users)
 NAME("MON$VARIABLE_NAME", nam_mon_var_name)
 NAME("MON$VARIABLE_VALUE", nam_mon_var_value)
 NAME("MON$PACKAGE_NAME", nam_mon_pkg_name)
Modified: firebird/trunk/src/jrd/opt.cpp
===================================================================
--- firebird/trunk/src/jrd/opt.cpp	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/opt.cpp	2010-07-09 12:51:05 UTC (rev 51322)
@@ -3074,6 +3074,11 @@
 		// External table
 		rsb = FB_NEW(*tdbb->getDefaultPool()) ExternalTableScan(csb, alias, stream);
 	}
+	else if (relation->isUsers())
+	{
+		// Users table
+		rsb = FB_NEW(*tdbb->getDefaultPool()) UsersTableScan(csb, alias, stream);
+	}
 	else if (relation->isVirtual())
 	{
 		// Virtual table
Modified: firebird/trunk/src/jrd/recsrc/RecordSource.h
===================================================================
--- firebird/trunk/src/jrd/recsrc/RecordSource.h	2010-07-09 11:33:28 UTC (rev 51321)
+++ firebird/trunk/src/jrd/recsrc/RecordSource.h	2010-07-09 12:51:05 UTC (rev 51322)
@@ -302,6 +302,29 @@
 		const Firebird::string m_name;
 	};
 
+	class UsersTableScan : public RecordStream
+	{
+		struct Impure : public RecordSource::Impure
+		{
+			RecordBuffer* irsb_record_buffer;
+		};
+
+	public:
+		UsersTableScan(CompilerScratch* csb, const Firebird::string& name, UCHAR stream);
+
+		void open(thread_db* tdbb) const;
+		void close(thread_db* tdbb) const;
+
+		bool getRecord(thread_db* tdbb) const;
+		bool refetchRecord(thread_db* tdbb) const;
+		bool lockRecord(thread_db* tdbb) const;
+
+		void dump(thread_db* tdbb, Firebird::UCharBuffer& buffer) const;
+
+	private:
+		const Firebird::string m_name;
+	};
+
 	class ProcedureScan : public RecordStream
 	{
 		struct Impure : public RecordSource::Impure
Added: firebird/trunk/src/jrd/recsrc/UsersTableScan.cpp
===================================================================
--- firebird/trunk/src/jrd/recsrc/UsersTableScan.cpp	                        (rev 0)
+++ firebird/trunk/src/jrd/recsrc/UsersTableScan.cpp	2010-07-09 12:51:05 UTC (rev 51322)
@@ -0,0 +1,142 @@
+/*
+ *  The contents of this file are subject to the Initial
+ *  Developer's Public License Version 1.0 (the "License");
+ *  you may not use this file except in compliance with the
+ *  License. You m...
 
[truncated message content] | 
| 
      
      
      From: <di...@us...> - 2010-07-13 12:31:43
       | 
| Revision: 51337
          http://firebird.svn.sourceforge.net/firebird/?rev=51337&view=rev
Author:   dimitr
Date:     2010-07-13 12:31:35 +0000 (Tue, 13 Jul 2010)
Log Message:
-----------
Reworked the SEC$USERS implementation so that no new physical table type and data access method would be required. More changes are likely to follow soon.
Modified Paths:
--------------
    firebird/trunk/builds/win32/msvc10/engine.vcxproj
    firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj
    firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj
    firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj.filters
    firebird/trunk/builds/win32/msvc9/engine.vcproj
    firebird/trunk/builds/win32/msvc9/engine_classic.vcproj
    firebird/trunk/builds/win32/msvc9/engine_embed.vcproj
    firebird/trunk/src/jrd/Database.h
    firebird/trunk/src/jrd/DatabaseSnapshot.cpp
    firebird/trunk/src/jrd/DatabaseSnapshot.h
    firebird/trunk/src/jrd/Relation.h
    firebird/trunk/src/jrd/UserManagement.cpp
    firebird/trunk/src/jrd/UserManagement.h
    firebird/trunk/src/jrd/constants.h
    firebird/trunk/src/jrd/met.epp
    firebird/trunk/src/jrd/opt.cpp
    firebird/trunk/src/jrd/recsrc/RecordSource.h
    firebird/trunk/src/jrd/recsrc/VirtualTableScan.cpp
    firebird/trunk/src/jrd/relations.h
    firebird/trunk/src/jrd/types.h
Modified: firebird/trunk/builds/win32/msvc10/engine.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine.vcxproj	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/builds/win32/msvc10/engine.vcxproj	2010-07-13 12:31:35 UTC (rev 51337)
@@ -221,7 +221,6 @@
     <ClCompile Include="..\..\..\src\jrd\PreparedStatement.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RandomGenerator.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RecordBuffer.cpp" />
-    <ClCompile Include="..\..\..\src\jrd\recsrc\UsersTableScan.cpp" />
     <ClCompile Include="..\..\..\src\jrd\Relation.cpp" />
     <ClCompile Include="..\..\..\src\jrd\ResultSet.cpp" />
     <ClCompile Include="..\..\..\src\jrd\rlck.cpp" />
Modified: firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters	2010-07-13 12:31:35 UTC (rev 51337)
@@ -423,9 +423,6 @@
     <ClCompile Include="..\..\..\src\gpre\pretty.cpp">
       <Filter>GPRE files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\src\jrd\recsrc\UsersTableScan.cpp">
-      <Filter>JRD files\Data Access</Filter>
-    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\src\jrd\acl.h">
Modified: firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj	2010-07-13 12:31:35 UTC (rev 51337)
@@ -221,7 +221,6 @@
     <ClCompile Include="..\..\..\src\jrd\PreparedStatement.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RandomGenerator.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RecordBuffer.cpp" />
-    <ClCompile Include="..\..\..\src\jrd\recsrc\UsersTableScan.cpp" />
     <ClCompile Include="..\..\..\src\jrd\Relation.cpp" />
     <ClCompile Include="..\..\..\src\jrd\ResultSet.cpp" />
     <ClCompile Include="..\..\..\src\jrd\rlck.cpp" />
Modified: firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj.filters
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj.filters	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj.filters	2010-07-13 12:31:35 UTC (rev 51337)
@@ -423,9 +423,6 @@
     <ClCompile Include="..\..\..\src\gpre\pretty.cpp">
       <Filter>GPRE files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\src\jrd\recsrc\UsersTableScan.cpp">
-      <Filter>JRD files\Data Access</Filter>
-    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\src\jrd\acl.h">
Modified: firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj	2010-07-13 12:31:35 UTC (rev 51337)
@@ -221,7 +221,6 @@
     <ClCompile Include="..\..\..\src\jrd\PreparedStatement.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RandomGenerator.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RecordBuffer.cpp" />
-    <ClCompile Include="..\..\..\src\jrd\recsrc\UsersTableScan.cpp" />
     <ClCompile Include="..\..\..\src\jrd\Relation.cpp" />
     <ClCompile Include="..\..\..\src\jrd\ResultSet.cpp" />
     <ClCompile Include="..\..\..\src\jrd\rlck.cpp" />
Modified: firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj.filters
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj.filters	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj.filters	2010-07-13 12:31:35 UTC (rev 51337)
@@ -423,9 +423,6 @@
     <ClCompile Include="..\..\..\src\gpre\pretty.cpp">
       <Filter>GPRE files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\src\jrd\recsrc\UsersTableScan.cpp">
-      <Filter>JRD files\Data Access</Filter>
-    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\..\src\jrd\acl.h">
Modified: firebird/trunk/builds/win32/msvc9/engine.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/engine.vcproj	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/builds/win32/msvc9/engine.vcproj	2010-07-13 12:31:35 UTC (rev 51337)
@@ -807,10 +807,6 @@
 					>
 				</File>
 				<File
-					RelativePath="..\..\..\src\jrd\recsrc\UsersTableScan.cpp"
-					>
-				</File>
-				<File
 					RelativePath="..\..\..\src\jrd\recsrc\VirtualTableScan.cpp"
 					>
 				</File>
Modified: firebird/trunk/builds/win32/msvc9/engine_classic.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/engine_classic.vcproj	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/builds/win32/msvc9/engine_classic.vcproj	2010-07-13 12:31:35 UTC (rev 51337)
@@ -807,14 +807,10 @@
 					>
 				</File>
 				<File
-					RelativePath="..\..\..\src\jrd\recsrc\UsersTableScan.cpp"
+					RelativePath="..\..\..\src\jrd\recsrc\VirtualTableScan.cpp"
 					>
 				</File>
 				<File
-					RelativePath="..\..\..\src\jrd\recsrc\VirtualTableScan.cpp"
-					>
-				</File>				
-				<File
 					RelativePath="..\..\..\src\jrd\recsrc\WindowedStream.cpp"
 					>
 				</File>
Modified: firebird/trunk/builds/win32/msvc9/engine_embed.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/engine_embed.vcproj	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/builds/win32/msvc9/engine_embed.vcproj	2010-07-13 12:31:35 UTC (rev 51337)
@@ -807,14 +807,10 @@
 					>
 				</File>
 				<File
-					RelativePath="..\..\..\src\jrd\recsrc\UsersTableScan.cpp"
+					RelativePath="..\..\..\src\jrd\recsrc\VirtualTableScan.cpp"
 					>
 				</File>
 				<File
-					RelativePath="..\..\..\src\jrd\recsrc\VirtualTableScan.cpp"
-					>
-				</File>				
-				<File
 					RelativePath="..\..\..\src\jrd\recsrc\WindowedStream.cpp"
 					>
 				</File>
Modified: firebird/trunk/src/jrd/Database.h
===================================================================
--- firebird/trunk/src/jrd/Database.h	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/Database.h	2010-07-13 12:31:35 UTC (rev 51337)
@@ -54,7 +54,6 @@
 #include "../common/classes/PublicHandle.h"
 #include "../common/classes/semaphore.h"
 #include "../common/utils_proto.h"
-#include "../jrd/DatabaseSnapshot.h"
 #include "../jrd/RandomGenerator.h"
 #include "../jrd/os/guid.h"
 #include "../jrd/sbm.h"
@@ -79,6 +78,7 @@
 	class BackupManager;
 	class vcl;
     class ExternalFileDirectoryList;
+	class MonitoringData;
 
 	typedef Firebird::ObjectsArray<Trigger> trig_vec;
 
@@ -368,7 +368,7 @@
 	trig_vec*	dbb_triggers[DB_TRIGGER_MAX];
 	trig_vec*	dbb_ddl_triggers;
 
-	DatabaseSnapshot::SharedData*	dbb_monitoring_data;	// monitoring data
+	MonitoringData*	dbb_monitoring_data;	// monitoring data
 
 	DatabaseModules	dbb_modules;		// external function/filter modules
  	ExtEngineManager dbb_extManager;	// external engine manager
Modified: firebird/trunk/src/jrd/DatabaseSnapshot.cpp
===================================================================
--- firebird/trunk/src/jrd/DatabaseSnapshot.cpp	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/DatabaseSnapshot.cpp	2010-07-13 12:31:35 UTC (rev 51337)
@@ -71,9 +71,17 @@
 using namespace Jrd;
 
 
-// SharedData class
+bool MonitoringTableScan::retrieveRecord(thread_db* tdbb, jrd_rel* relation,
+										 FB_UINT64 position, Record* record) const
+{
+	DatabaseSnapshot* const snapshot = DatabaseSnapshot::create(tdbb);
+	return snapshot->getData(relation)->fetch(position, record);
+}
 
-DatabaseSnapshot::SharedData::SharedData(const Database* dbb)
+
+// MonitoringData class
+
+MonitoringData::MonitoringData(const Database* dbb)
 	: process_id(getpid()), local_id(dbb->dbb_monitoring_id)
 {
 	string name;
@@ -91,10 +99,10 @@
 }
 
 
-DatabaseSnapshot::SharedData::~SharedData()
+MonitoringData::~MonitoringData()
 {
 	{ // scope
-		DumpGuard guard(this);
+		Guard guard(this);
 		cleanup();
 
 		if (sh_mem_header->used == sizeof(Header))
@@ -106,7 +114,7 @@
 }
 
 
-void DatabaseSnapshot::SharedData::acquire()
+void MonitoringData::acquire()
 {
 	mutexLock();
 
@@ -126,13 +134,13 @@
 }
 
 
-void DatabaseSnapshot::SharedData::release()
+void MonitoringData::release()
 {
 	mutexUnlock();
 }
 
 
-UCHAR* DatabaseSnapshot::SharedData::read(MemoryPool& pool, ULONG& resultSize)
+UCHAR* MonitoringData::read(MemoryPool& pool, ULONG& resultSize)
 {
 	ULONG self_dbb_offset = 0;
 
@@ -198,7 +206,7 @@
 }
 
 
-ULONG DatabaseSnapshot::SharedData::setup()
+ULONG MonitoringData::setup()
 {
 	ensureSpace(sizeof(Element));
 
@@ -214,7 +222,7 @@
 }
 
 
-void DatabaseSnapshot::SharedData::write(ULONG offset, ULONG length, const void* buffer)
+void MonitoringData::write(ULONG offset, ULONG length, const void* buffer)
 {
 	ensureSpace(length);
 
@@ -229,7 +237,7 @@
 }
 
 
-void DatabaseSnapshot::SharedData::cleanup()
+void MonitoringData::cleanup()
 {
 	// Remove information about our dbb
 	for (ULONG offset = alignOffset(sizeof(Header)); offset < sh_mem_header->used;)
@@ -252,7 +260,7 @@
 }
 
 
-void DatabaseSnapshot::SharedData::ensureSpace(ULONG length)
+void MonitoringData::ensureSpace(ULONG length)
 {
 	ULONG newSize = sh_mem_header->used + length;
 
@@ -274,7 +282,7 @@
 }
 
 
-void DatabaseSnapshot::SharedData::mutexBug(int osErrorCode, const char* string)
+void MonitoringData::mutexBug(int osErrorCode, const char* string)
 {
 	gds__log("MONITOR: mutex %s error, status = %d", string, osErrorCode);
 
@@ -283,7 +291,7 @@
 }
 
 
-bool DatabaseSnapshot::SharedData::initialize(bool initialize)
+bool MonitoringData::initialize(bool initialize)
 {
 	if (initialize)
 	{
@@ -299,11 +307,12 @@
 }
 
 
-ULONG DatabaseSnapshot::SharedData::alignOffset(ULONG unaligned)
+ULONG MonitoringData::alignOffset(ULONG unaligned)
 {
-	return Firebird::MEM_ALIGN(unaligned);
+	return (ULONG) Firebird::MEM_ALIGN(unaligned);
 }
 
+
 // DatabaseSnapshot class
 
 
@@ -424,7 +433,7 @@
 
 	{ // scope
 		fb_assert(dbb->dbb_monitoring_data);
-		DumpGuard guard(dbb->dbb_monitoring_data);
+		MonitoringData::Guard guard(dbb->dbb_monitoring_data);
 		dataPtr = dbb->dbb_monitoring_data->read(pool, dataSize);
 	}
 
@@ -589,7 +598,7 @@
 	jrd_rel* relation = MET_lookup_relation_id(tdbb, rel_id, false);
 	fb_assert(relation);
 	MET_scan_relation(tdbb, relation);
-	fb_assert(relation->isVirtual() && !relation->isUsers());
+	fb_assert(relation->isVirtual());
 	Format* format = MET_current(tdbb, relation);
 	fb_assert(format);
 
@@ -613,7 +622,7 @@
 
 
 void DataDump::putField(thread_db* tdbb, Record* record, const DumpField& field,
-								int& charset, bool set_charset)
+						int& charset, bool set_charset)
 {
 	fb_assert(record);
 
@@ -726,10 +735,10 @@
 
 	if (!dbb->dbb_monitoring_data)
 	{
-		dbb->dbb_monitoring_data = FB_NEW(*dbb->dbb_permanent) SharedData(dbb);
+		dbb->dbb_monitoring_data = FB_NEW(*dbb->dbb_permanent) MonitoringData(dbb);
 	}
 
-	DumpGuard guard(dbb->dbb_monitoring_data);
+	MonitoringData::Guard guard(dbb->dbb_monitoring_data);
 	dbb->dbb_monitoring_data->cleanup();
 
 	Writer writer(dbb->dbb_monitoring_data);
@@ -905,7 +914,7 @@
 
 
 bool DatabaseSnapshot::putAttachment(thread_db* tdbb, const Jrd::Attachment* attachment,
-	Writer& writer, int stat_id)
+									 Writer& writer, int stat_id)
 {
 	fb_assert(attachment);
 
Modified: firebird/trunk/src/jrd/DatabaseSnapshot.h
===================================================================
--- firebird/trunk/src/jrd/DatabaseSnapshot.h	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/DatabaseSnapshot.h	2010-07-13 12:31:35 UTC (rev 51337)
@@ -29,6 +29,7 @@
 #include "../jrd/isc_s_proto.h"
 #include "../common/classes/timestamp.h"
 #include "../jrd/val.h"
+#include "../jrd/recsrc/RecordSource.h"
 
 namespace Jrd {
 
@@ -199,91 +200,103 @@
 	int idCounter;
 };
 
-class DatabaseSnapshot : public DataDump
+
+class MonitoringHeader : public MemoryHeader
 {
-	struct RelationData
+public:
+	ULONG used;
+	ULONG allocated;
+};
+
+class MonitoringData : public SharedMemory<MonitoringHeader>
+{
+	static const ULONG MONITOR_VERSION = 3;
+	static const ULONG DEFAULT_SIZE = 1048576;
+
+	typedef MonitoringHeader Header;
+
+	struct Element
 	{
-		int rel_id;
-		RecordBuffer* data;
+		SLONG processId;
+		SLONG localId;
+		ULONG length;
 	};
 
+	static ULONG alignOffset(ULONG absoluteOffset);
+
 public:
-	class SnapshotHeader : public MemoryHeader
+	class Guard
 	{
 	public:
-		ULONG used;
-		ULONG allocated;
-	};
+		explicit Guard(MonitoringData* ptr)
+			: data(ptr)
+		{
+			data->acquire();
+		}
 
-	class SharedData : public SharedMemory<SnapshotHeader>
-	{
-		static const ULONG MONITOR_VERSION = 3;
-		static const ULONG DEFAULT_SIZE = 1048576;
+		~Guard()
+		{
+			data->release();
+		}
 
-		typedef SnapshotHeader Header;
+	private:
+		Guard(const Guard&);
+		Guard& operator=(const Guard&);
 
-		struct Element
-		{
-			SLONG processId;
-			SLONG localId;
-			ULONG length;
-		};
+		MonitoringData* const data;
+	};
 
-		static ULONG alignOffset(ULONG absoluteOffset);
+	explicit MonitoringData(const Database*);
+	~MonitoringData();
 
-	public:
-		explicit SharedData(const Database*);
-		~SharedData();
+	bool initialize(bool);
+	void mutexBug(int osErrorCode, const char* text);
 
-		bool initialize(bool);
-		void mutexBug(int osErrorCode, const char* text);
+	void acquire();
+	void release();
 
-		void acquire();
-		void release();
+	UCHAR* read(MemoryPool&, ULONG&);
+	ULONG setup();
+	void write(ULONG, ULONG, const void*);
 
-		UCHAR* read(MemoryPool&, ULONG&);
-		ULONG setup();
-		void write(ULONG, ULONG, const void*);
+	void cleanup();
 
-		void cleanup();
+private:
+	// copying is prohibited
+	MonitoringData(const MonitoringData&);
+	MonitoringData& operator =(const MonitoringData&);
 
-	private:
-		// copying is prohibited
-		SharedData(const SharedData&);
-		SharedData& operator =(const SharedData&);
+	void ensureSpace(ULONG);
 
-		void ensureSpace(ULONG);
+	const SLONG process_id;
+	const SLONG local_id;
+};
 
-		const SLONG process_id;
-		const SLONG local_id;
-	};
 
-private:
-	class DumpGuard
-	{
-	public:
-		explicit DumpGuard(SharedData* ptr)
-			: data(ptr)
-		{
-			data->acquire();
-		}
+class MonitoringTableScan: public VirtualTableScan
+{
+public:
+	MonitoringTableScan(CompilerScratch* csb, const Firebird::string& name, UCHAR stream)
+		: VirtualTableScan(csb, name, stream)
+	{}
 
-		~DumpGuard()
-		{
-			data->release();
-		}
+	bool retrieveRecord(thread_db* tdbb, jrd_rel* relation, FB_UINT64 position, Record* record) const;
+};
 
-	private:
-		DumpGuard(const DumpGuard&);
-		DumpGuard& operator=(const DumpGuard&);
 
-		SharedData* const data;
+class DatabaseSnapshot : public DataDump
+{
+	struct RelationData
+	{
+		int rel_id;
+		RecordBuffer* data;
 	};
 
+private:
 	class Writer
 	{
 	public:
-		explicit Writer(SharedData* data)
+		explicit Writer(MonitoringData* data)
 			: dump(data)
 		{
 			fb_assert(dump);
@@ -299,7 +312,7 @@
 		}
 
 	private:
-		SharedData* dump;
+		MonitoringData* dump;
 		ULONG offset;
 	};
 
@@ -338,6 +351,7 @@
 
 	static DatabaseSnapshot* create(thread_db*);
 	static int blockingAst(void*);
+	static bool getRecord(thread_db* tdbb, jrd_rel* relation, FB_UINT64 position, Record* record);
 
 protected:
 	DatabaseSnapshot(thread_db*, MemoryPool&);
Modified: firebird/trunk/src/jrd/Relation.h
===================================================================
--- firebird/trunk/src/jrd/Relation.h	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/Relation.h	2010-07-13 12:31:35 UTC (rev 51337)
@@ -219,7 +219,6 @@
 	bool isSystem() const;
 	bool isTemporary() const;
 	bool isVirtual() const;
-	bool isUsers() const;
 
 	// global temporary relations attributes
 	RelationPages* getPages(thread_db* tdbb, SLONG tran = -1, bool allocPages = true);
@@ -299,7 +298,6 @@
 const ULONG REL_temp_tran				= 0x2000;	// relation is a GTT delete rows
 const ULONG REL_temp_conn				= 0x4000;	// relation is a GTT preserve rows
 const ULONG REL_virtual					= 0x8000;	// relation is virtual
-const ULONG REL_users					= 0x00010000;	// relation is users list
 
 
 inline bool jrd_rel::isSystem() const
@@ -314,14 +312,9 @@
 
 inline bool jrd_rel::isVirtual() const
 {
-	return (rel_flags & (REL_virtual | REL_users));
+	return (rel_flags & REL_virtual);
 }
 
-inline bool jrd_rel::isUsers() const
-{
-	return (rel_flags & REL_users);
-}
-
 inline RelationPages* jrd_rel::getPages(thread_db* tdbb, SLONG tran, bool allocPages)
 {
 	if (!isTemporary())
Modified: firebird/trunk/src/jrd/UserManagement.cpp
===================================================================
--- firebird/trunk/src/jrd/UserManagement.cpp	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/UserManagement.cpp	2010-07-13 12:31:35 UTC (rev 51337)
@@ -38,6 +38,14 @@
 using namespace Firebird;
 
 
+bool UsersTableScan::retrieveRecord(thread_db* tdbb, jrd_rel* relation,
+									FB_UINT64 position, Record* record) const
+{
+	jrd_tra* const transaction = tdbb->getTransaction();
+	return transaction->getUserManagement()->getList(tdbb, relation)->fetch(position, record);
+}
+
+
 UserManagement::UserManagement(jrd_tra* tra)
 	: DataDump(*tra->tra_pool), database(0), transaction(0), buffer(0),
 	  threadDbb(NULL), realUser(NULL), commands(*tra->tra_pool)
@@ -219,51 +227,44 @@
 	buffer->store(record);
 }
 
-RecordBuffer* UserManagement::getList(thread_db* tdbb)
+RecordBuffer* UserManagement::getList(thread_db* tdbb, jrd_rel* relation)
 {
 #ifdef EMBEDDED
 	// this restriction for embedded is temporarty and will gone when new build system will be introduced
 	status_exception::raise(Arg::Gds(isc_random) << "User management not supported in embedded library");
 	return 0; // keep the compiler happy
 #else
-	if (buffer)
+	if (!buffer)
 	{
-		return buffer;
-	}
+		try
+		{
+			threadDbb = tdbb;
 
-	try
-	{
-		threadDbb = tdbb;
+			fb_assert(relation && relation->rel_id == rel_sec_users);
 
-		jrd_rel* relation = MET_lookup_relation_id(threadDbb, rel_sec_users, false);
-		fb_assert(relation);
+			MET_scan_relation(threadDbb, relation);
 
-		MET_scan_relation(threadDbb, relation);
-		fb_assert(relation->isUsers());
+			Format* const format = MET_current(threadDbb, relation);
+			fb_assert(format);
 
-		Format* format = MET_current(threadDbb, relation);
-		fb_assert(format);
+			MemoryPool* const pool = threadDbb->getTransaction()->tra_pool;
+			fb_assert(pool);
 
-		MemoryPool* pool = threadDbb->getTransaction()->tra_pool;
-		fb_assert(pool);
+			buffer = FB_NEW(*pool) RecordBuffer(*pool, format);
+			fb_assert(buffer);
 
-		buffer = FB_NEW(*pool) RecordBuffer(*pool, format);
-		fb_assert(buffer);
-
-		ISC_STATUS_ARRAY status;
-		internal_user_data u;
-		u.operation = DIS_OPER;
-		int errcode = SECURITY_exec_line(status, realUser, database, transaction, &u, display, this);
-		checkSecurityResult(errcode, status, u.user_name);
-	}
-	catch (const Exception&)
-	{
-		if (buffer)
+			ISC_STATUS_ARRAY status;
+			internal_user_data u;
+			u.operation = DIS_OPER;
+			int errcode = SECURITY_exec_line(status, realUser, database, transaction, &u, display, this);
+			checkSecurityResult(errcode, status, u.user_name);
+		}
+		catch (const Exception&)
 		{
 			delete buffer;
 			buffer = NULL;
+			throw;
 		}
-		throw;
 	}
 
 	return buffer;
Modified: firebird/trunk/src/jrd/UserManagement.h
===================================================================
--- firebird/trunk/src/jrd/UserManagement.h	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/UserManagement.h	2010-07-13 12:31:35 UTC (rev 51337)
@@ -28,6 +28,7 @@
 #include "../common/classes/fb_string.h"
 #include "../jrd/ibase.h"
 #include "../jrd/DatabaseSnapshot.h"
+#include "../jrd/recsrc/RecordSource.h"
 
 struct internal_user_data;
 
@@ -37,6 +38,16 @@
 class jrd_tra;
 class RecordBuffer;
 
+class UsersTableScan: public VirtualTableScan
+{
+public:
+	UsersTableScan(CompilerScratch* csb, const Firebird::string& name, UCHAR stream)
+		: VirtualTableScan(csb, name, stream)
+	{}
+
+	bool retrieveRecord(thread_db* tdbb, jrd_rel* relation, FB_UINT64 position, Record* record) const;
+};
+
 // User management argument for deferred work
 class UserManagement : public DataDump
 {
@@ -51,7 +62,7 @@
 	// commit transaction in security database
 	void commit();
 	// return users list for SEC$USERS
-	RecordBuffer* getList(thread_db* tdbb);
+	RecordBuffer* getList(thread_db* tdbb, jrd_rel* relation);
 
 private:
 	FB_API_HANDLE database, transaction;
Modified: firebird/trunk/src/jrd/constants.h
===================================================================
--- firebird/trunk/src/jrd/constants.h	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/constants.h	2010-07-13 12:31:35 UTC (rev 51337)
@@ -202,8 +202,7 @@
 	rel_external = 2,
 	rel_virtual = 3,
 	rel_global_temp_preserve = 4,
-	rel_global_temp_delete = 5,
-	rel_vrt_users = 6
+	rel_global_temp_delete = 5
 };
 
 // procedure types
Modified: firebird/trunk/src/jrd/met.epp
===================================================================
--- firebird/trunk/src/jrd/met.epp	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/met.epp	2010-07-13 12:31:35 UTC (rev 51337)
@@ -3607,9 +3607,6 @@
 				case rel_view:
 					fb_assert(relation->rel_view_rse);
 					break;
-				case rel_vrt_users:
-					relation->rel_flags |= REL_users;
-					break;
 				case rel_virtual:
 					relation->rel_flags |= REL_virtual;
 					break;
Modified: firebird/trunk/src/jrd/opt.cpp
===================================================================
--- firebird/trunk/src/jrd/opt.cpp	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/opt.cpp	2010-07-13 12:31:35 UTC (rev 51337)
@@ -56,6 +56,7 @@
 #include "../jrd/btr.h"
 #include "../jrd/sort.h"
 #include "../jrd/rse.h"
+#include "../jrd/ini.h"
 #include "../jrd/intl.h"
 #include "../jrd/gdsassert.h"
 #include "../jrd/btr_proto.h"
@@ -76,6 +77,8 @@
 #include "../jrd/dbg_proto.h"
 #include "../jrd/DataTypeUtil.h"
 #include "../jrd/VirtualTable.h"
+#include "../jrd/DatabaseSnapshot.h"
+#include "../jrd/UserManagement.h"
 #include "../common/classes/array.h"
 #include "../common/classes/objects_array.h"
 #include "../jrd/recsrc/RecordSource.h"
@@ -3045,9 +3048,9 @@
 		DEV_BLKCHK(*return_boolean, type_nod);
 	}
 
-	CompilerScratch* csb = opt->opt_csb;
-	CompilerScratch::csb_repeat* csb_tail = &csb->csb_rpt[stream];
-	jrd_rel* relation = csb_tail->csb_relation;
+	CompilerScratch* const csb = opt->opt_csb;
+	CompilerScratch::csb_repeat* const csb_tail = &csb->csb_rpt[stream];
+	jrd_rel* const relation = csb_tail->csb_relation;
 
 	fb_assert(relation);
 
@@ -3074,15 +3077,17 @@
 		// External table
 		rsb = FB_NEW(*tdbb->getDefaultPool()) ExternalTableScan(csb, alias, stream);
 	}
-	else if (relation->isUsers())
-	{
-		// Users table
-		rsb = FB_NEW(*tdbb->getDefaultPool()) UsersTableScan(csb, alias, stream);
-	}
 	else if (relation->isVirtual())
 	{
-		// Virtual table
-		rsb = FB_NEW(*tdbb->getDefaultPool()) VirtualTableScan(csb, alias, stream);
+		// Virtual table: monitoring or security
+		if (relation->rel_id == rel_sec_users)
+		{
+			rsb = FB_NEW(*tdbb->getDefaultPool()) UsersTableScan(csb, alias, stream);
+		}
+		else
+		{
+			rsb = FB_NEW(*tdbb->getDefaultPool()) MonitoringTableScan(csb, alias, stream);
+		}
 	}
 	else
 	{
Modified: firebird/trunk/src/jrd/recsrc/RecordSource.h
===================================================================
--- firebird/trunk/src/jrd/recsrc/RecordSource.h	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/recsrc/RecordSource.h	2010-07-13 12:31:35 UTC (rev 51337)
@@ -28,11 +28,6 @@
 #include "../jrd/rse.h"
 #include "../jrd/inf_pub.h"
 
-namespace Ods
-{
-	struct btree_page;
-}
-
 namespace Jrd
 {
 	class thread_db;
@@ -281,11 +276,6 @@
 
 	class VirtualTableScan : public RecordStream
 	{
-		struct Impure : public RecordSource::Impure
-		{
-			RecordBuffer* irsb_record_buffer;
-		};
-
 	public:
 		VirtualTableScan(CompilerScratch* csb, const Firebird::string& name, UCHAR stream);
 
@@ -298,29 +288,10 @@
 
 		void dump(thread_db* tdbb, Firebird::UCharBuffer& buffer) const;
 
-	private:
-		const Firebird::string m_name;
-	};
+	protected:
+		virtual bool retrieveRecord(thread_db* tdbb, jrd_rel* relation,
+									FB_UINT64 position, Record* record) const = 0;
 
-	class UsersTableScan : public RecordStream
-	{
-		struct Impure : public RecordSource::Impure
-		{
-			RecordBuffer* irsb_record_buffer;
-		};
-
-	public:
-		UsersTableScan(CompilerScratch* csb, const Firebird::string& name, UCHAR stream);
-
-		void open(thread_db* tdbb) const;
-		void close(thread_db* tdbb) const;
-
-		bool getRecord(thread_db* tdbb) const;
-		bool refetchRecord(thread_db* tdbb) const;
-		bool lockRecord(thread_db* tdbb) const;
-
-		void dump(thread_db* tdbb, Firebird::UCharBuffer& buffer) const;
-
 	private:
 		const Firebird::string m_name;
 	};
Modified: firebird/trunk/src/jrd/recsrc/VirtualTableScan.cpp
===================================================================
--- firebird/trunk/src/jrd/recsrc/VirtualTableScan.cpp	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/recsrc/VirtualTableScan.cpp	2010-07-13 12:31:35 UTC (rev 51337)
@@ -68,9 +68,6 @@
 	}
 
 	rpb->rpb_number.setValue(BOF_NUMBER);
-
-	DatabaseSnapshot* const snapshot = DatabaseSnapshot::create(tdbb);
-	impure->irsb_record_buffer = snapshot->getData(relation);
 }
 
 void VirtualTableScan::close(thread_db* tdbb) const
@@ -84,7 +81,6 @@
 	if (impure->irsb_flags & irsb_open)
 	{
 		impure->irsb_flags &= ~irsb_open;
-		impure->irsb_record_buffer = NULL;
 	}
 }
 
@@ -102,9 +98,7 @@
 
 	rpb->rpb_number.increment();
 
-	fb_assert(impure->irsb_record_buffer);
-
-	if (impure->irsb_record_buffer->fetch(rpb->rpb_number.getValue(), rpb->rpb_record))
+	if (retrieveRecord(tdbb, rpb->rpb_relation, rpb->rpb_number.getValue(), rpb->rpb_record))
 	{
 		rpb->rpb_number.setValid(true);
 		return true;
Modified: firebird/trunk/src/jrd/relations.h
===================================================================
--- firebird/trunk/src/jrd/relations.h	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/relations.h	2010-07-13 12:31:35 UTC (rev 51337)
@@ -606,7 +606,7 @@
 END_RELATION
 
 // Relation 44 (SEC$USERS)
-RELATION(nam_sec_users, rel_sec_users, ODS_12_0, rel_vrt_users)
+RELATION(nam_sec_users, rel_sec_users, ODS_12_0, rel_virtual)
 	FIELD(f_sec_user_name, nam_user_name, fld_user, 1, ODS_12_0)
 	FIELD(f_sec_group_name, nam_group_name, fld_user, 1, ODS_12_0)
 	FIELD(f_sec_uid, nam_uid, fld_uid, 1, ODS_12_0)
Modified: firebird/trunk/src/jrd/types.h
===================================================================
--- firebird/trunk/src/jrd/types.h	2010-07-13 11:03:55 UTC (rev 51336)
+++ firebird/trunk/src/jrd/types.h	2010-07-13 12:31:35 UTC (rev 51337)
@@ -112,7 +112,6 @@
 TYPE ("VIRTUAL", rel_virtual, nam_r_type)
 TYPE ("GLOBAL_TEMPORARY_PRESERVE", rel_global_temp_preserve, nam_r_type)
 TYPE ("GLOBAL_TEMPORARY_DELETE", rel_global_temp_delete, nam_r_type)
-TYPE ("USERS LIST", rel_vrt_users, nam_r_type)
 
 TYPE ("LEGACY", prc_legacy, nam_prc_type)
 TYPE ("SELECTABLE", prc_selectable, nam_prc_type)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <asf...@us...> - 2010-07-15 00:47:30
       | 
| Revision: 51342
          http://firebird.svn.sourceforge.net/firebird/?rev=51342&view=rev
Author:   asfernandes
Date:     2010-07-15 00:47:24 +0000 (Thu, 15 Jul 2010)
Log Message:
-----------
Misc
Modified Paths:
--------------
    firebird/trunk/builds/posix/Makefile.in.firebird
    firebird/trunk/src/jrd/UserManagement.cpp
    firebird/trunk/src/jrd/svc.cpp
    firebird/trunk/src/utilities/gsec/gsec.cpp
    firebird/trunk/src/utilities/gsec/secur_proto.h
    firebird/trunk/src/utilities/gsec/security.epp
Modified: firebird/trunk/builds/posix/Makefile.in.firebird
===================================================================
--- firebird/trunk/builds/posix/Makefile.in.firebird	2010-07-14 10:29:09 UTC (rev 51341)
+++ firebird/trunk/builds/posix/Makefile.in.firebird	2010-07-15 00:47:24 UTC (rev 51342)
@@ -76,7 +76,7 @@
 #    use the static files as a last resort.
 #
 #  The bootstrap version of gpre (gpre_boot) is used to build all the
-#    engine file.  
+#    engine file.
 #    During this phase of the build process the limited version of alt.bin
 #    is used.  The full version of alt.bin is compiled later in the build
 #    process after the security database is available.  After the
Modified: firebird/trunk/src/jrd/UserManagement.cpp
===================================================================
--- firebird/trunk/src/jrd/UserManagement.cpp	2010-07-14 10:29:09 UTC (rev 51341)
+++ firebird/trunk/src/jrd/UserManagement.cpp	2010-07-15 00:47:24 UTC (rev 51342)
@@ -196,33 +196,53 @@
 	int attachment_charset = ttype_none;
 
 	if (u->user_name_entered)
+	{
 		putField(threadDbb, record,
 				 DumpField(f_sec_user_name, VALUE_STRING, strlen(u->user_name), u->user_name),
 				 attachment_charset);
+	}
+
 	if (u->group_name_entered)
+	{
 		putField(threadDbb, record,
 				 DumpField(f_sec_group_name, VALUE_STRING, strlen(u->group_name), u->group_name),
 				 attachment_charset);
+	}
+
 	if (u->uid_entered)
+	{
 		putField(threadDbb, record,
 				 DumpField(f_sec_uid, VALUE_INTEGER, sizeof(int), &u->uid),
 				 attachment_charset);
+	}
+
 	if (u->gid_entered)
+	{
 		putField(threadDbb, record,
 				 DumpField(f_sec_gid, VALUE_INTEGER, sizeof(int), &u->gid),
 				 attachment_charset);
+	}
+
 	if (u->first_name_entered)
+	{
 		putField(threadDbb, record,
 				 DumpField(f_sec_first_name, VALUE_STRING, strlen(u->first_name), u->first_name),
 				 attachment_charset);
+	}
+
 	if (u->middle_name_entered)
+	{
 		putField(threadDbb, record,
 				 DumpField(f_sec_middle_name, VALUE_STRING, strlen(u->middle_name), u->middle_name),
 				 attachment_charset);
+	}
+
 	if (u->last_name_entered)
+	{
 		putField(threadDbb, record,
 				 DumpField(f_sec_last_name, VALUE_STRING, strlen(u->last_name), u->last_name),
 				 attachment_charset);
+	}
 
 	buffer->store(record);
 }
Modified: firebird/trunk/src/jrd/svc.cpp
===================================================================
--- firebird/trunk/src/jrd/svc.cpp	2010-07-14 10:29:09 UTC (rev 51341)
+++ firebird/trunk/src/jrd/svc.cpp	2010-07-15 00:47:24 UTC (rev 51342)
@@ -1925,7 +1925,8 @@
 	// Only need to add username and password information to those calls which need
 	// to make a database connection
 
-	const bool flNeedUser = (svc_id == isc_action_svc_backup ||
+	const bool flNeedUser =
+		svc_id == isc_action_svc_backup ||
 		svc_id == isc_action_svc_restore ||
 		svc_id == isc_action_svc_nbak ||
 		svc_id == isc_action_svc_nrest ||
@@ -1936,15 +1937,16 @@
 		svc_id == isc_action_svc_trace_stop ||
 		svc_id == isc_action_svc_trace_suspend ||
 		svc_id == isc_action_svc_trace_resume ||
-		svc_id == isc_action_svc_trace_list);
+		svc_id == isc_action_svc_trace_list;
 
-	const bool flGsecUser = (svc_id == isc_action_svc_add_user ||
+	const bool flGsecUser =
+		svc_id == isc_action_svc_add_user ||
 		svc_id == isc_action_svc_delete_user ||
 		svc_id == isc_action_svc_modify_user ||
 		svc_id == isc_action_svc_display_user ||
 		svc_id == isc_action_svc_display_user_adm ||
 		svc_id == isc_action_svc_set_mapping ||
-		svc_id == isc_action_svc_drop_mapping);
+		svc_id == isc_action_svc_drop_mapping;
 
 	if (flNeedUser || flGsecUser)
 	{
@@ -1975,7 +1977,6 @@
 		}
 	}
 
-
 	// All services except for get_ib_log require switches
 	spb.rewind();
 	if ((!svc_switches.hasData()) && svc_id != isc_action_svc_get_fb_log)
Modified: firebird/trunk/src/utilities/gsec/gsec.cpp
===================================================================
--- firebird/trunk/src/utilities/gsec/gsec.cpp	2010-07-14 10:29:09 UTC (rev 51341)
+++ firebird/trunk/src/utilities/gsec/gsec.cpp	2010-07-15 00:47:24 UTC (rev 51342)
@@ -278,7 +278,7 @@
 				uSvc->started();
 			if (! useServices)
 			{
-				ret = SECURITY_exec_line(status, tdsec->tsec_real_user, 
+				ret = SECURITY_exec_line(status, tdsec->tsec_real_user,
 										 db_handle, user_data, data_print, NULL);
 				if (ret)
 				{
Modified: firebird/trunk/src/utilities/gsec/secur_proto.h
===================================================================
--- firebird/trunk/src/utilities/gsec/secur_proto.h	2010-07-14 10:29:09 UTC (rev 51341)
+++ firebird/trunk/src/utilities/gsec/secur_proto.h	2010-07-15 00:47:24 UTC (rev 51342)
@@ -33,4 +33,3 @@
 							void* callback_arg);
 
 #endif // UTILITIES_SECUR_PROTO_H
-
Modified: firebird/trunk/src/utilities/gsec/security.epp
===================================================================
--- firebird/trunk/src/utilities/gsec/security.epp	2010-07-14 10:29:09 UTC (rev 51341)
+++ firebird/trunk/src/utilities/gsec/security.epp	2010-07-15 00:47:24 UTC (rev 51342)
@@ -85,7 +85,7 @@
 }
 
 
-static bool storePasswd(ISC_STATUS* isc_status, FB_API_HANDLE DB, FB_API_HANDLE trans, 
+static bool storePasswd(ISC_STATUS* isc_status, FB_API_HANDLE DB, FB_API_HANDLE trans,
 						ISC_QUAD& blobId, const Firebird::string& passwd)
 {
 	UserBlob blob(isc_status);
@@ -98,6 +98,7 @@
 
 	if (!blob.putData(passwd.length(), passwd.c_str()))
 	{
+		blob.close();
 		return false;
 	}
 
@@ -105,7 +106,7 @@
 }
 
 SSHORT SECURITY_exec_line(ISC_STATUS* isc_status,
-						  const char *realUser,
+						  const char* realUser,
 						  FB_API_HANDLE DB,
 						  FB_API_HANDLE trans,
 						  internal_user_data* io_user_data,
@@ -544,7 +545,7 @@
 }
 
 SSHORT SECURITY_exec_line(ISC_STATUS* isc_status,
-						  const char *realUser,
+						  const char* realUser,
 						  FB_API_HANDLE DB,
 						  internal_user_data* io_user_data,
 						  FPTR_SECURITY_CALLBACK display_func,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ale...@us...> - 2010-07-23 12:04:26
       | 
| Revision: 51355
          http://firebird.svn.sourceforge.net/firebird/?rev=51355&view=rev
Author:   alexpeshkoff
Date:     2010-07-23 12:04:18 +0000 (Fri, 23 Jul 2010)
Log Message:
-----------
Implemented self-registering plugins format (same plugin can be easily linked statically
or as dynamic library, depending upon platform requirements). Self-registering plugins
need not export any functions, instead they call fb_register_plugin() on startup.
Reworked all user management to use self-registering plugins.
Removed system table RDB$USERS. PLG$USERS is not created automatically by plugin, but
will be later (work in progress).
Modified Paths:
--------------
    firebird/trunk/builds/posix/Makefile.in.client.gsec
    firebird/trunk/builds/posix/Makefile.in.embed.util
    firebird/trunk/builds/posix/Makefile.in.fbserver
    firebird/trunk/builds/posix/Makefile.in.firebird
    firebird/trunk/builds/posix/Makefile.in.smp_server
    firebird/trunk/builds/posix/firebird.vers
    firebird/trunk/builds/posix/make.defaults
    firebird/trunk/builds/posix/make.rules
    firebird/trunk/builds/posix/make.shared.variables
    firebird/trunk/configure.in
    firebird/trunk/src/auth/Auth.cpp
    firebird/trunk/src/auth/Auth.h
    firebird/trunk/src/auth/AuthInterface.h
    firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp
    firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h
    firebird/trunk/src/common/classes/Interface.h
    firebird/trunk/src/dbs/security.sql
    firebird/trunk/src/include/FirebirdPluginApi.h
    firebird/trunk/src/include/gen/ids.h
    firebird/trunk/src/jrd/PluginManager.h
    firebird/trunk/src/jrd/fields.h
    firebird/trunk/src/jrd/gds.cpp
    firebird/trunk/src/jrd/idx.h
    firebird/trunk/src/jrd/ini.epp
    firebird/trunk/src/jrd/jrd_pwd.h
    firebird/trunk/src/jrd/names.h
    firebird/trunk/src/jrd/os/posix/mod_loader.cpp
    firebird/trunk/src/jrd/pwd.cpp
    firebird/trunk/src/jrd/relations.h
    firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp
    firebird/trunk/src/remote/interface.cpp
    firebird/trunk/src/remote/server.cpp
Added Paths:
-----------
    firebird/trunk/builds/posix/Makefile.in.user.management
    firebird/trunk/src/auth/AuthDbg.cpp
    firebird/trunk/src/auth/AuthDbg.h
    firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp
    firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h
    firebird/trunk/src/common/classes/ImplementHelper.h
    firebird/trunk/src/misc/smallog.cpp
    firebird/trunk/src/utilities/gsec/security.cpp
Removed Paths:
-------------
    firebird/trunk/src/utilities/gsec/security.epp
Property Changed:
----------------
    firebird/trunk/builds/posix/Makefile.in.client.gsec
    firebird/trunk/builds/posix/Makefile.in.embed.util
    firebird/trunk/builds/posix/Makefile.in.fbserver
    firebird/trunk/builds/posix/Makefile.in.firebird
    firebird/trunk/builds/posix/Makefile.in.smp_server
    firebird/trunk/builds/posix/firebird.vers
    firebird/trunk/builds/posix/make.defaults
    firebird/trunk/builds/posix/make.rules
    firebird/trunk/builds/posix/make.shared.variables
    firebird/trunk/configure.in
    firebird/trunk/src/auth/Auth.cpp
    firebird/trunk/src/auth/Auth.h
    firebird/trunk/src/auth/AuthInterface.h
    firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp
    firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h
    firebird/trunk/src/common/classes/Interface.h
    firebird/trunk/src/dbs/security.sql
    firebird/trunk/src/include/FirebirdPluginApi.h
    firebird/trunk/src/include/gen/ids.h
    firebird/trunk/src/jrd/PluginManager.h
    firebird/trunk/src/jrd/fields.h
    firebird/trunk/src/jrd/gds.cpp
    firebird/trunk/src/jrd/idx.h
    firebird/trunk/src/jrd/ini.epp
    firebird/trunk/src/jrd/jrd_pwd.h
    firebird/trunk/src/jrd/names.h
    firebird/trunk/src/jrd/os/posix/mod_loader.cpp
    firebird/trunk/src/jrd/pwd.cpp
    firebird/trunk/src/jrd/relations.h
    firebird/trunk/src/plugins/udr_engine/UdrEngine.cpp
    firebird/trunk/src/remote/interface.cpp
Modified: firebird/trunk/builds/posix/Makefile.in.client.gsec
===================================================================
--- firebird/trunk/builds/posix/Makefile.in.client.gsec	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/builds/posix/Makefile.in.client.gsec	2010-07-23 12:04:18 UTC (rev 51355)
@@ -29,8 +29,7 @@
 
 @SET_MAKE@
 
-GSEC_Other_Sources = jrd/isc_file.cpp jrd/ThreadData.cpp jrd/enc.cpp \
-					 jrd/sha.cpp jrd/guid.cpp
+GSEC_Other_Sources = jrd/isc_file.cpp jrd/ThreadData.cpp
 GSEC_Files =  gsec.cpp call_service.cpp gsecMain.cpp security.cpp
 GSEC_Sources = $(addprefix utilities/gsec/, $(GSEC_Files)) $(GSEC_Other_Sources)
 GSEC_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(GSEC_Sources))))
Property changes on: firebird/trunk/builds/posix/Makefile.in.client.gsec
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Modified: firebird/trunk/builds/posix/Makefile.in.embed.util
===================================================================
--- firebird/trunk/builds/posix/Makefile.in.embed.util	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/builds/posix/Makefile.in.embed.util	2010-07-23 12:04:18 UTC (rev 51355)
@@ -70,7 +70,7 @@
 DROP_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(DROP_Sources)))) $(FBCOMMON_ClientObjects)
 
 
-GSEC_Other_Sources = jrd/enc.cpp jrd/sha.cpp jrd/guid.cpp \
+GSEC_Other_Sources = \
 jrd/isc_file.cpp common/config/config.cpp common/config/config_file.cpp \
 common/config/ConfigCache.cpp common/config/dir_list.cpp \
 jrd/ThreadData.cpp $(OS_SPECIFIC_Sources)
Property changes on: firebird/trunk/builds/posix/Makefile.in.embed.util
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Modified: firebird/trunk/builds/posix/Makefile.in.fbserver
===================================================================
--- firebird/trunk/builds/posix/Makefile.in.fbserver	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/builds/posix/Makefile.in.fbserver	2010-07-23 12:04:18 UTC (rev 51355)
@@ -39,10 +39,15 @@
 
 @SET_MAKE@
 
+SERVER_Other_sources = jrd/pwd.cpp jrd/sha.cpp
+SERVER_Other Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(SERVER_Other_sources))))
+
 SERVER_Files = $(OS_ServerFiles) server.cpp
-SERVER_Sources = $(addprefix remote/, $(SERVER_Files)) jrd/pwd.cpp
-SERVER_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(SERVER_Sources)))) $(LIBFBSERVER_Objects) $(COMMON_Objects)
+SERVER_Sources = $(addprefix remote/, $(SERVER_Files))
+SERVER_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(SERVER_Sources)))) \
+                 $(LIBFBSERVER_Objects) $(COMMON_Objects) $(SERVER_Other Objects)
 
+
 .PHONY: fbserver
 
 
Property changes on: firebird/trunk/builds/posix/Makefile.in.fbserver
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Modified: firebird/trunk/builds/posix/Makefile.in.firebird
===================================================================
--- firebird/trunk/builds/posix/Makefile.in.firebird	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/builds/posix/Makefile.in.firebird	2010-07-23 12:04:18 UTC (rev 51355)
@@ -134,7 +134,7 @@
 .PHONY: all firebird firebird_boot firebird_basic
 .PHONY: firebird_embedded firebird_server classic_programs super_programs
 .PHONY: firebird_super firebird_classic btyacc_binary
-.PHONY: fbtrace
+.PHONY: plugins2
 
 
 # The main targets are firebird_embedded or firebird_server
@@ -145,8 +145,8 @@
 
 firebird : firebird_@FIREBIRD_ARCH_TYPE@ $(PLATFORM_POSTBUILD_TARGET)
 
-firebird_classic firebird_embedded: firebird_basic classic_targets fbtrace
-firebird_super firebird_server: firebird_basic super_targets fbtrace
+firebird_classic firebird_embedded: firebird_basic classic_targets plugins2
+firebird_super firebird_server: firebird_basic super_targets plugins2
 
 
 
@@ -414,8 +414,9 @@
 
 #---------------------------------------------------------------------------
 
-fbtrace:
+plugins2:
 	$(MAKE) $(CPU_OPTION) -f $(GEN_ROOT)/Makefile.fbtrace
+	$(MAKE) $(CPU_OPTION) -f $(GEN_ROOT)/Makefile.user.management
 
 
 #---------------------------------------------------------------------------
Property changes on: firebird/trunk/builds/posix/Makefile.in.firebird
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Modified: firebird/trunk/builds/posix/Makefile.in.smp_server
===================================================================
--- firebird/trunk/builds/posix/Makefile.in.smp_server	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/builds/posix/Makefile.in.smp_server	2010-07-23 12:04:18 UTC (rev 51355)
@@ -42,8 +42,8 @@
 SERVER_JrdFiles = ThreadData.cpp divorce.cpp dsc.cpp enc.cpp isc_file.cpp isc.cpp \
 sdl.cpp status.cpp 
 SERVER_Files = $(OS_ServerFiles) server.cpp
-SERVER_Other_sources = common/cvt.cpp common/classes/DbImplementation.cpp \
-jrd/pwd.cpp jrd/sha.cpp jrd/guid.cpp auth/Auth.cpp
+SERVER_Other_sources = common/cvt.cpp common/classes/DbImplementation.cpp auth/Auth.cpp \
+jrd/pwd.cpp jrd/sha.cpp jrd/guid.cpp 
 SERVER_Sources = $(addprefix remote/, $(SERVER_Files)) $(addprefix jrd/, $(SERVER_JrdFiles)) $(SERVER_Other_sources)
 
 REMOTE_CommonSources = $(addprefix remote/, $(REMOTE_CommonFiles))
Property changes on: firebird/trunk/builds/posix/Makefile.in.smp_server
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: firebird/trunk/builds/posix/Makefile.in.user.management
===================================================================
--- firebird/trunk/builds/posix/Makefile.in.user.management	                        (rev 0)
+++ firebird/trunk/builds/posix/Makefile.in.user.management	2010-07-23 12:04:18 UTC (rev 51355)
@@ -0,0 +1,81 @@
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+# You may obtain a copy of the Licence at
+# http://www.gnu.org/licences/lgpl.html
+# 
+# As a special exception this file can also be included in modules
+# with other source code as long as that source code has been 
+# released under an Open Source Initiative certificed licence.  
+# More information about OSI certification can be found at: 
+# http://www.opensource.org 
+# 
+# This module 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 Lesser General Public Licence for more details.
+# 
+# This module was created by members of the firebird development 
+# team.  All individual contributions remain the Copyright (C) of 
+# those individuals and all rights are reserved.  Contributors to 
+# this file are either listed below or can be obtained from a CVS 
+# history command.
+#
+#  Created by:  Mark O'Donohue <mar...@lu...>
+#
+#  Contributor(s):
+# 
+#
+#
+ROOT=..
+ObjModuleType=std
+
+include     $(ROOT)/gen/make.defaults
+include     $(ROOT)/gen/make.platform
+include     $(ROOT)/gen/make.rules
+include     $(ROOT)/gen/make.shared.variables
+
+@SET_MAKE@
+
+
+USER_MANAGEMENT_Files = LegacyManagement.epp
+
+USER_MANAGEMENT_Sources = $(addprefix auth/SecurityDatabase/, $(USER_MANAGEMENT_Files))
+
+USER_MANAGEMENT_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(USER_MANAGEMENT_Sources))))
+
+
+MANAGEMENT_OTHER_Sources = jrd/enc.cpp jrd/sha.cpp jrd/guid.cpp common/classes/alloc.cpp \
+common/classes/locks.cpp common/classes/UserBlob.cpp common/classes/init.cpp common/classes/fb_string.cpp \
+common/fb_exception.cpp common/thd.cpp common/StatusArg.cpp
+
+
+MANAGEMENT_OTHER_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(MANAGEMENT_OTHER_Sources))))
+
+
+MANAGEMENT_Objects = $(USER_MANAGEMENT_Objects) $(MANAGEMENT_OTHER_Objects)
+#$(FBCLASSES_ClientObjects) $(FBCOMMON_ClientObjects)
+#				  $(CONFIG_Objects) \
+#				  $(FBCLASSES_MsgObjects) \
+#				  $(FBCONFIG_Objects)
+
+
+AllObjects = $(MANAGEMENT_Objects)
+Dependencies = $(AllObjects:.o=.d)
+
+
+.PHONY: all user_management
+
+
+all : user_management
+
+user_management: $(MANAGEMENT)
+
+$(MANAGEMENT):	$(MANAGEMENT_Objects)
+	$(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(MANAGEMENT).0) -o $@ $^ $(LINK_PLUG_LIBS)
+
+
+include $(ROOT)/gen/make.shared.targets
+
+-include $(Dependencies)
Property changes on: firebird/trunk/builds/posix/Makefile.in.user.management
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
Modified: firebird/trunk/builds/posix/firebird.vers
===================================================================
--- firebird/trunk/builds/posix/firebird.vers	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/builds/posix/firebird.vers	2010-07-23 12:04:18 UTC (rev 51355)
@@ -333,6 +333,11 @@
 fb_shutdown
 fb_shutdown_callback
 
+# Plugins support
+
+fb_register_plugin
+fb_query_plugin
+
 # Other misc functions
 
 isc_ftof
Property changes on: firebird/trunk/builds/posix/firebird.vers
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Modified: firebird/trunk/builds/posix/make.defaults
===================================================================
--- firebird/trunk/builds/posix/make.defaults	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/builds/posix/make.defaults	2010-07-23 12:04:18 UTC (rev 51355)
@@ -317,6 +317,9 @@
  $(call LIB_LINK_SONAME,$(SharedLibrarySoName)) $(call LIB_LINK_RPATH,lib)
 LINK_EMBED_LIBS = -L$(LIB) $(LIB_GUI) $(SO_LINK_LIBS) $(ICU_LIBS)
 
+LINK_PLUGIN = $(LIB_LINK) $(LINK_EMPTY_SYMBOLS) $(LIB_LINK_OPTIONS) $(call LIB_LINK_RPATH,lib)
+LINK_PLUG_LIBS = -L$(LIB) $(SO_LINK_LIBS)
+
 # From utilities
 CREATE_DB	= $(BIN)/create_db$(EXEC_EXT)
 GDS_DROP	= $(BIN)/gds_drop$(EXEC_EXT)
@@ -339,6 +342,7 @@
 INSTSVC		= $(BIN)/instsvc$(EXEC_EXT)
 ISC_GDB		= $(FIREBIRD)/security2.fdb
 ISC_GBAK	= $(BIN)/security.gbak
+MANAGEMENT	= $(PLUGINS)/$(LIB_PREFIX)user_management.$(SHRLIB_EXT)
 
 # From qli
 QLI            = $(BIN)/qli$(EXEC_EXT)
Property changes on: firebird/trunk/builds/posix/make.defaults
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Modified: firebird/trunk/builds/posix/make.rules
===================================================================
--- firebird/trunk/builds/posix/make.rules	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/builds/posix/make.rules	2010-07-23 12:04:18 UTC (rev 51355)
@@ -127,7 +127,7 @@
 	$(OBJ)/jrd/fun.epp $(OBJ)/jrd/dyn.epp $(OBJ)/jrd/dfw.epp $(OBJ)/jrd/dyn_util.epp \
 	$(OBJ)/jrd/pcmet.epp $(OBJ)/jrd/met.epp $(OBJ)/jrd/dpm.epp $(OBJ)/utilities/rebuild/rstore.epp \
 	$(OBJ)/utilities/rebuild/rmet.epp $(OBJ)/utilities/gstat/dba.epp $(OBJ)/utilities/stats.epp \
-	$(OBJ)/utilities/gsec/security.epp $(OBJ)/alice/alice_meta.epp $(OBJ)/qli/meta.epp \
+	$(OBJ)/auth/SecurityDatabase/LegacyManagement.epp $(OBJ)/alice/alice_meta.epp $(OBJ)/qli/meta.epp \
 	$(OBJ)/qli/proc.epp $(OBJ)/qli/show.epp $(OBJ)/qli/help.epp $(OBJ)/misc/codes.epp \
 	$(OBJ)/gpre/gpre_meta.epp $(OBJ)/dsql/blob.epp $(OBJ)/dsql/array.epp \
 	$(OBJ)/dsql/PackageNodes.epp $(OBJ)/dsql/metd.epp $(OBJ)/dsql/DdlNodes.epp $(OBJ)/isql/show.epp \
Property changes on: firebird/trunk/builds/posix/make.rules
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Modified: firebird/trunk/builds/posix/make.shared.variables
===================================================================
--- firebird/trunk/builds/posix/make.shared.variables	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/builds/posix/make.shared.variables	2010-07-23 12:04:18 UTC (rev 51355)
@@ -14,7 +14,7 @@
 
 
 JRD_ClientFiles = alt.cpp db_alias.cpp dsc.cpp \
-		enc.cpp gds.cpp isc.cpp isc_file.cpp isc_ipc.cpp \
+		gds.cpp isc.cpp isc_file.cpp isc_ipc.cpp \
 		perf.cpp sdl.cpp status.cpp \
 		ThreadData.cpp ThreadStart.cpp utl.cpp \
         $(WHY_Sources)
@@ -41,7 +41,7 @@
 		sdw.cpp shut.cpp sort.cpp sqz.cpp \
 		svc.cpp SysFunction.cpp TempSpace.cpp tpc.cpp tra.cpp validation.cpp \
 		ValueImpl.cpp ValuesImpl.cpp vio.cpp \
-		nodebug.cpp nbak.cpp sha.cpp $(Physical_IO_Module) TextType.cpp \
+		nodebug.cpp nbak.cpp $(Physical_IO_Module) TextType.cpp \
 		unicode_util.cpp RuntimeStatistics.cpp DebugInterface.cpp \
 		extds/ExtDS.cpp extds/InternalDS.cpp extds/IscDS.cpp \
 		trace/TraceConfigStorage.cpp trace/TraceLog.cpp \
@@ -114,7 +114,7 @@
 
 
 INTERFACE_Sources = $(addprefix remote/, $(INTERFACE_Files)) \
-			auth/Auth.cpp auth/SecurityDatabase/LegacyClient.cpp
+			auth/Auth.cpp auth/AuthDbg.cpp auth/SecurityDatabase/LegacyClient.cpp jrd/enc.cpp
 INTERFACE_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(INTERFACE_Sources))))
 
 ifeq ($(PLATFORM),win32)
@@ -357,7 +357,7 @@
 # MOD 29-July-2002
 
 # Stub for services entrypoints missing in static library
-STUB_Sources = jrd/svc_stub.cpp utilities/gsec/security.epp
+STUB_Sources = jrd/svc_stub.cpp utilities/gsec/security.cpp
 STUB_Objects = $(addprefix $(OBJ)/, $(addsuffix .o, $(basename $(STUB_Sources))))
 
 
Property changes on: firebird/trunk/builds/posix/make.shared.variables
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Modified: firebird/trunk/configure.in
===================================================================
--- firebird/trunk/configure.in	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/configure.in	2010-07-23 12:04:18 UTC (rev 51355)
@@ -1371,6 +1371,7 @@
 gen/Makefile.embed.qli:${MAKE_SRC_DIR}/Makefile.in.embed.qli
 gen/Makefile.embed.gpre:${MAKE_SRC_DIR}/Makefile.in.embed.gpre
 gen/Makefile.fbtrace:${MAKE_SRC_DIR}/Makefile.in.fbtrace
+gen/Makefile.user.management:${MAKE_SRC_DIR}/Makefile.in.user.management
 gen/Makefile.install:builds/install/arch-specific/${INSTALL_PREFIX}/Makefile.in
 Makefile:Makefile.in
 )
Property changes on: firebird/trunk/configure.in
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Modified: firebird/trunk/src/auth/Auth.cpp
===================================================================
--- firebird/trunk/src/auth/Auth.cpp	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/src/auth/Auth.cpp	2010-07-23 12:04:18 UTC (rev 51355)
@@ -28,137 +28,10 @@
 #include "firebird.h"
 #include "../auth/Auth.h"
 #include "../jrd/ibase.h"
+#include "../common/classes/ImplementHelper.h"
 
-#ifdef AUTH_DEBUG
-
-namespace
-{
-	void debugName(const char** data, unsigned short* dataSize)
-	{
-		// Construct a copy of the literal so we don't violate the constness.
-		// The caller can do anything with the pointer unless we change getName() signature.
-		static char name[] = "DEBUG_AUTH";
-		*data = name;
-		*dataSize = strlen(name);
-	}
-}
-
 namespace Auth {
 
-ServerInstance* DebugServer::instance()
-{
-	return interfaceAlloc<DebugServerInstance>();
-}
-
-ClientInstance* DebugClient::instance()
-{
-	return interfaceAlloc<DebugClientInstance>();
-}
-
-void DebugServer::getName(const char** data, unsigned short* dataSize)
-{
-	debugName(data, dataSize);
-}
-
-void DebugClient::getName(const char** data, unsigned short* dataSize)
-{
-	debugName(data, dataSize);
-}
-
-void DebugServer::release()
-{
-	interfaceFree(this);
-}
-
-void DebugClient::release()
-{
-	interfaceFree(this);
-}
-
-DebugServerInstance::DebugServerInstance()
-	: str(*getDefaultMemoryPool())
-{ }
-
-Result DebugServerInstance::startAuthentication(bool isService, const char* dbName,
-												const unsigned char* dpb, unsigned int dpbSize,
-												WriterInterface* writerInterface)
-{
-	str.erase();
-	Firebird::ClumpletReader rdr(isService ?
-		Firebird::ClumpletReader::spbList :
-		Firebird::ClumpletReader::dpbList, dpb, dpbSize);
-
-	if (rdr.find(isService ? isc_spb_trusted_auth : isc_dpb_trusted_auth))
-	{
-		str.assign(rdr.getBytes(), rdr.getClumpLength());
-	}
-
-	str += '_';
-	return AUTH_MORE_DATA;
-}
-
-Result DebugServerInstance::contAuthentication(WriterInterface* writerInterface,
-											   const unsigned char* data, unsigned int size)
-{
-	//fprintf(stderr, "DebugServerInstance::contAuthentication: %.*s\n", size, data);
-	writerInterface->add(Firebird::string((const char*) data, size).c_str(), "DEBUG", "");
-	return AUTH_SUCCESS;
-}
-
-void DebugServerInstance::getData(const unsigned char** data, unsigned short* dataSize)
-{
-	*data = reinterpret_cast<const unsigned char*>(str.c_str());
-	*dataSize = str.length();
-	//fprintf(stderr, "DebugServerInstance::getData: %.*s\n", *dataSize, *data);
-}
-
-void DebugServerInstance::release()
-{
-	interfaceFree(this);
-}
-
-DebugClientInstance::DebugClientInstance()
-	: str(*getDefaultMemoryPool())
-{ }
-
-Result DebugClientInstance::startAuthentication(bool isService, const char*, DpbInterface* dpb)
-{
-	str = "HAND";
-	if (dpb)
-	{
-		dpb->add(isService ? isc_spb_trusted_auth : isc_dpb_trusted_auth,
-					str.c_str(), str.length());
-		return AUTH_SUCCESS;
-	}
-	return AUTH_MORE_DATA;
-}
-
-Result DebugClientInstance::contAuthentication(const unsigned char* data, unsigned int size)
-{
-	//fprintf(stderr, "DebugClientInstance::contAuthentication: %.*s\n", size, data);
-	str.assign(data, size);
-	str += "SHAKE";
-	return AUTH_CONTINUE;
-}
-
-void DebugClientInstance::getData(const unsigned char** data, unsigned short* dataSize)
-{
-	*data = reinterpret_cast<const unsigned char*>(str.c_str());
-	*dataSize = str.length();
-	//fprintf(stderr, "DebugClientInstance::getData: %.*s\n", *dataSize, *data);
-}
-
-void DebugClientInstance::release()
-{
-	interfaceFree(this);
-}
-
-} // namespace Auth
-
-#endif // AUTH_DEBUG
-
-namespace Auth {
-
 WriterImplementation::WriterImplementation(Firebird::MemoryPool& pool, bool svcFlag)
 	: Firebird::PermanentStorage(pool), body(getPool()),
 	  sequence(0), tag(svcFlag ? isc_spb_auth_block : isc_dpb_auth_block)
@@ -202,16 +75,13 @@
 }
 
 
-bool legacy(Plugin* plugin)
+bool legacy(Firebird::Plugin* plugin)
 {
 	const char* legacyTrusted = "WIN_SSPI";
-	const short legLength = strlen(legacyTrusted);
-	const char* nm;
-	USHORT len;
+	const unsigned short legLength = strlen(legacyTrusted);
+	const char* nm = plugin->name();
 
-	plugin->getName(&nm, &len);
-
-	return len == legLength && memcmp(legacyTrusted, nm, legLength) == 0;
+	return strlen(nm) == legLength && memcmp(legacyTrusted, nm, legLength) == 0;
 }
 
 } // namespace Auth
Property changes on: firebird/trunk/src/auth/Auth.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Modified: firebird/trunk/src/auth/Auth.h
===================================================================
--- firebird/trunk/src/auth/Auth.h	2010-07-22 09:36:15 UTC (rev 51354)
+++ firebird/trunk/src/auth/Auth.h	2010-07-23 12:04:18 UTC (rev 51355)
@@ -38,7 +38,7 @@
 
 namespace Auth {
 
-bool legacy(Plugin* plugin);
+bool legacy(Firebird::Plugin* plugin);
 
 class WriterImplementation : public WriterInterface, public Firebird::PermanentStorage
 {
@@ -69,7 +69,7 @@
 	Firebird::ClumpletWriter* body;
 };
 
-//#define AUTH_DEBUG
+#define AUTH_DEBUG
 
 #ifdef AUTH_DEBUG
 
@@ -80,7 +80,6 @@
 {
 public:
 	ServerInstance* instance();
-    void getName(const char** data, unsigned short* dataSize);
     void release();
 };
 
@@ -88,7 +87,6 @@
 {
 public:
 	ClientInstance* instance();
-    void getName(const char** data, unsigned short* dataSize);
     void release();
 };
 
Property changes on: firebird/trunk/src/auth/Auth.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: firebird/trunk/src/auth/AuthDbg.cpp
===================================================================
--- firebird/trunk/src/auth/AuthDbg.cpp	                        (rev 0)
+++ firebird/trunk/src/auth/AuthDbg.cpp	2010-07-23 12:04:18 UTC (rev 51355)
@@ -0,0 +1,133 @@
+/*
+ *	PROGRAM:		Firebird authentication
+ *	MODULE:			Auth.cpp
+ *	DESCRIPTION:	Implementation of interfaces, passed to plugins
+ *					Plugins loader
+ *
+ *  The contents of this file are subject to the Initial
+ *  Developer's Public License Version 1.0 (the "License");
+ *  you may not use this file except in compliance with the
+ *  License. You may obtain a copy of the License at
+ *  http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
+ *
+ *  Software distributed under the License is distributed AS IS,
+ *  WITHOUT WARRANTY OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing rights
+ *  and limitations under the License.
+ *
+ *  The Original Code was created by Alex Peshkov
+ *  for the Firebird Open Source RDBMS project.
+ *
+ *  Copyright (c) 2010 Alex Peshkov <peshkoff at mail.ru>
+ *  and all contributors signed below.
+ *
+ *  All Rights Reserved.
+ *  Contributor(s): ______________________________________.
+ */
+
+#include "firebird.h"
+#include "../auth/AuthDbg.h"
+#include "../jrd/ibase.h"
+#include "../common/classes/ImplementHelper.h"
+
+#ifdef AUTH_DEBUG
+
+namespace {
+	char name[] = "DEBUG_AUTH";
+	Firebird::PluginHelper<Auth::DebugServer, Firebird::Plugin::AuthServer, name> debugServer;
+	Firebird::PluginHelper<Auth::DebugClient, Firebird::Plugin::AuthClient, name> debugClient;
+}
+
+namespace Auth {
+
+ServerInstance* DebugServer::instance()
+{
+	return Firebird::interfaceAlloc<DebugServerInstance>(); 
+}
+
+ClientInstance* DebugClient::instance()
+{
+	return Firebird::interfaceAlloc<DebugClientInstance>();
+}
+
+DebugServerInstance::DebugServerInstance()
+	: str(*getDefaultMemoryPool())
+{ }
+
+Result DebugServerInstance::startAuthentication(bool isService, const char* dbName,
+												const unsigned char* dpb, unsigned int dpbSize,
+												WriterInterface* writerInterface)
+{
+	str.erase();
+	Firebird::ClumpletReader rdr(isService ?
+		Firebird::ClumpletReader::spbList :
+		Firebird::ClumpletReader::dpbList, dpb, dpbSize);
+
+	if (rdr.find(isService ? isc_spb_trusted_auth : isc_dpb_trusted_auth))
+	{
+		str.assign(rdr.getBytes(), rdr.getClumpLength());
+	}
+
+	str += '_';
+	return AUTH_MORE_DATA;
+}
+
+Result DebugServerInstance::contAuthentication(WriterInterface* writerInterface,
+											   const unsigned char* data, unsigned int size)
+{
+	//fprintf(stderr, "DebugServerInstance::contAuthentication: %.*s\n", size, data);
+	writerInterface->add(Firebird::string((const char*) data, size).c_str(), "DEBUG", "");
+	return AUTH_SUCCESS;
+}
+
+void DebugServerInstance::getData(const unsigned char** data, unsigned short* dataSize)
+{
+	*data = reinterpret_cast<const unsigned char*>(str.c_str());
+	*dataSize = str.length();
+	//fprintf(stderr, "DebugServerInstance::getData: %.*s\n", *dataSize, *data);
+}
+
+void DebugServerInstance::release()
+{
+	Firebird::interfaceFree(this);
+}
+
+DebugClientInstance::DebugClientInstance()
+	: str(*getDefaultMemoryPool())
+{ }
+
+Result DebugClientInstance::startAuthentication(bool isService, const char*, DpbInterface* dpb)
+{
+	str = "HAND";
+	if (dpb)
+	{
+		dpb->add(isService ? isc_spb_trusted_auth : isc_dpb_trusted_auth,
+					str.c_str(), str.length());
+		return AUTH_SUCCESS;
+	}
+	return AUTH_MORE_DATA;
+}
+
+Result DebugClientInstance::contAuthentication(const unsigned char* data, unsigned int size)
+{
+	//fprintf(stderr, "DebugClientInstance::contAuthentication: %.*s\n", size, data);
+	str.assign(data, size);
+	str += "SHAKE";
+	return AUTH_CONTINUE;
+}
+
+void DebugClientInstance::getData(const unsigned char** data, unsigned short* dataSize)
+{
+	*data = reinterpret_cast<const unsigned char*>(str.c_str());
+	*dataSize = str.length();
+	//fprintf(stderr, "DebugClientInstance::getData: %.*s\n", *dataSize, *data);
+}
+
+void DebugClientInstance::release()
+{
+	Firebird::interfaceFree(this);
+}
+
+} // namespace Auth
+
+#endif // AUTH_DEBUG
Property changes on: firebird/trunk/src/auth/AuthDbg.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
Added: firebird/trunk/src/auth/AuthDbg.h
===================================================================
--- firebird/trunk/src/auth/AuthDbg.h	                        (rev 0)
+++ firebird/trunk/src/auth/AuthDbg.h	2010-07-23 12:04:18 UTC (rev 51355)
@@ -0,0 +1,95 @@
+/*
+ *	PROGRAM:		Firebird authentication
+ *	MODULE:			Auth.h
+ *	DESCRIPTION:	Implementation of interfaces, passed to plugins
+ *					Plugins loader
+ *
+ *  The contents of this file are subject to the Initial
+ *  Developer's Public License Version 1.0 (the "License");
+ *  you may not use this file except in compliance with the
+ *  License. You may obtain a copy of the License at
+ *  http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
+ *
+ *  Software distributed under the License is distributed AS IS,
+ *  WITHOUT WARRANTY OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing rights
+ *  and limitations under the License.
+ *
+ *  The Original Code was created by Alex Peshkov
+ *  for the Firebird Open Source RDBMS project.
+ *
+ *  Copyright (c) 2010 Alex Peshkov <peshkoff at mail.ru>
+ *  and all contributors signed below.
+ *
+ *  All Rights Reserved.
+ *  Contributor(s): ______________________________________.
+ *
+ *
+ */
+
+#ifndef FB_AUTHDBG_H
+#define FB_AUTHDBG_H
+
+//#define AUTH_DEBUG
+
+#ifdef AUTH_DEBUG
+
+#include "../auth/AuthInterface.h"
+#include "../common/classes/ClumpletWriter.h"
+#include "../common/classes/init.h"
+#include "../common/classes/array.h"
+#include "../common/classes/fb_string.h"
+
+namespace Auth {
+
+// The idea of debug plugin is to send some data from server to client,
+// modify them on client and return result (which becomes login name) to the server
+
+class DebugServer : public ServerPlugin
+{
+public:
+	ServerInstance* instance();
+};
+
+class DebugClient : public ClientP...
 
[truncated message content] | 
| 
      
      
      From: <hv...@us...> - 2010-07-23 14:06:35
       | 
| Revision: 51361
          http://firebird.svn.sourceforge.net/firebird/?rev=51361&view=rev
Author:   hvlad
Date:     2010-07-23 14:06:29 +0000 (Fri, 23 Jul 2010)
Log Message:
-----------
Make Windows build work (MSVC8 only) after Alex changes.
Some corrections is still required.
Modified Paths:
--------------
    firebird/trunk/builds/win32/defs/fbclient.def
    firebird/trunk/builds/win32/make_boot.bat
    firebird/trunk/builds/win32/msvc8/gsec.vcproj
    firebird/trunk/builds/win32/msvc8/utilities.vcproj
    firebird/trunk/builds/win32/preprocess.bat
    firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp
    firebird/trunk/src/auth/trusted/AuthSspi.cpp
    firebird/trunk/src/auth/trusted/AuthSspi.h
    firebird/trunk/src/jrd/pwd.cpp
    firebird/trunk/src/remote/os/win32/srvr_w32.cpp
Modified: firebird/trunk/builds/win32/defs/fbclient.def
===================================================================
--- firebird/trunk/builds/win32/defs/fbclient.def	2010-07-23 14:01:54 UTC (rev 51360)
+++ firebird/trunk/builds/win32/defs/fbclient.def	2010-07-23 14:06:29 UTC (rev 51361)
@@ -350,6 +350,9 @@
 	_isc_expand_dpb=isc_expand_dpb
 	_isc_event_block=isc_event_block
 
+	fb_register_plugin
+	fb_query_plugin
+
 ;-----------------
 ; OTHER FUNCTIONS
 ;-----------------
Modified: firebird/trunk/builds/win32/make_boot.bat
===================================================================
--- firebird/trunk/builds/win32/make_boot.bat	2010-07-23 14:01:54 UTC (rev 51360)
+++ firebird/trunk/builds/win32/make_boot.bat	2010-07-23 14:06:29 UTC (rev 51361)
@@ -23,15 +23,16 @@
 @echo Creating directories
 @rmdir /s /q %FB_GEN_DIR% 2>nul
 :: Remove previously generated output, and recreate the directory hierarchy. Note the exceptions to the rule!
-for %%v in ( alice burp dsql gpre isql journal jrd misc msgs qli examples ) do (
+for %%v in ( alice auth burp dsql gpre isql journal jrd misc msgs qli examples ) do (
   if NOT "%%v"=="journal" (@mkdir %FB_GEN_DIR%\%%v )
 )
 
 @rmdir /s /q %FB_GEN_DIR%\utilities 2>nul
 @mkdir %FB_GEN_DIR%\utilities 2>nul
 @mkdir %FB_GEN_DIR%\utilities\gstat 2>nul
-@mkdir %FB_GEN_DIR%\utilities\gsec 2>nul
 
+@mkdir %FB_GEN_DIR%\auth\SecurityDatabase 2>nul
+
 ::=======
 call :btyacc
 if "%ERRLEV%"=="1" goto :END
Modified: firebird/trunk/builds/win32/msvc8/gsec.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc8/gsec.vcproj	2010-07-23 14:01:54 UTC (rev 51360)
+++ firebird/trunk/builds/win32/msvc8/gsec.vcproj	2010-07-23 14:06:29 UTC (rev 51361)
@@ -332,7 +332,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\..\gen\$(PlatformName)\utilities\gsec\security.cpp"
+				RelativePath="..\..\..\src\utilities\gsec\security.cpp"
 				>
 			</File>
 		</Filter>
Modified: firebird/trunk/builds/win32/msvc8/utilities.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc8/utilities.vcproj	2010-07-23 14:01:54 UTC (rev 51360)
+++ firebird/trunk/builds/win32/msvc8/utilities.vcproj	2010-07-23 14:06:29 UTC (rev 51361)
@@ -273,6 +273,10 @@
 				RelativePath="..\..\..\src\utilities\gsec\gsec.cpp"
 				>
 			</File>
+			<File
+				RelativePath="..\..\..\src\utilities\gsec\security.cpp"
+				>
+			</File>
 			<Filter
 				Name="epp files"
 				Filter="epp"
@@ -289,16 +293,12 @@
 					RelativePath="..\..\..\src\utilities\rstore.epp"
 					>
 				</File>
-				<File
-					RelativePath="..\..\..\src\utilities\security.epp"
-					>
-				</File>
 			</Filter>
 			<Filter
 				Name="Generated files"
 				>
 				<File
-					RelativePath="..\..\..\gen\$(PlatformName)\utilities\gsec\security.cpp"
+					RelativePath="..\..\..\gen\Win32\auth\SecurityDatabase\LegacyManagement.cpp"
 					>
 				</File>
 			</Filter>
Modified: firebird/trunk/builds/win32/preprocess.bat
===================================================================
--- firebird/trunk/builds/win32/preprocess.bat	2010-07-23 14:01:54 UTC (rev 51360)
+++ firebird/trunk/builds/win32/preprocess.bat	2010-07-23 14:06:29 UTC (rev 51361)
@@ -74,6 +74,7 @@
 :MASTER_PROCESS
 @set GPRE=%FB_GEN_DIR%\gpre_embed
 @for %%i in (alice_meta) do @call :PREPROCESS alice %%i
+@for %%i in (LegacyManagement) do @call :PREPROCESS auth/SecurityDatabase %%i
 @for %%i in (backup, restore, OdsDetection) do @call :PREPROCESS burp %%i
 @for %%i in (array, blob) do @call :PREPROCESS dsql %%i
 @for %%i in (metd) do @call :PREPROCESS dsql %%i -gds_cxx
@@ -85,7 +86,6 @@
 @for %%i in (help, meta, proc, show) do @call :PREPROCESS qli %%i
 @for %%i in (extract, isql, show) do @call :PREPROCESS isql %%i
 @for %%i in (dba) do @call :PREPROCESS utilities/gstat %%i
-@for %%i in (security) do @call :PREPROCESS utilities/gsec %%i
 @for %%i in (stats) do @call :PREPROCESS utilities %%i
 @goto :EOF
 
Modified: firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp
===================================================================
--- firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp	2010-07-23 14:01:54 UTC (rev 51360)
+++ firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp	2010-07-23 14:06:29 UTC (rev 51361)
@@ -31,8 +31,10 @@
 #include "../common/classes/ImplementHelper.h"
 
 namespace {
+#ifndef WIN_NT
 	char name[] = "LEGACY_AUTH";
 	Firebird::PluginHelper<Auth::SecurityDatabaseClient, Firebird::Plugin::AuthClient, name> client;
+#endif
 }
 
 namespace Auth {
Modified: firebird/trunk/src/auth/trusted/AuthSspi.cpp
===================================================================
--- firebird/trunk/src/auth/trusted/AuthSspi.cpp	2010-07-23 14:01:54 UTC (rev 51360)
+++ firebird/trunk/src/auth/trusted/AuthSspi.cpp	2010-07-23 14:06:29 UTC (rev 51361)
@@ -31,7 +31,16 @@
 
 #include "../common/classes/ClumpletReader.h"
 #include "../common/classes/Interface.h"
+#include "../common/classes/ImplementHelper.h"
 
+namespace {
+#ifndef WIN_NT
+    char name[] = "WIN_SSPI";
+    Firebird::PluginHelper<Auth::WinSspiServer, Firebird::Plugin::AuthServer, name> server;
+    Firebird::PluginHelper<Auth::WinSspiClient, Firebird::Plugin::AuthClient, name> client;
+#endif
+}
+
 using namespace Firebird;
 
 namespace
@@ -336,26 +345,7 @@
 	return interfaceAlloc<WinSspiClientInstance>();
 }
 
-void WinSspiServer::getName(const char** data, unsigned short* dataSize)
-{
-	authName(data, dataSize);
-}
 
-void WinSspiClient::getName(const char** data, unsigned short* dataSize)
-{
-	authName(data, dataSize);
-}
-
-void WinSspiServer::release()
-{
-	interfaceFree(this);
-}
-
-void WinSspiClient::release()
-{
-	interfaceFree(this);
-}
-
 WinSspiServerInstance::WinSspiServerInstance()
 	: sspiData(*getDefaultMemoryPool())
 { }
Modified: firebird/trunk/src/auth/trusted/AuthSspi.h
===================================================================
--- firebird/trunk/src/auth/trusted/AuthSspi.h	2010-07-23 14:01:54 UTC (rev 51360)
+++ firebird/trunk/src/auth/trusted/AuthSspi.h	2010-07-23 14:06:29 UTC (rev 51361)
@@ -99,16 +99,12 @@
 {
 public:
 	ServerInstance* instance();
-    void getName(const char** data, unsigned short* dataSize);
-    void release();
 };
 
 class WinSspiClient : public ClientPlugin
 {
 public:
 	ClientInstance* instance();
-    void getName(const char** data, unsigned short* dataSize);
-    void release();
 };
 
 class WinSspiServerInstance : public ServerInstance
Modified: firebird/trunk/src/jrd/pwd.cpp
===================================================================
--- firebird/trunk/src/jrd/pwd.cpp	2010-07-23 14:01:54 UTC (rev 51360)
+++ firebird/trunk/src/jrd/pwd.cpp	2010-07-23 14:06:29 UTC (rev 51361)
@@ -48,9 +48,10 @@
 namespace {
 
 // register plugin
-
+#ifndef WIN_NT
 char name[] = "LEGACY_AUTH";
 PluginHelper<Auth::SecurityDatabaseServer, Firebird::Plugin::AuthServer, name> server;
+#endif
 
 // temporal implementation of timer
 
Modified: firebird/trunk/src/remote/os/win32/srvr_w32.cpp
===================================================================
--- firebird/trunk/src/remote/os/win32/srvr_w32.cpp	2010-07-23 14:01:54 UTC (rev 51360)
+++ firebird/trunk/src/remote/os/win32/srvr_w32.cpp	2010-07-23 14:06:29 UTC (rev 51361)
@@ -109,7 +109,36 @@
 #include "../../../common/classes/FpeControl.h"
 #include "../jrd/ibase.h"
 
+// hvlad: following code registering plugins is temporary and should be
+// moved at appropriate places
 
+#include "../common/classes/ImplementHelper.h"
+#include "../auth/trusted/AuthSspi.h"
+#include "../auth/SecurityDatabase/LegacyClient.h"
+#include "../auth/SecurityDatabase/LegacyManagement.h"
+#include "../jrd/jrd_pwd.h"
+
+namespace {
+
+	// from AuthSspi
+	char name1[] = "WIN_SSPI";
+	Firebird::PluginHelper<Auth::WinSspiServer, Firebird::Plugin::AuthServer, name1> server1;
+	Firebird::PluginHelper<Auth::WinSspiClient, Firebird::Plugin::AuthClient, name1> client1;
+
+	// from LegacyClient
+	char name2[] = "LEGACY_AUTH";
+	Firebird::PluginHelper<Auth::SecurityDatabaseClient, Firebird::Plugin::AuthClient, name2> client2;
+
+	// from LegacyManagement
+	char name3[] = "LEGACY_AUTH";
+	Firebird::PluginHelper<Auth::SecurityDatabaseManagement, Firebird::Plugin::UserManagement, name3> manage3;
+
+	// from pwd
+	char name4[] = "LEGACY_AUTH";
+	Firebird::PluginHelper<Auth::SecurityDatabaseServer, Firebird::Plugin::AuthServer, name4> server4;
+}
+
+
 static THREAD_ENTRY_DECLARE inet_connect_wait_thread(THREAD_ENTRY_PARAM);
 static THREAD_ENTRY_DECLARE wnet_connect_wait_thread(THREAD_ENTRY_PARAM);
 static THREAD_ENTRY_DECLARE xnet_connect_wait_thread(THREAD_ENTRY_PARAM);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <asf...@us...> - 2010-07-26 02:38:13
       | 
| Revision: 51368
          http://firebird.svn.sourceforge.net/firebird/?rev=51368&view=rev
Author:   asfernandes
Date:     2010-07-26 02:37:57 +0000 (Mon, 26 Jul 2010)
Log Message:
-----------
Refactor CREATE/ALTER/DROP/RECREATE TABLE and DROP VIEW commands
Modified Paths:
--------------
    firebird/trunk/lang_helpers/gds_codes.ftn
    firebird/trunk/lang_helpers/gds_codes.pas
    firebird/trunk/src/common/classes/ByteChunk.h
    firebird/trunk/src/common/classes/objects_array.h
    firebird/trunk/src/dsql/BlrWriter.h
    firebird/trunk/src/dsql/DdlNodes.epp
    firebird/trunk/src/dsql/DdlNodes.h
    firebird/trunk/src/dsql/Nodes.h
    firebird/trunk/src/dsql/PackageNodes.epp
    firebird/trunk/src/dsql/PackageNodes.h
    firebird/trunk/src/dsql/ddl.cpp
    firebird/trunk/src/dsql/ddl_proto.h
    firebird/trunk/src/dsql/dsql.h
    firebird/trunk/src/dsql/node.h
    firebird/trunk/src/dsql/parse.y
    firebird/trunk/src/dsql/pass1.cpp
    firebird/trunk/src/gpre/gpre.h
    firebird/trunk/src/include/gen/codetext.h
    firebird/trunk/src/include/gen/iberror.h
    firebird/trunk/src/include/gen/msgs.h
    firebird/trunk/src/include/gen/sql_code.h
    firebird/trunk/src/include/gen/sql_state.h
    firebird/trunk/src/jrd/constants.h
    firebird/trunk/src/jrd/drq.h
    firebird/trunk/src/jrd/dyn.epp
    firebird/trunk/src/jrd/dyn_def.epp
    firebird/trunk/src/jrd/dyn_del.epp
    firebird/trunk/src/jrd/dyn_df_proto.h
    firebird/trunk/src/jrd/dyn_dl_proto.h
    firebird/trunk/src/jrd/dyn_md_proto.h
    firebird/trunk/src/jrd/dyn_mod.epp
    firebird/trunk/src/jrd/dyn_ut_proto.h
    firebird/trunk/src/jrd/dyn_util.epp
    firebird/trunk/src/msgs/facilities2.sql
    firebird/trunk/src/msgs/messages2.sql
    firebird/trunk/src/msgs/system_errors2.sql
Modified: firebird/trunk/lang_helpers/gds_codes.ftn
===================================================================
--- firebird/trunk/lang_helpers/gds_codes.ftn	2010-07-26 02:14:48 UTC (rev 51367)
+++ firebird/trunk/lang_helpers/gds_codes.ftn	2010-07-26 02:37:57 UTC (rev 51368)
@@ -1996,6 +1996,86 @@
       PARAMETER (GDS__dsql_invalid_type_neg            = 336397256)
       INTEGER*4 GDS__dsql_max_distinct_items         
       PARAMETER (GDS__dsql_max_distinct_items          = 336397257)
+      INTEGER*4 GDS__dsql_alter_charset_failed       
+      PARAMETER (GDS__dsql_alter_charset_failed        = 336397258)
+      INTEGER*4 GDS__dsql_comment_on_failed          
+      PARAMETER (GDS__dsql_comment_on_failed           = 336397259)
+      INTEGER*4 GDS__dsql_create_func_failed         
+      PARAMETER (GDS__dsql_create_func_failed          = 336397260)
+      INTEGER*4 GDS__dsql_alter_func_failed          
+      PARAMETER (GDS__dsql_alter_func_failed           = 336397261)
+      INTEGER*4 GDS__dsql_create_alter_func_failed   
+      PARAMETER (GDS__dsql_create_alter_func_failed    = 336397262)
+      INTEGER*4 GDS__dsql_drop_func_failed           
+      PARAMETER (GDS__dsql_drop_func_failed            = 336397263)
+      INTEGER*4 GDS__dsql_recreate_func_failed       
+      PARAMETER (GDS__dsql_recreate_func_failed        = 336397264)
+      INTEGER*4 GDS__dsql_create_proc_failed         
+      PARAMETER (GDS__dsql_create_proc_failed          = 336397265)
+      INTEGER*4 GDS__dsql_alter_proc_failed          
+      PARAMETER (GDS__dsql_alter_proc_failed           = 336397266)
+      INTEGER*4 GDS__dsql_create_alter_proc_failed   
+      PARAMETER (GDS__dsql_create_alter_proc_failed    = 336397267)
+      INTEGER*4 GDS__dsql_drop_proc_failed           
+      PARAMETER (GDS__dsql_drop_proc_failed            = 336397268)
+      INTEGER*4 GDS__dsql_recreate_proc_failed       
+      PARAMETER (GDS__dsql_recreate_proc_failed        = 336397269)
+      INTEGER*4 GDS__dsql_create_trigger_failed      
+      PARAMETER (GDS__dsql_create_trigger_failed       = 336397270)
+      INTEGER*4 GDS__dsql_alter_trigger_failed       
+      PARAMETER (GDS__dsql_alter_trigger_failed        = 336397271)
+      INTEGER*4 GDS__dsql_create_alter_trigger_failed
+      PARAMETER (GDS__dsql_create_alter_trigger_failed = 336397272)
+      INTEGER*4 GDS__dsql_drop_trigger_failed        
+      PARAMETER (GDS__dsql_drop_trigger_failed         = 336397273)
+      INTEGER*4 GDS__dsql_recreate_trigger_failed    
+      PARAMETER (GDS__dsql_recreate_trigger_failed     = 336397274)
+      INTEGER*4 GDS__dsql_create_collation_failed    
+      PARAMETER (GDS__dsql_create_collation_failed     = 336397275)
+      INTEGER*4 GDS__dsql_drop_collation_failed      
+      PARAMETER (GDS__dsql_drop_collation_failed       = 336397276)
+      INTEGER*4 GDS__dsql_create_domain_failed       
+      PARAMETER (GDS__dsql_create_domain_failed        = 336397277)
+      INTEGER*4 GDS__dsql_alter_domain_failed        
+      PARAMETER (GDS__dsql_alter_domain_failed         = 336397278)
+      INTEGER*4 GDS__dsql_drop_domain_failed         
+      PARAMETER (GDS__dsql_drop_domain_failed          = 336397279)
+      INTEGER*4 GDS__dsql_create_except_failed       
+      PARAMETER (GDS__dsql_create_except_failed        = 336397280)
+      INTEGER*4 GDS__dsql_alter_except_failed        
+      PARAMETER (GDS__dsql_alter_except_failed         = 336397281)
+      INTEGER*4 GDS__dsql_create_alter_except_failed 
+      PARAMETER (GDS__dsql_create_alter_except_failed  = 336397282)
+      INTEGER*4 GDS__dsql_recreate_except_failed     
+      PARAMETER (GDS__dsql_recreate_except_failed      = 336397283)
+      INTEGER*4 GDS__dsql_drop_except_failed         
+      PARAMETER (GDS__dsql_drop_except_failed          = 336397284)
+      INTEGER*4 GDS__dsql_create_sequence_failed     
+      PARAMETER (GDS__dsql_create_sequence_failed      = 336397285)
+      INTEGER*4 GDS__dsql_create_table_failed        
+      PARAMETER (GDS__dsql_create_table_failed         = 336397286)
+      INTEGER*4 GDS__dsql_alter_table_failed         
+      PARAMETER (GDS__dsql_alter_table_failed          = 336397287)
+      INTEGER*4 GDS__dsql_drop_table_failed          
+      PARAMETER (GDS__dsql_drop_table_failed           = 336397288)
+      INTEGER*4 GDS__dsql_recreate_table_failed      
+      PARAMETER (GDS__dsql_recreate_table_failed       = 336397289)
+      INTEGER*4 GDS__dsql_create_pack_failed         
+      PARAMETER (GDS__dsql_create_pack_failed          = 336397290)
+      INTEGER*4 GDS__dsql_alter_pack_failed          
+      PARAMETER (GDS__dsql_alter_pack_failed           = 336397291)
+      INTEGER*4 GDS__dsql_create_alter_pack_failed   
+      PARAMETER (GDS__dsql_create_alter_pack_failed    = 336397292)
+      INTEGER*4 GDS__dsql_drop_pack_failed           
+      PARAMETER (GDS__dsql_drop_pack_failed            = 336397293)
+      INTEGER*4 GDS__dsql_recreate_pack_failed       
+      PARAMETER (GDS__dsql_recreate_pack_failed        = 336397294)
+      INTEGER*4 GDS__dsql_create_pack_body_failed    
+      PARAMETER (GDS__dsql_create_pack_body_failed     = 336397295)
+      INTEGER*4 GDS__dsql_drop_pack_body_failed      
+      PARAMETER (GDS__dsql_drop_pack_body_failed       = 336397296)
+      INTEGER*4 GDS__dsql_recreate_pack_body_failed  
+      PARAMETER (GDS__dsql_recreate_pack_body_failed   = 336397297)
       INTEGER*4 GDS__gsec_cant_open_db               
       PARAMETER (GDS__gsec_cant_open_db                = 336723983)
       INTEGER*4 GDS__gsec_switches_error             
Modified: firebird/trunk/lang_helpers/gds_codes.pas
===================================================================
--- firebird/trunk/lang_helpers/gds_codes.pas	2010-07-26 02:14:48 UTC (rev 51367)
+++ firebird/trunk/lang_helpers/gds_codes.pas	2010-07-26 02:37:57 UTC (rev 51368)
@@ -1005,6 +1005,46 @@
 	gds_dsql_nostring_neg_dial3          = 336397255;
 	gds_dsql_invalid_type_neg            = 336397256;
 	gds_dsql_max_distinct_items          = 336397257;
+	gds_dsql_alter_charset_failed        = 336397258;
+	gds_dsql_comment_on_failed           = 336397259;
+	gds_dsql_create_func_failed          = 336397260;
+	gds_dsql_alter_func_failed           = 336397261;
+	gds_dsql_create_alter_func_failed    = 336397262;
+	gds_dsql_drop_func_failed            = 336397263;
+	gds_dsql_recreate_func_failed        = 336397264;
+	gds_dsql_create_proc_failed          = 336397265;
+	gds_dsql_alter_proc_failed           = 336397266;
+	gds_dsql_create_alter_proc_failed    = 336397267;
+	gds_dsql_drop_proc_failed            = 336397268;
+	gds_dsql_recreate_proc_failed        = 336397269;
+	gds_dsql_create_trigger_failed       = 336397270;
+	gds_dsql_alter_trigger_failed        = 336397271;
+	gds_dsql_create_alter_trigger_failed = 336397272;
+	gds_dsql_drop_trigger_failed         = 336397273;
+	gds_dsql_recreate_trigger_failed     = 336397274;
+	gds_dsql_create_collation_failed     = 336397275;
+	gds_dsql_drop_collation_failed       = 336397276;
+	gds_dsql_create_domain_failed        = 336397277;
+	gds_dsql_alter_domain_failed         = 336397278;
+	gds_dsql_drop_domain_failed          = 336397279;
+	gds_dsql_create_except_failed        = 336397280;
+	gds_dsql_alter_except_failed         = 336397281;
+	gds_dsql_create_alter_except_failed  = 336397282;
+	gds_dsql_recreate_except_failed      = 336397283;
+	gds_dsql_drop_except_failed          = 336397284;
+	gds_dsql_create_sequence_failed      = 336397285;
+	gds_dsql_create_table_failed         = 336397286;
+	gds_dsql_alter_table_failed          = 336397287;
+	gds_dsql_drop_table_failed           = 336397288;
+	gds_dsql_recreate_table_failed       = 336397289;
+	gds_dsql_create_pack_failed          = 336397290;
+	gds_dsql_alter_pack_failed           = 336397291;
+	gds_dsql_create_alter_pack_failed    = 336397292;
+	gds_dsql_drop_pack_failed            = 336397293;
+	gds_dsql_recreate_pack_failed        = 336397294;
+	gds_dsql_create_pack_body_failed     = 336397295;
+	gds_dsql_drop_pack_body_failed       = 336397296;
+	gds_dsql_recreate_pack_body_failed   = 336397297;
 	gds_gsec_cant_open_db                = 336723983;
 	gds_gsec_switches_error              = 336723984;
 	gds_gsec_no_op_spec                  = 336723985;
Modified: firebird/trunk/src/common/classes/ByteChunk.h
===================================================================
--- firebird/trunk/src/common/classes/ByteChunk.h	2010-07-26 02:14:48 UTC (rev 51367)
+++ firebird/trunk/src/common/classes/ByteChunk.h	2010-07-26 02:37:57 UTC (rev 51368)
@@ -24,6 +24,7 @@
 #define COMMON_BYTE_CHUNK_H
 
 #include "../common/classes/array.h"
+#include "../common/classes/fb_string.h"
 
 namespace Firebird {
 
@@ -46,8 +47,22 @@
 	{
 	}
 
-	const UCHAR* const data;
-	const size_t length;
+	// String buffer.
+	ByteChunk(string& str)
+		: data((UCHAR*) str.c_str()),
+		  length(str.length())
+	{
+	}
+
+	// Empty.
+	ByteChunk()
+		: data(NULL),
+		  length(0)
+	{
+	}
+
+	const UCHAR* data;
+	size_t length;
 };
 
 }	// namespace Firebird
Modified: firebird/trunk/src/common/classes/objects_array.h
===================================================================
--- firebird/trunk/src/common/classes/objects_array.h	2010-07-26 02:14:48 UTC (rev 51367)
+++ firebird/trunk/src/common/classes/objects_array.h	2010-07-26 02:37:57 UTC (rev 51368)
@@ -279,6 +279,11 @@
 		size_t getCount() const {return inherited::getCount();}
 		size_t getCapacity() const {return inherited::getCapacity();}
 
+		bool hasData() const
+		{
+			return getCount() != 0;
+		}
+
 		bool isEmpty() const
 		{
 			return getCount() == 0;
Modified: firebird/trunk/src/dsql/BlrWriter.h
===================================================================
--- firebird/trunk/src/dsql/BlrWriter.h	2010-07-26 02:14:48 UTC (rev 51367)
+++ firebird/trunk/src/dsql/BlrWriter.h	2010-07-26 02:37:57 UTC (rev 51368)
@@ -36,6 +36,9 @@
 class BlrWriter : public Firebird::PermanentStorage
 {
 public:
+	typedef Firebird::HalfStaticArray<UCHAR, 1024> BlrData;
+	typedef Firebird::HalfStaticArray<UCHAR, 128> DebugData;
+
 	explicit BlrWriter(MemoryPool& p)
 		: PermanentStorage(p),
 		  blrData(p),
@@ -44,6 +47,10 @@
 	{
 	}
 
+	virtual ~BlrWriter()
+	{
+	}
+
 	void appendUChar(const UCHAR byte)
 	{
 		blrData.add(byte);
@@ -126,8 +133,8 @@
 	void putDebugArgument(UCHAR, USHORT, const TEXT*);
 	void appendDebugInfo();
 
-	Firebird::HalfStaticArray<UCHAR, 1024>& getBlrData() { return blrData; }
-	Firebird::HalfStaticArray<UCHAR, 128>& getDebugData() { return debugData; }
+	BlrData& getBlrData() { return blrData; }
+	DebugData& getDebugData() { return debugData; }
 
 	ULONG getBaseOffset() const { return baseOffset; }
 	void setBaseOffset(ULONG value) { baseOffset = value; }
@@ -138,8 +145,8 @@
 	virtual bool isDdlDyn() = 0;
 
 private:
-	Firebird::HalfStaticArray<UCHAR, 1024> blrData;
-	Firebird::HalfStaticArray<UCHAR, 128> debugData;
+	BlrData blrData;
+	DebugData debugData;
 	ULONG baseOffset;					// place to go back and stuff in blr length
 };
 
Modified: firebird/trunk/src/dsql/DdlNodes.epp
===================================================================
--- firebird/trunk/src/dsql/DdlNodes.epp	2010-07-26 02:14:48 UTC (rev 51367)
+++ firebird/trunk/src/dsql/DdlNodes.epp	2010-07-26 02:37:57 UTC (rev 51368)
@@ -19,10 +19,12 @@
  */
 
 #include "firebird.h"
+#include "dyn_consts.h"
 #include "../jrd/common.h"
 #include "../dsql/DdlNodes.h"
 #include "../dsql/node.h"
 #include "../jrd/blr.h"
+#include "../jrd/btr.h"
 #include "../jrd/dyn.h"
 #include "../jrd/flags.h"
 #include "../jrd/intl.h"
@@ -30,6 +32,7 @@
 #include "../jrd/msg_encode.h"
 #include "../jrd/obj.h"
 #include "../jrd/tra.h"
+#include "../jrd/os/path_utils.h"
 #include "../jrd/IntlManager.h"
 #include "../jrd/PreparedStatement.h"
 #include "../jrd/blb_proto.h"
@@ -39,7 +42,9 @@
 #include "../jrd/dyn_ut_proto.h"
 #include "../jrd/exe_proto.h"
 #include "../jrd/intl_proto.h"
+#include "../jrd/isc_f_proto.h"
 #include "../jrd/met_proto.h"
+#include "../jrd/scl_proto.h"
 #include "../jrd/vio_proto.h"
 #include "../dsql/ddl_proto.h"
 #include "../dsql/errd_proto.h"
@@ -49,14 +54,39 @@
 #include "../dsql/pass1_proto.h"
 #include "../common/StatusArg.h"
 
-using namespace Firebird;
-
 namespace Jrd {
 
 using namespace Firebird;
 using namespace Dsql;
 
-static void rethrowMetaException(const status_exception& ex, ISC_STATUS code, bool metaDataException);
+static void checkForeignKeyTempScope(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName&	childRelName, const MetaName& masterIndexName);
+static void checkSpTrigDependency(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName& relationName, const MetaName& fieldName);
+static void checkViewDependency(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName& relationName, const MetaName& fieldName);
+static void clearPermanentField(dsql_rel* relation, bool permanent);
+static void deleteKeyConstraint(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName& relationName, const MetaName& constraintName, const MetaName& indexName);
+static bool fieldExists(thread_db* tdbb, jrd_tra* transaction, const MetaName& relationName,
+	const MetaName& fieldName);
+static void makeRelationScopeName(const MetaName& name, const rel_t type, string& message);
+static void modifyLocalFieldPosition(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName& relationName, const MetaName& fieldName, USHORT newPosition,
+	USHORT existingPosition);
+static rel_t relationType(SSHORT relationTypeNull, SSHORT relationType);
+static void saveRelation(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch,
+	const dsql_str* relationName, bool creating);
+static void updateRdbFields(const TypeClause& type,
+	SSHORT& fieldType,
+	SSHORT& fieldLength,
+	SSHORT& fieldSubTypeNull, SSHORT& fieldSubType,
+	SSHORT& fieldScaleNull, SSHORT& fieldScale,
+	SSHORT& characterSetIdNull, SSHORT& characterSetId,
+	SSHORT& characterLengthNull, SSHORT& characterLength,
+	SSHORT& fieldPrecisionNull, SSHORT& fieldPrecision,
+	SSHORT& collationIdNull, SSHORT& collationId,
+	SSHORT& segmentLengthNull, SSHORT& segmentLength);
 
 DATABASE DB = STATIC "ODS.RDB";
 
@@ -64,25 +94,376 @@
 //----------------------
 
 
-// Rethrow an exception with isc_no_meta_update and code prefix when necessary.
-static void rethrowMetaException(const status_exception& ex, ISC_STATUS code, bool metaDataException)
+// Check temporary table reference rules between given child relation and master
+// relation (owner of given PK/UK index).
+static void checkForeignKeyTempScope(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName&	childRelName, const MetaName& masterIndexName)
 {
-	Arg::StatusVector newVector;
-	const ISC_STATUS* status = ex.value();
+	AutoCacheRequest request(tdbb, drq_l_rel_info, DYN_REQUESTS);
+	bool error = false;
+	string master, child;
 
-	if (metaDataException)
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		RLC_M IN RDB$RELATION_CONSTRAINTS CROSS
+		REL_C IN RDB$RELATIONS CROSS
+		REL_M IN RDB$RELATIONS
+		WITH (RLC_M.RDB$CONSTRAINT_TYPE EQ UNIQUE_CNSTRT OR
+			  RLC_M.RDB$CONSTRAINT_TYPE EQ PRIMARY_KEY) AND
+			 RLC_M.RDB$INDEX_NAME EQ masterIndexName.c_str() AND
+			 REL_C.RDB$RELATION_NAME EQ childRelName.c_str() AND
+			 REL_M.RDB$RELATION_NAME EQ RLC_M.RDB$RELATION_NAME
 	{
-		if (status[1] != isc_no_meta_update)
-			newVector << Arg::Gds(isc_no_meta_update);
+		const rel_t masterType = relationType(REL_M.RDB$RELATION_TYPE.NULL, REL_M.RDB$RELATION_TYPE);
+		fb_assert(masterType == rel_persistent ||
+				  masterType == rel_global_temp_preserve ||
+				  masterType == rel_global_temp_delete);
 
-		if (code != 0)
-			newVector << Arg::Gds(code);
+		const rel_t childType = relationType(REL_C.RDB$RELATION_TYPE.NULL, REL_C.RDB$RELATION_TYPE);
+		fb_assert(childType == rel_persistent ||
+				  childType == rel_global_temp_preserve ||
+				  childType == rel_global_temp_delete);
+
+		error = masterType != childType &&
+			!(masterType == rel_global_temp_preserve && childType == rel_global_temp_delete);
+
+		if (error)
+		{
+			makeRelationScopeName(masterIndexName, masterType, master);
+			makeRelationScopeName(childRelName, childType, child);
+		}
 	}
+	END_FOR
 
-	newVector.append(Arg::StatusVector(status));
-	status_exception::raise(newVector);
+	if (error)
+	{
+		// Msg 232 : "%s can't reference %s"
+		status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(232, DYN_MSG_FAC)) << child << master);
+	}
 }
 
+// Check temporary table reference rules between just created child relation and all
+// its master relations.
+static void checkRelationTempScope(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName&	childRelName, const rel_t childType)
+{
+	if (childType != rel_persistent &&
+		childType != rel_global_temp_preserve &&
+		childType != rel_global_temp_delete)
+	{
+		return;
+	}
+
+	AutoCacheRequest request(tdbb, drq_l_rel_info2, DYN_REQUESTS);
+	bool error = false;
+	string master, child;
+
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		RLC_C IN RDB$RELATION_CONSTRAINTS CROSS
+		IND_C IN RDB$INDICES CROSS
+		IND_M IN RDB$INDICES CROSS
+		REL_M IN RDB$RELATIONS
+		WITH RLC_C.RDB$CONSTRAINT_TYPE EQ FOREIGN_KEY AND
+			 RLC_C.RDB$RELATION_NAME EQ childRelName.c_str() AND
+			 IND_C.RDB$INDEX_NAME EQ RLC_C.RDB$INDEX_NAME AND
+			 IND_M.RDB$INDEX_NAME EQ IND_C.RDB$FOREIGN_KEY AND
+			 IND_M.RDB$RELATION_NAME EQ REL_M.RDB$RELATION_NAME
+	{
+		const rel_t masterType = relationType(REL_M.RDB$RELATION_TYPE.NULL, REL_M.RDB$RELATION_TYPE);
+		fb_assert(masterType == rel_persistent ||
+				  masterType == rel_global_temp_preserve ||
+				  masterType == rel_global_temp_delete);
+
+		error = masterType != childType &&
+			!(masterType == rel_global_temp_preserve && childType == rel_global_temp_delete);
+
+		if (error)
+		{
+			makeRelationScopeName(REL_M.RDB$RELATION_NAME, masterType, master);
+			makeRelationScopeName(childRelName, childType, child);
+		}
+	}
+	END_FOR
+
+	if (error)
+	{
+		// Msg 232 : "%s can't reference %s"
+		status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(232, DYN_MSG_FAC)) << child << master);
+	}
+}
+
+// Checks to see if the given field is referenced in a stored procedure or trigger.
+// If the field is referenced, throw.
+static void checkSpTrigDependency(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName& relationName, const MetaName& fieldName)
+{
+	AutoRequest request;
+
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		FIRST 1
+		DEP IN RDB$DEPENDENCIES
+		WITH DEP.RDB$DEPENDED_ON_NAME EQ relationName.c_str() AND
+			 DEP.RDB$FIELD_NAME EQ fieldName.c_str()
+	{
+		MetaName depName(DEP.RDB$DEPENDENT_NAME);
+
+		// msg 206: Column %s from table %s is referenced in %s.
+		status_exception::raise(
+			Arg::Gds(ENCODE_ISC_MSG(206, DYN_MSG_FAC)) << fieldName << relationName << depName);
+	}
+	END_FOR
+}
+
+// Checks to see if the given field is referenced in a view. If it is, throw.
+static void checkViewDependency(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName& relationName, const MetaName& fieldName)
+{
+	AutoRequest request;
+
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		FIRST 1
+		X IN RDB$RELATION_FIELDS CROSS
+		Y IN RDB$RELATION_FIELDS CROSS
+		Z IN RDB$VIEW_RELATIONS
+		WITH X.RDB$RELATION_NAME EQ relationName.c_str() AND
+			 X.RDB$FIELD_NAME EQ fieldName.c_str() AND
+			 X.RDB$FIELD_NAME EQ Y.RDB$BASE_FIELD AND
+			 X.RDB$FIELD_SOURCE EQ Y.RDB$FIELD_SOURCE AND
+			 Y.RDB$RELATION_NAME EQ Z.RDB$VIEW_NAME AND
+			 X.RDB$RELATION_NAME EQ Z.RDB$RELATION_NAME AND
+			 Y.RDB$VIEW_CONTEXT EQ Z.RDB$VIEW_CONTEXT
+	{
+		MetaName viewName(Z.RDB$VIEW_NAME);
+
+		// msg 206: Column %s from table %s is referenced in  %s.
+		status_exception::raise(
+			Arg::Gds(ENCODE_ISC_MSG(206, DYN_MSG_FAC)) << fieldName << relationName << viewName);
+	}
+	END_FOR
+}
+
+// Removes temporary pool pointers from field, stored in permanent cache.
+static void clearPermanentField(dsql_rel* relation, bool permanent)
+{
+	if (relation && relation->rel_fields && permanent)
+	{
+		relation->rel_fields->fld_procedure = NULL;
+		relation->rel_fields->fld_ranges = NULL;
+		relation->rel_fields->fld_character_set = NULL;
+		relation->rel_fields->fld_sub_type_name = NULL;
+		relation->rel_fields->fld_relation = relation;
+	}
+}
+
+// Delete a record from RDB$RELATION_CONSTRAINTS based on a constraint name.
+//
+//      On deleting from RDB$RELATION_CONSTRAINTS, 2 system triggers fire:
+//
+//      (A) pre delete trigger: pre_delete_constraint, will:
+//
+//        1. delete a record first from RDB$REF_CONSTRAINTS where
+//           RDB$REF_CONSTRAINTS.RDB$CONSTRAINT_NAME =
+//                               RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME
+//
+//      (B) post delete trigger: post_delete_constraint will:
+//
+//        1. also delete a record from RDB$INDICES where
+//           RDB$INDICES.RDB$INDEX_NAME =
+//                               RDB$RELATION_CONSTRAINTS.RDB$INDEX_NAME
+//
+//        2. also delete a record from RDB$INDEX_SEGMENTS where
+//           RDB$INDEX_SEGMENTS.RDB$INDEX_NAME =
+//                               RDB$RELATION_CONSTRAINTS.RDB$INDEX_NAME
+static void deleteKeyConstraint(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName& relationName, const MetaName& constraintName, const MetaName& indexName)
+{
+	SET_TDBB(tdbb);
+
+	AutoCacheRequest request(tdbb, drq_e_rel_const, DYN_REQUESTS);
+	bool found = false;
+
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		RC IN RDB$RELATION_CONSTRAINTS
+		WITH RC.RDB$CONSTRAINT_NAME EQ constraintName.c_str() AND
+			 RC.RDB$CONSTRAINT_TYPE EQ FOREIGN_KEY AND
+			 RC.RDB$RELATION_NAME EQ relationName.c_str() AND
+			 RC.RDB$INDEX_NAME EQ indexName.c_str()
+	{
+		found = true;
+		ERASE RC;
+	}
+	END_FOR
+
+	if (!found)
+	{
+		// msg 130: "CONSTRAINT %s does not exist."
+		status_exception::raise(
+			Arg::Gds(ENCODE_ISC_MSG(130, DYN_MSG_FAC)) << constraintName);
+	}
+}
+
+// Checks to see if the given field already exists in a relation.
+static bool fieldExists(thread_db* tdbb, jrd_tra* transaction, const MetaName& relationName,
+	const MetaName& fieldName)
+{
+	AutoRequest request;
+	bool found = false;
+
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		FLD IN RDB$RELATION_FIELDS
+		WITH FLD.RDB$RELATION_NAME EQ relationName.c_str() AND
+			 FLD.RDB$FIELD_NAME EQ fieldName.c_str()
+	{
+		found = true;
+	}
+	END_FOR
+
+	return found;
+}
+
+// Make string with relation name and type of its temporary scope.
+static void makeRelationScopeName(const MetaName& name, const rel_t type, string& message)
+{
+	const char* scope = NULL;
+
+	if (type == rel_global_temp_preserve)
+		scope = REL_SCOPE_GTT_PRESERVE;
+	else if (type == rel_global_temp_delete)
+		scope = REL_SCOPE_GTT_DELETE;
+	else
+		scope = REL_SCOPE_PERSISTENT;
+
+	message.printf(scope, name.c_str());
+}
+
+// Alters the position of a field with respect to the
+// other fields in the relation.  This will only affect
+// the order in which the fields will be returned when either
+// viewing the relation or performing select * from the relation.
+//
+// The rules of engagement are as follows:
+//      if new_position > original position
+//         increase RDB$FIELD_POSITION for all fields with RDB$FIELD_POSITION
+//         between the new_position and existing position of the field
+//      then update the position of the field being altered.
+//         just update the position
+//
+//      if new_position < original position
+//         decrease RDB$FIELD_POSITION for all fields with RDB$FIELD_POSITION
+//         between the new_position and existing position of the field
+//      then update the position of the field being altered.
+//
+//      if new_position == original_position -- no_op
+static void modifyLocalFieldPosition(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName& relationName, const MetaName& fieldName, USHORT newPosition,
+	USHORT existingPosition)
+{
+	// Make sure that there are no duplicate field positions and no gaps in the position sequence.
+	// (gaps are introduced when fields are removed)
+
+	AutoRequest request;
+	USHORT newPos = 0;
+
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		FLD IN RDB$RELATION_FIELDS
+		WITH FLD.RDB$RELATION_NAME EQ relationName.c_str()
+		SORTED BY ASCENDING FLD.RDB$FIELD_POSITION
+	{
+		if (FLD.RDB$FIELD_POSITION != newPos)
+		{
+			MODIFY FLD USING
+				FLD.RDB$FIELD_POSITION = newPos;
+			END_MODIFY
+		}
+
+		++newPos;
+	}
+	END_FOR
+
+	// Find the position of the last field in the relation.
+	SLONG maxPosition = -1;
+	DYN_UTIL_generate_field_position(tdbb, NULL, relationName, &maxPosition);
+
+	// If the existing position of the field is less than the new position of
+	// the field, subtract 1 to move the fields to their new positions otherwise,
+	// increase the value in RDB$FIELD_POSITION by one.
+
+	bool moveDown = false;
+	if (existingPosition < newPosition)
+		moveDown = true;
+
+	// Retrieve the records for the fields which have a position between the
+	// existing field position and the new field position.
+
+	request.reset();
+
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		FLD IN RDB$RELATION_FIELDS
+		WITH FLD.RDB$RELATION_NAME EQ relationName.c_str() AND
+				FLD.RDB$FIELD_POSITION >= MIN(newPosition, existingPosition) AND
+				FLD.RDB$FIELD_POSITION <= MAX(newPosition, existingPosition)
+	{
+		MODIFY FLD USING
+			// If the field is the one we want, change the position, otherwise
+			// increase the value of RDB$FIELD_POSITION.
+			if (fieldName == FLD.RDB$FIELD_NAME)
+			{
+				if (newPosition > maxPosition)
+				{
+					// This prevents gaps in the position sequence of the fields.
+					FLD.RDB$FIELD_POSITION = maxPosition;
+				}
+				else
+					FLD.RDB$FIELD_POSITION = newPosition;
+			}
+			else
+			{
+				if (moveDown)
+					FLD.RDB$FIELD_POSITION = FLD.RDB$FIELD_POSITION - 1;
+				else
+					FLD.RDB$FIELD_POSITION = FLD.RDB$FIELD_POSITION + 1;
+			}
+
+			FLD.RDB$FIELD_POSITION.NULL = FALSE;
+		END_MODIFY
+	}
+	END_FOR
+}
+
+// Convert RDB$RELATION_TYPE to rel_t type.
+static rel_t relationType(SSHORT relationTypeNull, SSHORT relationType)
+{
+	return relationTypeNull ? rel_persistent : rel_t(relationType);
+}
+
+// Save the name of the relation or view currently being defined. This is done to support definition
+// of triggers which will depend on the metadata created in this statement.
+static void saveRelation(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch,
+	const dsql_str* relationName, bool creating)
+{
+	//// TODO: Verify "creating" usage when using this function for views.
+
+	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
+
+	if (dsqlScratch->flags & DsqlCompilerScratch::FLAG_METADATA_SAVED)
+		return;
+
+	dsqlScratch->flags |= DsqlCompilerScratch::FLAG_METADATA_SAVED;
+
+	dsql_rel* relation;
+
+	if (!creating)
+		relation = METD_get_relation(dsqlScratch->getTransaction(), dsqlScratch, relationName);
+	else
+	{
+		MemoryPool& pool = *tdbb->getDefaultPool();
+		relation = FB_NEW(pool) dsql_rel(pool);
+		relation->rel_name = relationName->str_data;
+		relation->rel_flags = REL_creating;
+	}
+
+	dsqlScratch->relation = relation;
+}
+
 // Update RDB$FIELDS received by reference.
 static void updateRdbFields(const TypeClause& type,
 	SSHORT& fieldType,
@@ -169,6 +550,25 @@
 //----------------------
 
 
+// Delete a security class.
+bool DdlNode::deleteSecurityClass(thread_db* tdbb, jrd_tra* transaction,
+	const MetaName& secClass)
+{
+	AutoCacheRequest request(tdbb, drq_e_class, DYN_REQUESTS);
+	bool found = false;
+
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		SC IN RDB$SECURITY_CLASSES
+		WITH SC.RDB$SECURITY_CLASS EQ secClass.c_str()
+	{
+		found = true;
+		ERASE SC;
+	}
+	END_FOR
+
+	return found;
+}
+
 void DdlNode::executeDdlTrigger(thread_db* tdbb, jrd_tra* transaction, DdlTriggerWhen when,
 	int action, const MetaName& objectName, const string& sqlText)
 {
@@ -192,14 +592,12 @@
 	savePoint.release();	// everything is ok
 }
 
-
 void DdlNode::executeDdlTrigger(thread_db* tdbb, jrd_tra* transaction,
 	DdlNode::DdlTriggerWhen when, int action, const MetaName& objectName)
 {
 	executeDdlTrigger(tdbb, transaction, when, action, objectName, sqlText);
 }
 
-
 void DdlNode::putType(const TypeClause& type, bool useSubType)
 {
 #ifdef DEV_BUILD
@@ -300,51 +698,105 @@
 	}
 }
 
-
 void DdlNode::resetContextStack()
 {
 	dsqlScratch->context->clea...
 
[truncated message content] | 
| 
      
      
      From: <asf...@us...> - 2010-08-02 02:22:33
       | 
| Revision: 51383
          http://firebird.svn.sourceforge.net/firebird/?rev=51383&view=rev
Author:   asfernandes
Date:     2010-08-02 02:22:26 +0000 (Mon, 02 Aug 2010)
Log Message:
-----------
Refactor CREATE/ALTER/CREATE OR ALTER/RECREATE VIEW and cleanup related to previously refactors
Modified Paths:
--------------
    firebird/trunk/lang_helpers/gds_codes.ftn
    firebird/trunk/lang_helpers/gds_codes.pas
    firebird/trunk/src/dsql/DdlNodes.epp
    firebird/trunk/src/dsql/DdlNodes.h
    firebird/trunk/src/dsql/ddl.cpp
    firebird/trunk/src/dsql/dsql.h
    firebird/trunk/src/dsql/metd.epp
    firebird/trunk/src/dsql/metd_proto.h
    firebird/trunk/src/dsql/node.h
    firebird/trunk/src/dsql/parse.y
    firebird/trunk/src/dsql/pass1.cpp
    firebird/trunk/src/include/gen/codetext.h
    firebird/trunk/src/include/gen/iberror.h
    firebird/trunk/src/include/gen/msgs.h
    firebird/trunk/src/include/gen/sql_code.h
    firebird/trunk/src/include/gen/sql_state.h
    firebird/trunk/src/jrd/drq.h
    firebird/trunk/src/jrd/dyn.epp
    firebird/trunk/src/jrd/dyn_def.epp
    firebird/trunk/src/jrd/dyn_del.epp
    firebird/trunk/src/jrd/dyn_df_proto.h
    firebird/trunk/src/jrd/dyn_dl_proto.h
    firebird/trunk/src/jrd/dyn_md_proto.h
    firebird/trunk/src/jrd/dyn_mod.epp
    firebird/trunk/src/jrd/dyn_ut_proto.h
    firebird/trunk/src/jrd/dyn_util.epp
    firebird/trunk/src/msgs/facilities2.sql
    firebird/trunk/src/msgs/messages2.sql
    firebird/trunk/src/msgs/system_errors2.sql
Modified: firebird/trunk/lang_helpers/gds_codes.ftn
===================================================================
--- firebird/trunk/lang_helpers/gds_codes.ftn	2010-08-01 20:43:29 UTC (rev 51382)
+++ firebird/trunk/lang_helpers/gds_codes.ftn	2010-08-02 02:22:26 UTC (rev 51383)
@@ -2076,6 +2076,16 @@
       PARAMETER (GDS__dsql_drop_pack_body_failed       = 336397296)
       INTEGER*4 GDS__dsql_recreate_pack_body_failed  
       PARAMETER (GDS__dsql_recreate_pack_body_failed   = 336397297)
+      INTEGER*4 GDS__dsql_create_view_failed         
+      PARAMETER (GDS__dsql_create_view_failed          = 336397298)
+      INTEGER*4 GDS__dsql_alter_view_failed          
+      PARAMETER (GDS__dsql_alter_view_failed           = 336397299)
+      INTEGER*4 GDS__dsql_create_alter_view_failed   
+      PARAMETER (GDS__dsql_create_alter_view_failed    = 336397300)
+      INTEGER*4 GDS__dsql_recreate_view_failed       
+      PARAMETER (GDS__dsql_recreate_view_failed        = 336397301)
+      INTEGER*4 GDS__dsql_drop_view_failed           
+      PARAMETER (GDS__dsql_drop_view_failed            = 336397302)
       INTEGER*4 GDS__gsec_cant_open_db               
       PARAMETER (GDS__gsec_cant_open_db                = 336723983)
       INTEGER*4 GDS__gsec_switches_error             
Modified: firebird/trunk/lang_helpers/gds_codes.pas
===================================================================
--- firebird/trunk/lang_helpers/gds_codes.pas	2010-08-01 20:43:29 UTC (rev 51382)
+++ firebird/trunk/lang_helpers/gds_codes.pas	2010-08-02 02:22:26 UTC (rev 51383)
@@ -1045,6 +1045,11 @@
 	gds_dsql_create_pack_body_failed     = 336397295;
 	gds_dsql_drop_pack_body_failed       = 336397296;
 	gds_dsql_recreate_pack_body_failed   = 336397297;
+	gds_dsql_create_view_failed          = 336397298;
+	gds_dsql_alter_view_failed           = 336397299;
+	gds_dsql_create_alter_view_failed    = 336397300;
+	gds_dsql_recreate_view_failed        = 336397301;
+	gds_dsql_drop_view_failed            = 336397302;
 	gds_gsec_cant_open_db                = 336723983;
 	gds_gsec_switches_error              = 336723984;
 	gds_gsec_no_op_spec                  = 336723985;
Modified: firebird/trunk/src/dsql/DdlNodes.epp
===================================================================
--- firebird/trunk/src/dsql/DdlNodes.epp	2010-08-01 20:43:29 UTC (rev 51382)
+++ firebird/trunk/src/dsql/DdlNodes.epp	2010-08-02 02:22:26 UTC (rev 51383)
@@ -75,8 +75,9 @@
 	const MetaName& relationName, const MetaName& fieldName, USHORT newPosition,
 	USHORT existingPosition);
 static rel_t relationType(SSHORT relationTypeNull, SSHORT relationType);
+static void saveField(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, const MetaName& fieldName);
 static void saveRelation(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch,
-	const dsql_str* relationName, bool creating);
+	const MetaName& relationName, bool view, bool creating);
 static void updateRdbFields(const TypeClause& type,
 	SSHORT& fieldType,
 	SSHORT& fieldLength,
@@ -435,13 +436,27 @@
 	return relationTypeNull ? rel_persistent : rel_t(relationType);
 }
 
+// Save the name of a field in the relation or view currently being defined. This is done to support
+// definition of triggers which will depend on the metadata created in this statement.
+static void saveField(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, const MetaName& fieldName)
+{
+	dsql_rel* relation = dsqlScratch->relation;
+	if (!relation)
+		return;
+
+	MemoryPool& p = relation->rel_flags & REL_new_relation ?
+		*tdbb->getDefaultPool() : dsqlScratch->getAttachment()->dbb_pool;
+	dsql_fld* field = FB_NEW(p) dsql_fld(p);
+	field->fld_name = fieldName.c_str();
+	field->fld_next = relation->rel_fields;
+	relation->rel_fields = field;
+}
+
 // Save the name of the relation or view currently being defined. This is done to support definition
 // of triggers which will depend on the metadata created in this statement.
 static void saveRelation(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch,
-	const dsql_str* relationName, bool creating)
+	const MetaName& relationName, bool view, bool creating)
 {
-	//// TODO: Verify "creating" usage when using this function for views.
-
 	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
 
 	if (dsqlScratch->flags & DsqlCompilerScratch::FLAG_METADATA_SAVED)
@@ -451,14 +466,15 @@
 
 	dsql_rel* relation;
 
-	if (!creating)
+	if (!view && !creating)
 		relation = METD_get_relation(dsqlScratch->getTransaction(), dsqlScratch, relationName);
 	else
 	{
 		MemoryPool& pool = *tdbb->getDefaultPool();
 		relation = FB_NEW(pool) dsql_rel(pool);
-		relation->rel_name = relationName->str_data;
-		relation->rel_flags = REL_creating;
+		relation->rel_name = relationName;
+		if (!view)
+			relation->rel_flags = REL_creating;
 	}
 
 	dsqlScratch->relation = relation;
@@ -511,8 +527,11 @@
 		fieldScaleNull = FALSE;
 		fieldScale = 0;
 
-		characterLengthNull = FALSE;
-		characterLength = type.charLength;
+		if (type.charLength != 0)
+		{
+			characterLengthNull = FALSE;
+			characterLength = type.charLength;
+		}
 
 		characterSetIdNull = FALSE;
 		characterSetId = type.charSetId;
@@ -815,6 +834,11 @@
 	DDL_resolve_intl_type2(dsqlScratch, legacyField,
 		(collate.isEmpty() ? NULL : MAKE_cstring(collate.c_str())), modifying);
 
+	setup(dsqlScratch);
+}
+
+void TypeClause::setup(DsqlCompilerScratch* dsqlScratch)
+{
 	type = legacyField->fld_dtype;
 	length = legacyField->fld_length;
 	scale = legacyField->fld_scale;
@@ -2655,7 +2679,7 @@
 	if (name.isEmpty())
 		DYN_UTIL_generate_trigger_name(tdbb, transaction, name);
 
-	AutoCacheRequest requestHandle(tdbb, drq_s_triggers2, DYN_REQUESTS);
+	AutoCacheRequest requestHandle(tdbb, drq_s_triggers, DYN_REQUESTS);
 
 	STORE (REQUEST_HANDLE requestHandle TRANSACTION_HANDLE transaction)
 		TRG IN RDB$TRIGGERS
@@ -3403,7 +3427,8 @@
 		AutoCacheRequest request2(tdbb, drq_l_rfld_coll, DYN_REQUESTS);
 
 		FOR (REQUEST_HANDLE request2 TRANSACTION_HANDLE transaction)
-			RF IN RDB$RELATION_FIELDS CROSS F IN RDB$FIELDS
+			RF IN RDB$RELATION_FIELDS
+			CROSS F IN RDB$FIELDS
 			WITH RF.RDB$FIELD_SOURCE EQ F.RDB$FIELD_NAME AND
 				 F.RDB$CHARACTER_SET_ID EQ COLL.RDB$CHARACTER_SET_ID AND
 				 RF.RDB$COLLATION_ID EQ COLL.RDB$COLLATION_ID
@@ -4205,7 +4230,7 @@
 					FOR (REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
 						RFR IN RDB$RELATION_FIELDS
 						WITH RFR.RDB$FIELD_SOURCE = FLD.RDB$FIELD_NAME AND
-								RFR.RDB$GENERATOR_NAME NOT MISSING
+							 RFR.RDB$GENERATOR_NAME NOT MISSING
 					{
 						// Domain @1 must be of exact number type with zero scale because it's used
 						// in an identity column.
@@ -4673,6 +4698,175 @@
 //----------------------
 
 
+void RelationNode::FieldDefinition::modify(thread_db* tdbb, jrd_tra* transaction)
+{
+	Attachment* attachment = transaction->tra_attachment;
+
+	AutoRequest request;
+
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		RFR IN RDB$RELATION_FIELDS
+		WITH RFR.RDB$RELATION_NAME EQ relationName.c_str() AND
+			 RFR.RDB$FIELD_NAME EQ name.c_str()
+	{
+		// ASF: This is prepared only to modify view fields!
+
+		MODIFY RFR
+			strcpy(RFR.RDB$FIELD_SOURCE, fieldSource.c_str());
+
+			RFR.RDB$COLLATION_ID.NULL = TRUE;
+			RFR.RDB$GENERATOR_NAME.NULL = TRUE;
+			RFR.RDB$IDENTITY_TYPE.NULL = TRUE;
+			RFR.RDB$NULL_FLAG.NULL = TRUE;
+			RFR.RDB$DEFAULT_SOURCE.NULL = TRUE;
+			RFR.RDB$DEFAULT_VALUE.NULL = TRUE;
+			RFR.RDB$FIELD_POSITION.NULL = TRUE;
+
+			RFR.RDB$VIEW_CONTEXT.NULL = TRUE;
+			RFR.RDB$BASE_FIELD.NULL = TRUE;
+			///RFR.RDB$UPDATE_FLAG.NULL = TRUE;
+
+			if (collationId.specified)
+			{
+				RFR.RDB$COLLATION_ID.NULL = FALSE;
+				RFR.RDB$COLLATION_ID = collationId.value;
+			}
+
+			SLONG fieldPos = -1;
+
+			if (position.specified)
+				fieldPos = position.value;
+			else
+			{
+				DYN_UTIL_generate_field_position(tdbb, NULL, name, &fieldPos);
+				if (fieldPos >= 0)
+					++fieldPos;
+			}
+
+			if (fieldPos >= 0)
+			{
+				RFR.RDB$FIELD_POSITION.NULL = FALSE;
+				RFR.RDB$FIELD_POSITION = SSHORT(fieldPos);
+			}
+
+			if (baseField.hasData())
+			{
+				RFR.RDB$BASE_FIELD.NULL = FALSE;
+				strcpy(RFR.RDB$BASE_FIELD, baseField.c_str());
+			}
+
+			if (viewContext.specified)
+			{
+				fb_assert(baseField.hasData());
+
+				RFR.RDB$VIEW_CONTEXT.NULL = FALSE;
+				RFR.RDB$VIEW_CONTEXT = viewContext.value;
+
+				DYN_UTIL_find_field_source(tdbb, transaction, relationName, viewContext.value,
+					baseField.c_str(), RFR.RDB$FIELD_SOURCE);
+			}
+		END_MODIFY
+	}
+	END_FOR
+}
+
+void RelationNode::FieldDefinition::store(thread_db* tdbb, jrd_tra* transaction)
+{
+	Attachment* attachment = transaction->tra_attachment;
+
+	AutoCacheRequest request(tdbb, drq_s_lfields, DYN_REQUESTS);
+
+	STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		RFR IN RDB$RELATION_FIELDS
+	{
+		strcpy(RFR.RDB$FIELD_NAME, name.c_str());
+		strcpy(RFR.RDB$RELATION_NAME, relationName.c_str());
+		strcpy(RFR.RDB$FIELD_SOURCE, fieldSource.c_str());
+		RFR.RDB$SYSTEM_FLAG = 0;
+
+		RFR.RDB$COLLATION_ID.NULL = TRUE;
+		RFR.RDB$GENERATOR_NAME.NULL = TRUE;
+		RFR.RDB$IDENTITY_TYPE.NULL = TRUE;
+		RFR.RDB$NULL_FLAG.NULL = TRUE;
+		RFR.RDB$DEFAULT_SOURCE.NULL = TRUE;
+		RFR.RDB$DEFAULT_VALUE.NULL = TRUE;
+		RFR.RDB$FIELD_POSITION.NULL = TRUE;
+
+		RFR.RDB$VIEW_CONTEXT.NULL = TRUE;
+		RFR.RDB$BASE_FIELD.NULL = TRUE;
+		///RFR.RDB$UPDATE_FLAG.NULL = TRUE;
+
+		if (collationId.specified)
+		{
+			RFR.RDB$COLLATION_ID.NULL = FALSE;
+			RFR.RDB$COLLATION_ID = collationId.value;
+		}
+
+		if (identitySequence.hasData())
+		{
+			RFR.RDB$GENERATOR_NAME.NULL = FALSE;
+			strcpy(RFR.RDB$GENERATOR_NAME, identitySequence.c_str());
+
+			RFR.RDB$IDENTITY_TYPE.NULL = FALSE;
+			RFR.RDB$IDENTITY_TYPE = IDENT_TYPE_BY_DEFAULT;
+		}
+
+		if (notNullFlag.specified)
+		{
+			RFR.RDB$NULL_FLAG.NULL = FALSE;
+			RFR.RDB$NULL_FLAG = notNullFlag.value;
+		}
+
+		if (defaultSource.hasData())
+		{
+			RFR.RDB$DEFAULT_SOURCE.NULL = FALSE;
+			attachment->storeMetaDataBlob(tdbb, transaction, &RFR.RDB$DEFAULT_SOURCE,
+				defaultSource);
+		}
+
+		if (defaultValue.length > 0)
+		{
+			RFR.RDB$DEFAULT_VALUE.NULL = FALSE;
+			attachment->storeBinaryBlob(tdbb, transaction, &RFR.RDB$DEFAULT_VALUE, defaultValue);
+		}
+
+		SLONG fieldPos = -1;
+
+		if (position.specified)
+			fieldPos = position.value;
+		else
+		{
+			DYN_UTIL_generate_field_position(tdbb, NULL, name, &fieldPos);
+			if (fieldPos >= 0)
+				++fieldPos;
+		}
+
+		if (fieldPos >= 0)
+		{
+			RFR.RDB$FIELD_POSITION.NULL = FALSE;
+			RFR.RDB$FIELD_POSITION = SSHORT(fieldPos);
+		}
+
+		if (baseField.hasData())
+		{
+			RFR.RDB$BASE_FIELD.NULL = FALSE;
+			strcpy(RFR.RDB$BASE_FIELD, baseField.c_str());
+		}
+
+		if (viewContext.specified)
+		{
+			fb_assert(baseField.hasData());
+
+			RFR.RDB$VIEW_CONTEXT.NULL = FALSE;
+			RFR.RDB$VIEW_CONTEXT = viewContext.value;
+
+			DYN_UTIL_find_field_source(tdbb, transaction, relationName, viewContext.value,
+				baseField.c_str(), RFR.RDB$FIELD_SOURCE);
+		}
+	}
+	END_STORE
+}
+
 // Delete local field.
 //
 //  The rules for dropping a regular column:
@@ -4828,6 +5022,29 @@
 	}
 }
 
+void RelationNode::storePrivileges(thread_db* tdbb, jrd_tra* transaction)
+{
+	Attachment* attachment = transaction->tra_attachment;
+
+	AutoCacheRequest request(tdbb, drq_s_usr_prvs, DYN_REQUESTS);
+
+	for (const TEXT* p = ALL_PRIVILEGES; *p; ++p)
+	{
+		STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+			X IN RDB$USER_PRIVILEGES
+		{
+			strcpy(X.RDB$RELATION_NAME, name.c_str());
+			strcpy(X.RDB$USER, attachment->att_user->usr_user_name.c_str());
+			X.RDB$USER_TYPE = obj_user;
+			X.RDB$OBJECT_TYPE = obj_relation;
+			X.RDB$PRIVILEGE[0] = *p;
+			X.RDB$PRIVILEGE[1] = 0;
+			X.RDB$GRANT_OPTION = 1;
+		}
+		END_STORE
+	}
+}
+
 void RelationNode::defineField(thread_db* tdbb, jrd_tra* transaction, const dsql_nod* element,
 	SSHORT position, const dsql_nod* pkCols)
 {
@@ -4887,157 +5104,109 @@
 			}
 		}
 
-		AutoCacheRequest request(tdbb, drq_s_lfields2, DYN_REQUESTS);
+		FieldDefinition fieldDefinition(*tdbb->getDefaultPool());
+		fieldDefinition.relationName = name;
+		fieldDefinition.name = field->fld_name;
+		fieldDefinition.notNullFlag = notNullFlag;
 
-		STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
-			RFR IN RDB$RELATION_FIELDS
-		{
-			const dsql_nod* domainNode = element->nod_arg[Dsql::e_dfl_domain];
-			MetaName fieldSource;
+		if (position >= 0)
+			fieldDefinition.position = position;
 
-			if (domainNode)
-			{
-				const dsql_nod* node1 = domainNode->nod_arg[Dsql::e_dom_name];
-				const dsql_str* domainName = (dsql_str*) node1->nod_arg[Dsql::e_fln_name];
+		const dsql_nod* domainNode = element->nod_arg[Dsql::e_dfl_domain];
 
-				// Get the domain information.
-				if (!METD_get_domain(transaction, field, domainName->str_data))
-				{
-					// Specified domain or source field does not exist
-					status_exception::raise(
-						Arg::Gds(isc_sqlerr) << Arg::Num(-607) <<
-						Arg::Gds(isc_dsql_command_err) <<
-						Arg::Gds(isc_dsql_domain_not_found) << domainName->str_data);
-				}
+		if (domainNode)
+		{
+			const dsql_nod* node1 = domainNode->nod_arg[Dsql::e_dom_name];
+			const dsql_str* domainName = (dsql_str*) node1->nod_arg[Dsql::e_fln_name];
 
-				fieldSource = domainName->str_data;
-			}
-			else
+			// Get the domain information.
+			if (!METD_get_domain(transaction, field, domainName->str_data))
 			{
-				string computedSource;
-				BlrWriter::BlrData computedValue;
-
-				if (element->nod_arg[e_dfl_computed])
-				{
-					field->fld_flags |= FLD_computed;
-
-					defineComputed(tdbb, field, element->nod_arg[e_dfl_computed],
-						computedSource, computedValue);
-				}
-
-				TypeClause fieldType(field, NULL);	// Don't use the collate in the generated domain.
-				fieldType.resolve(dsqlScratch);
-
-				// Generate a domain.
-				storeGlobalField(tdbb, transaction, fieldSource, fieldType,
-					computedSource, computedValue);
-			}
-
-			if ((relation->rel_flags & REL_external) &&
-				(field->fld_dtype == dtype_blob || field->fld_dtype == dtype_array ||
-				 field->fld_dimensions))
-			{
-				const char* typeName = (field->fld_dtype == dtype_blob ? "BLOB" : "ARRAY");
-
+				// Specified domain or source field does not exist
 				status_exception::raise(
 					Arg::Gds(isc_sqlerr) << Arg::Num(-607) <<
 					Arg::Gds(isc_dsql_command_err) <<
-					Arg::Gds(isc_dsql_type_not_supp_ext_tab) << typeName << name << field->fld_name);
+					Arg::Gds(isc_dsql_domain_not_found) << domainName->str_data);
 			}
 
-			strcpy(RFR.RDB$FIELD_NAME, field->fld_name.c_str());
-			strcpy(RFR.RDB$FIELD_SOURCE, fieldSource.c_str());
-			strcpy(RFR.RDB$RELATION_NAME, name.c_str());
-			RFR.RDB$SYSTEM_FLAG = 0;
+			fieldDefinition.fieldSource = domainName->str_data;
+		}
+		else
+		{
+			string computedSource;
+			BlrWriter::BlrData computedValue;
 
-			RFR.RDB$NULL_FLAG.NULL = TRUE;
-			RFR.RDB$BASE_FIELD.NULL = TRUE;
-			RFR.RDB$UPDATE_FLAG.NULL = TRUE;
-			RFR.RDB$FIELD_POSITION.NULL = TRUE;
-			RFR.RDB$VIEW_CONTEXT.NULL = TRUE;
-			RFR.RDB$DEFAULT_VALUE.NULL = TRUE;
-			RFR.RDB$DEFAULT_SOURCE.NULL = TRUE;
-			RFR.RDB$COLLATION_ID.NULL = TRUE;
-			RFR.RDB$GENERATOR_NAME.NULL = TRUE;
-			RFR.RDB$IDENTITY_TYPE.NULL = TRUE;
-
-			if (element->nod_arg[Dsql::e_dfl_collate])
+			if (element->nod_arg[e_dfl_computed])
 			{
-				DDL_resolve_intl_type(dsqlScratch, field, (dsql_str*) element->nod_arg[Dsql::e_dfl_collate]);
+				field->fld_flags |= FLD_computed;
 
-				RFR.RDB$COLLATION_ID.NULL = FALSE;
-				RFR.RDB$COLLATION_ID = SSHORT(field->fld_collation_id);
+				defineComputed(tdbb, field, element->nod_arg[e_dfl_computed],
+					computedSource, computedValue);
 			}
 
-			if (element->nod_arg[Dsql::e_dfl_identity])
-			{
-				dsc desc;
-				MET_get_domain(tdbb, fieldSource, &desc, NULL);
+			TypeClause fieldType(field, NULL);	// Don't use the collate in the generated domain.
+			fieldType.resolve(dsqlScratch);
 
-				if (!desc.isExact() || desc.dsc_scale != 0)
-				{
-					// Identity column @1 of table @2 must be exact numeric with zero scale.
-					status_exception::raise(
-						Arg::Gds(ENCODE_ISC_MSG(273, DYN_MSG_FAC)) << field->fld_name << name);
-				}
+			// Generate a domain.
+			storeGlobalField(tdbb, transaction, fieldDefinition.fieldSource, fieldType,
+				computedSource, computedValue);
+		}
 
-				MetaName sequenceName;
-				DYN_UTIL_generate_generator_name(tdbb, sequenceName);
+		if ((relation->rel_flags & REL_external) &&
+			(field->fld_dtype == dtype_blob || field->fld_dtype == dtype_array ||
+				field->fld_dimensions))
+		{
+			const char* typeName = (field->fld_dtype == dtype_blob ? "BLOB" : "ARRAY");
 
-				CreateSequenceNode::store(tdbb, transaction, sequenceName,
-					fb_sysflag_identity_generator);
+			status_exception::raise(
+				Arg::Gds(isc_sqlerr) << Arg::Num(-607) <<
+				Arg::Gds(isc_dsql_command_err) <<
+				Arg::Gds(isc_dsql_type_not_supp_ext_tab) << typeName << name << field->fld_name);
+		}
 
-				RFR.RDB$GENERATOR_NAME.NULL = FALSE;
-				strcpy(RFR.RDB$GENERATOR_NAME, sequenceName.c_str());
+		if (element->nod_arg[Dsql::e_dfl_collate])
+			DDL_resolve_intl_type(dsqlScratch, field, (dsql_str*) element->nod_arg[Dsql::e_dfl_collate]);
 
-				RFR.RDB$IDENTITY_TYPE.NULL = FALSE;
-				RFR.RDB$IDENTITY_TYPE = IDENT_TYPE_BY_DEFAULT;
-			}
+		if (element->nod_arg[Dsql::e_dfl_identity])
+		{
+			dsc desc;
+			MET_get_domain(tdbb, fieldDefinition.fieldSource, &desc, NULL);
 
-			if (notNullFlag)
+			if (!desc.isExact() || desc.dsc_scale != 0)
 			{
-				RFR.RDB$NULL_FLAG.NULL = FALSE;
-				RFR.RDB$NULL_FLAG = TRUE;
+				// Identity column @1 of table @2 must be exact numeric with zero scale.
+				status_exception::raise(
+					Arg::Gds(ENCODE_ISC_MSG(273, DYN_MSG_FAC)) << field->fld_name << name);
 			}
 
-			if (element->nod_arg[Dsql::e_dfl_default])
-			{
-				string defaultSource;
-				BlrWriter::BlrData defaultValue;
+			DYN_UTIL_generate_generator_name(tdbb, fieldDefinition.identitySequence);
 
-				if (defineDefault(tdbb, field, element->nod_arg[Dsql::e_dfl_default], defaultSource,
-						defaultValue) &&
-					notNullFlag)
-				{
-					status_exception::raise(
-						Arg::Gds(isc_sqlerr) << Arg::Num(-204) <<
-						Arg::Gds(isc_bad_default_value) <<
-						Arg::Gds(isc_invalid_clause) << "default null not null");
-				}
+			CreateSequenceNode::store(tdbb, transaction, fieldDefinition.identitySequence,
+				fb_sysflag_identity_generator);
+		}
 
-				RFR.RDB$DEFAULT_SOURCE.NULL = FALSE;
-				attachment->storeMetaDataBlob(tdbb, transaction, &RFR.RDB$DEFAULT_SOURCE, defaultSource);
+		BlrWriter::BlrData defaultValue;
 
-				RFR.RDB$DEFAULT_VALUE.NULL = FALSE;
-				attachment->storeBinaryBlob(tdbb, transaction, &RFR.RDB$DEFAULT_VALUE, defaultValue);
-			}
-
-			if (position == -1)
+		if (element->nod_arg[Dsql::e_dfl_default])
+		{
+			if (defineDefault(tdbb, field, element->nod_arg[Dsql::e_dfl_default],
+					fieldDefinition.defaultSource, defaultValue) &&
+				notNullFlag)
 			{
-				SLONG fieldPos = -1;
-				DYN_UTIL_generate_field_position(tdbb, NULL, name, &fieldPos);
-				if (fieldPos >= 0)
-					position = SSHORT(fieldPos + 1);
+				status_exception::raise(
+					Arg::Gds(isc_sqlerr) << Arg::Num(-204) <<
+					Arg::Gds(isc_bad_default_value) <<
+					Arg::Gds(isc_invalid_clause) << "default null not null");
 			}
-
-			if (position >= 0)
-			{
-				RFR.RDB$FIELD_POSITION.NULL = FALSE;
-				RFR.RDB$FIELD_POSITION = position;
-			}
 		}
-		END_STORE
 
+		fieldDefinition.defaultValue = defaultValue;
+
+		if (element->nod_arg[Dsql::e_dfl_collate])
+			fieldDefinition.collationId = field->fld_collation_id;
+
+		fieldDefinition.store(tdbb, transaction);
+
 		// Define the field constraints.
 		for (ObjectsArray<Constraint>::iterator constraint(constraints.begin());
 			 constraint != constraints.end();
@@ -5130,7 +5299,7 @@
 		if (field->fld_dtype <= dtype_any_text)
 		{
 			field->fld_character_set_id = DSC_GET_CHARSET(&desc);
-			field->fld_collation_id= DSC_GET_COLLATE(&desc);
+			field->fld_collation_id = DSC_GET_COLLATE(&desc);
 		}
 		else
 			field->fld_sub_type = desc.dsc_sub_type;
@@ -5639,9 +5808,7 @@
 void RelationNode::defineCheckConstraintTrigger(Constraint& constraint, dsql_nod* node,
 	FB_UINT64 triggerType)
 {
-	// See hack at pass1_field.
-	AutoSetRestore2<dsql_nod*, DsqlCompiledStatement> autoDdlNode(dsqlScratch->getStatement(),
-		&DsqlCompiledStatement::getDdlNode, &DsqlCompiledStatement::setDdlNode, node);
+	AutoSetRestore<bool> autoCheckConstraintTrigger(&dsqlScratch->checkConstraintTrigger, true);
 
 	Constraint::BlrWriter& blrWriter = constraint.blrWritersHolder.add();
 	blrWriter.init(dsqlScratch);
@@ -6085,7 +6252,7 @@
 {
 	Attachment* attachment = transaction->tra_attachment;
 
-	saveRelation(tdbb, dsqlScratch, MAKE_cstring(name.c_str()), true);
+	saveRelation(tdbb, dsqlScratch, name, false, true);
 
 	if (externalFile)
 	{
@@ -6145,24 +6312,8 @@
 	}
 	END_STORE
 
-	for (const TEXT* p = ALL_PRIVILEGES; *p; ++p)
-	{
-		request.reset(tdbb, drq_s_usr_prvs, DYN_REQUESTS);
+	storePrivileges(tdbb, transaction);
 
-		STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
-			X IN RDB$USER_PRIVILEGES
-		{
-			strcpy(X.RDB$RELATION_NAME, name.c_str());
-			strcpy(X.RDB$USER, attachment->att_user->usr_user_name.c_str());
-			X.RDB$USER_TYPE = obj_user;
-			X.RDB$OBJECT_TYPE = obj_relation;
-			X.RDB$PRIVILEGE[0] = *p;
-			X.RDB$PRIVILEGE[1] = 0;
-			X.RDB$GRANT_OPTION = 1;
-		}
-		END_STORE
-	}
-
 	ObjectsArray<Constraint> constraints;
 	const dsql_nod* pkCols = findPkColumns();
 	SSHORT position = 0;
@@ -6241,7 +6392,7 @@
 {
 	Attachment* attachment = transaction->tra_attachment;
 
-	saveRelation(tdbb, dsqlScratch, MAKE_cstring(name.c_str()), false);
+	saveRelation(tdbb, dsqlScratch, name, false, false);
 
 	if (!dsqlScratch->relation)
 	{
@@ -7076,8 +7227,7 @@
 
 void DropRelationNode::execute(thread_db* tdbb, jrd_tra* transaction)
 {
-	AutoPtr<dsql_str> nameStr(MAKE_string(name.c_str(), name.length()));
-	const dsql_rel* relation = METD_get_relation(transaction, dsqlScratch, nameStr);
+	const dsql_rel* relation = METD_get_relation(transaction, dsqlScratch, name);
 
 	if (!relation && silent)
 		return;
@@ -7141,6 +7291,927 @@
 //----------------------
 
 
+void CreateAlterViewNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const
+{
+	text.printf(
+		"CreateAlterViewNode\n"
+		"  name: '%s'\n",
+		name.c_str());
+}
+
+void CreateAlterViewNode::execute(thread_db* tdbb, jrd_tra* transaction)
+{
+	Attachment* attachment = transaction->tra_attachment;
+
+	const dsql_rel* modifyingView = NULL;
+
+	if (alter)
+	{
+		modifyingView = METD_get_relation(dsqlScratch->getTransaction(), dsqlScratch, name);
+
+		if (!modifyingView && !create)
+			status_exception::raise(Arg::Gds(isc_dyn_view_not_found) << name);
+	}
+
+	saveRelation(tdbb, dsqlScratch, name, true, modifyingView == NULL);
+
+	// run all statements under savepoint control
+	AutoSavePoint savePoint(tdbb, transaction);
+
+	const int ddlTriggerAction = (modifyingView ? DDL_TRIGGER_ALTER_VIEW : DDL_TRIGGER_CREATE_VIEW);
+
+	executeDdlTrigger(tdbb, transaction, DTW_BEFORE, ddlTriggerAction, name);
+
+	if (!modifyingView)
+		DYN_UTIL_check_unique_name(tdbb, transaction, name, obj_relation);
+
+	// Compile the SELECT statement into a record selection expression, making sure to bump the
+	// context number since view contexts start at 1 (except for computed fields) -- note that
+	// calling PASS1_rse directly rather than PASS1_statement saves the context stack.
+
+	DDL_reset_context_stack(dsqlScratch);
+	++dsqlScratch->contextNumber;
+	selectExpr->nod_flags |= NOD_SELECT_VIEW_FIELDS;
+	dsql_nod* rse = PASS1_rse(dsqlScratch, selectExpr, NULL);
+
+	dsqlScratch->getBlrData().clear();
+	dsqlScratch->appendUChar(dsqlScratch->isVersion4() ? blr_version4 : blr_version5);
+
+	// ASF: Call GEN_hidden_variables could be a optimization for views to not have
+	// blr_dcl_variables inside RSE loops, but this is currently not possible because it will
+	// mix the variables from view fields and view body.
+
+	GEN_expr(dsqlScratch, rse);
+	dsqlScratch->appendUChar(blr_eoc);
+
+	// Store the blr and source string for the view definition.
+
+	if (modifyingView)
+	{
+		AutoCacheRequest request(tdbb, drq_m_view, DYN_REQUESTS);
+		bool found = false;
+
+		FOR (REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+			REL IN RDB$RELATIONS
+			WITH REL.RDB$RELATION_NAME EQ name.c_str() AND
+				 REL.RDB$VIEW_BLR NOT MISSING
+		{
+			found = true;
+
+			MODIFY REL
+				attachment->storeMetaDataBlob(tdbb, transaction, &REL.RDB$VIEW_SOURCE, source);
+				attachment->storeBinaryBlob(tdbb, transaction, &REL.RDB$VIEW_BLR,
+					dsqlScratch->getBlrData());
+			END_MODIFY
+		}
+		END_FOR
+
+		if (!found)
+			status_exception::raise(Arg::Gds(isc_dyn_view_not_found) << name);
+
+		AutoRequest request2;
+
+		FOR (REQUEST_HANDLE request2 TRANSACTION_HANDLE transaction)
+			VR IN RDB$VIEW_RELATIONS
+			WITH VR.RDB$VIEW_NAME EQ name.c_str()
+		{
+			ERASE VR;
+		}
+		END_FOR
+
+		request2.reset();
+
+		FOR (REQUEST_HANDLE request2 TRANSACTION_HANDLE transaction)
+			TRG IN RDB$TRIGGERS
+			WITH TRG.RDB$RELATION_NAME EQ name.c_str() AND
+				 TRG.RDB$SYSTEM_FLAG EQ fb_sysflag_view_check
+		{
+			ERASE TRG;
+		}
+		END_FOR
+	}
+	else
+	{
+		AutoCacheRequest request(tdbb, drq_s_rels, DYN_REQUESTS);
+
+		STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+			REL IN RDB$RELATIONS
+		{
+			strcpy(REL.RDB$RELATION_NAME, name.c_str());
+			REL.RDB$SYSTEM_FLAG = 0;
+			REL.RDB$FLAGS = REL_sql;
+			REL.RDB$RELATION_TYPE = SSHORT(rel_view);
+
+			attachment->storeMetaDataBlob(tdbb, transaction, &REL.RDB$VIEW_SOURCE, source);
+			attachment->storeBinaryBlob(tdbb, transaction, &REL.RDB$VIEW_BLR, dsqlScratch->getBlrData());
+		}
+		END_STORE
+
+		storePrivileges(tdbb, transaction);
+	}
+
+	// Define the view source relations from the statement contexts and union contexts.
+
+	while (dsqlScratch->derivedContext.hasData())
+		dsqlScratch->context->push(dsqlScratch->derivedContext.pop());
+
+	while (dsqlScratch->unionContext.hasData())
+		dsqlScratch->context->push(dsqlScratch->unionContext.pop());
+
+	AutoCacheRequest request(tdbb, drq_s_view_rels, DYN_REQUESTS);
+
+	for (DsqlContextStack::iterator temp(*dsqlScratch->context); temp.hasData(); ++temp)
+	{
+		const dsql_ctx* context = temp.object();
+		const dsql_rel* relation = context->ctx_relation;
+		const dsql_prc* procedure = context->ctx_procedure;
+
+		if (relation || procedure)
+		{
+			const MetaName& refName = relation ? relation->rel_name : procedure->prc_name.identifier;
+			const char* contextName = context->ctx_alias ? context->ctx_alias : refName.c_str();
+
+			ViewContextType ctxType;
+			if (relation)
+			{
+				if (!(relation->rel_flags & REL_view))
+					ctxType = VCT_TABLE;
+				else
+					ctxType = VCT_VIEW;
+			}
+			else //if (procedure)
+				ctxType = VCT_PROCEDURE;
+
+			STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+				VRL IN RDB$VIEW_RELATIONS
+			{
+				strcpy(VRL.RDB$VIEW_NAME, name.c_str());
+				strcpy(VRL.RDB$RELATION_NAME, refName.c_str());
+				VRL.RDB$CONTEXT_TYPE = SSHORT(ctxType);
+				VRL.RDB$VIEW_CONTEXT = context->ctx_context;
+				strcpy(VRL.RDB$CONTEXT_NAME, contextName);
+
+				if (procedure && procedure->prc_name.package.hasData())
+				{
+					VRL.RDB$PACKAGE_NAME.NULL = FALSE;
+					strcpy(VRL.RDB$PACKAGE_NAME, procedure->prc_name.package.c_str());
+				}
+				else
+					VRL.RDB$PACKAGE_NAME.NULL = TRUE;
+			}
+			END_STORE
+		}
+	}
+
+	// Check privileges on base tables and views.
+
+	request.reset(tdbb, drq_l_view_rels, DYN_REQUESTS);
+
+	FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction)
+		VRL IN RDB$VIEW_RELATIONS CROSS
+		PREL IN RDB$RELATIONS OVER RDB$RELATION_NAME
+		WITH VRL.RDB$PACKAGE_NAME MISSING AND
+			 VRL.RDB$VIEW_NAME EQ name.c_str()
+	{
+		// CVC: This never matches so it causes unnecessary calls to verify,
+		// so I included a call to strip trailing blanks.
+		fb_utils::exact_name_limit(PREL.RDB$OWNER_NAME, sizeof(PREL.RDB$OWNER_NAME));
+
+		if (attachment->att_user->usr_user_name != PREL.RDB$OWNER_NAME)
+		{
+			SecurityClass::flags_t priv;
+
+			// I think this should be the responsability of DFW or the user will find ways to
+			// circumvent DYN.
+			if (!DYN_UTIL_get_prot(tdbb, transaction, PREL.RDB$RELATION_NAME, "", &priv))
+			{
+				// ASF: DYN_UTIL_get_prot will throw instead of return false.
+				fb_assert(false);
+			}
+
+			if (!(priv & SCL_read))
+			{
+				// msg 32: no permission for %s access to %s %s
+				status_exception::raise(
+					Arg::Gds(isc_no_priv) << Arg::Str("SELECT") <<	//	Non-Translatable
+					// Remember, a view may be based on a view.
+					"TABLE/VIEW" <<	//  Non-Translatable
+	...
 
[truncated message content] | 
| 
      
      
      From: <ale...@us...> - 2010-08-09 13:56:28
       | 
| Revision: 51416
          http://firebird.svn.sourceforge.net/firebird/?rev=51416&view=rev
Author:   alexpeshkoff
Date:     2010-08-09 13:56:20 +0000 (Mon, 09 Aug 2010)
Log Message:
-----------
Damian's patch for additional CPUs under linux
Modified Paths:
--------------
    firebird/trunk/configure.in
    firebird/trunk/src/common/classes/DbImplementation.cpp
    firebird/trunk/src/jrd/common.h
Modified: firebird/trunk/configure.in
===================================================================
--- firebird/trunk/configure.in	2010-08-09 11:50:12 UTC (rev 51415)
+++ firebird/trunk/configure.in	2010-08-09 13:56:20 UTC (rev 51416)
@@ -275,6 +275,28 @@
     SHRLIB_EXT=so
     ;;
 
+  hppa*-*-linux*)
+    MAKEFILE_PREFIX=linux_generic
+    INSTALL_PREFIX=linux
+    PLATFORM=LINUX
+    AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
+    AC_DEFINE(HPPA, 1, [Define this if CPU is HPPA])
+    LOCK_MANAGER_FLG=Y
+    EDITLINE_FLG=Y
+    SHRLIB_EXT=so
+    ;;
+
+  alpha*-*-linux*)
+   MAKEFILE_PREFIX=linux_generic
+   INSTALL_PREFIX=linux
+   PLATFORM=LINUX
+   AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
+   AC_DEFINE(ALPHA, 1, [Define this if CPU is Alpha])
+   LOCK_MANAGER_FLG=Y
+   EDITLINE_FLG=Y
+   SHRLIB_EXT=so
+   ;;
+
   *-*-linux* | *-*-gnu*)
     MAKEFILE_PREFIX=linux_generic
     INSTALL_PREFIX=linux
Modified: firebird/trunk/src/common/classes/DbImplementation.cpp
===================================================================
--- firebird/trunk/src/common/classes/DbImplementation.cpp	2010-08-09 11:50:12 UTC (rev 51415)
+++ firebird/trunk/src/common/classes/DbImplementation.cpp	2010-08-09 13:56:20 UTC (rev 51416)
@@ -46,6 +46,7 @@
 static const UCHAR CpuSh = 11;
 static const UCHAR CpuSheb = 12;
 static const UCHAR CpuHppa = 13;
+static const UCHAR CpuAlpha = 14;
 
 static const UCHAR OsWindows = 0;
 static const UCHAR OsLinux = 1;
@@ -82,7 +83,8 @@
 	"s390x",
 	"SH",
 	"SHEB",
-	"HPPA"
+	"HPPA",
+	"Alpha"
 };
 
 const char* operatingSystem[] = {
@@ -109,22 +111,22 @@
 // This table lists pre-fb3 imlementation codes
 const UCHAR backwardTable[FB_NELEM(hardware) * FB_NELEM(operatingSystem)] =
 {
-//				Intel	AMD		Sparc	PPC		PPC64	MIPSEL	MIPS	ARM		IA64	s390	s390x	SH		SHEB	HPPA
-/* Windows */	50,		68,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
-/* Linux */		60,		66,		65,		69,		0,		71,		72,		75, 	76,		79, 	78,		80,		81,		0,
-/* Darwin */	70,		73,		0,		63,		77,		0,		0,		0,		0,		0,		0,		0,		0,		0,
-/* Solaris */	0,		0,		30,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
-/* HPUX */		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		31,
-/* AIX */		0,		0,		0,		35,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
-/* MVS */		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
-/* FreeBSD */	61,		67,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
-/* NetBSD */	62,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0
+//				Intel	AMD		Sparc	PPC		PPC64	MIPSEL	MIPS	ARM		IA64	s390	s390x	SH		SHEB	HPPA	Alpha
+/* Windows */	50,		68,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
+/* Linux */		60,		66,		65,		69,		0,		71,		72,		75, 	76,		79, 	78,		80,		81,		0,		0,
+/* Darwin */	70,		73,		0,		63,		77,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
+/* Solaris */	0,		0,		30,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
+/* HPUX */		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		31,		0,
+/* AIX */		0,		0,		0,		35,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
+/* MVS */		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
+/* FreeBSD */	61,		67,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,
+/* NetBSD */	62,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0,		0
 };
 
 const UCHAR backEndianess[FB_NELEM(hardware)] =
 {
-//	Intel	AMD		Sparc	PPC		PPC64	MIPSEL	MIPS	ARM		IA64	s390	s390x	SH		SHEB	HPPA
-	0,		0,		1,		1,		1,		0,		1,		0,		0,		1,		1,		0,		1,		1,
+//	Intel	AMD		Sparc	PPC		PPC64	MIPSEL	MIPS	ARM		IA64	s390	s390x	SH		SHEB	HPPA	Alpha
+	0,		0,		1,		1,		1,		0,		1,		0,		0,		1,		1,		0,		1,		1,		0
 };
 
 } // anonymous namespace
Modified: firebird/trunk/src/jrd/common.h
===================================================================
--- firebird/trunk/src/jrd/common.h	2010-08-09 11:50:12 UTC (rev 51415)
+++ firebird/trunk/src/jrd/common.h	2010-08-09 13:56:20 UTC (rev 51416)
@@ -182,6 +182,16 @@
 #define RISC_ALIGNMENT
 #endif /* sheb */
 
+#ifdef HPPA
+#define FB_CPU CpuHppa
+#define RISC_ALIGNMENT
+#endif /* hppa */
+
+#ifdef ALPHA
+#define FB_CPU CpuAlpha
+#define RISC_ALIGNMENT
+#endif
+
 #endif /* LINUX */
 
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <asf...@us...> - 2010-08-09 15:49:01
       | 
| Revision: 51418
          http://firebird.svn.sourceforge.net/firebird/?rev=51418&view=rev
Author:   asfernandes
Date:     2010-08-09 15:48:51 +0000 (Mon, 09 Aug 2010)
Log Message:
-----------
Const correction for EVL, EXE and they subsystems. Adjustments to CMP and OPT.
Modified Paths:
--------------
    firebird/trunk/builds/win32/msvc10/common.vcxproj
    firebird/trunk/builds/win32/msvc10/common.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/common_classic.vcxproj
    firebird/trunk/builds/win32/msvc10/common_classic.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/common_static.vcxproj
    firebird/trunk/builds/win32/msvc10/common_static.vcxproj.filters
    firebird/trunk/builds/win32/msvc8/common.vcproj
    firebird/trunk/builds/win32/msvc8/common_classic.vcproj
    firebird/trunk/builds/win32/msvc8/common_static.vcproj
    firebird/trunk/builds/win32/msvc9/common.vcproj
    firebird/trunk/builds/win32/msvc9/common_classic.vcproj
    firebird/trunk/builds/win32/msvc9/common_static.vcproj
    firebird/trunk/src/dsql/AggNodes.cpp
    firebird/trunk/src/dsql/AggNodes.h
    firebird/trunk/src/dsql/ExprNodes.cpp
    firebird/trunk/src/dsql/ExprNodes.h
    firebird/trunk/src/dsql/Nodes.h
    firebird/trunk/src/dsql/StmtNodes.cpp
    firebird/trunk/src/dsql/StmtNodes.h
    firebird/trunk/src/dsql/WinNodes.cpp
    firebird/trunk/src/dsql/WinNodes.h
    firebird/trunk/src/jrd/ExtEngineManager.cpp
    firebird/trunk/src/jrd/ExtEngineManager.h
    firebird/trunk/src/jrd/Function.epp
    firebird/trunk/src/jrd/Function.h
    firebird/trunk/src/jrd/Optimizer.cpp
    firebird/trunk/src/jrd/Optimizer.h
    firebird/trunk/src/jrd/SysFunction.cpp
    firebird/trunk/src/jrd/SysFunction.h
    firebird/trunk/src/jrd/blb.cpp
    firebird/trunk/src/jrd/blb_proto.h
    firebird/trunk/src/jrd/btr.cpp
    firebird/trunk/src/jrd/btr_proto.h
    firebird/trunk/src/jrd/cmp.cpp
    firebird/trunk/src/jrd/evl.cpp
    firebird/trunk/src/jrd/evl_proto.h
    firebird/trunk/src/jrd/exe.cpp
    firebird/trunk/src/jrd/exe.h
    firebird/trunk/src/jrd/exe_proto.h
    firebird/trunk/src/jrd/execute_statement.cpp
    firebird/trunk/src/jrd/execute_statement.h
    firebird/trunk/src/jrd/extds/ExtDS.cpp
    firebird/trunk/src/jrd/extds/ExtDS.h
    firebird/trunk/src/jrd/fun.epp
    firebird/trunk/src/jrd/fun_proto.h
    firebird/trunk/src/jrd/met.epp
    firebird/trunk/src/jrd/opt.cpp
    firebird/trunk/src/jrd/par.cpp
    firebird/trunk/src/jrd/recsrc/AggregatedStream.cpp
    firebird/trunk/src/jrd/recsrc/Cursor.cpp
    firebird/trunk/src/jrd/recsrc/Cursor.h
    firebird/trunk/src/jrd/recsrc/FilteredStream.cpp
    firebird/trunk/src/jrd/recsrc/HashJoin.cpp
    firebird/trunk/src/jrd/recsrc/MergeJoin.cpp
    firebird/trunk/src/jrd/recsrc/ProcedureScan.cpp
    firebird/trunk/src/jrd/recsrc/RecordSource.h
    firebird/trunk/src/jrd/recsrc/RecursiveStream.cpp
    firebird/trunk/src/jrd/recsrc/SortedStream.cpp
    firebird/trunk/src/jrd/recsrc/Union.cpp
    firebird/trunk/src/jrd/recsrc/WindowedStream.cpp
    firebird/trunk/src/jrd/req.h
    firebird/trunk/src/jrd/trace/TraceJrdHelpers.h
Added Paths:
-----------
    firebird/trunk/src/common/classes/NestConst.h
Modified: firebird/trunk/builds/win32/msvc10/common.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/common.vcxproj	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc10/common.vcxproj	2010-08-09 15:48:51 UTC (rev 51418)
@@ -199,6 +199,7 @@
     <ClInclude Include="..\..\..\src\common\classes\GenericMap.h" />
     <ClInclude Include="..\..\..\src\common\classes\MetaName.h" />
     <ClInclude Include="..\..\..\src\common\classes\MsgPrint.h" />
+    <ClInclude Include="..\..\..\src\common\classes\NestConst.h" />
     <ClInclude Include="..\..\..\src\common\classes\SafeArg.h" />
     <ClInclude Include="..\..\..\src\common\StatusArg.h" />
     <ClInclude Include="..\..\..\src\common\StatusHolder.h" />
Modified: firebird/trunk/builds/win32/msvc10/common.vcxproj.filters
===================================================================
--- firebird/trunk/builds/win32/msvc10/common.vcxproj.filters	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc10/common.vcxproj.filters	2010-08-09 15:48:51 UTC (rev 51418)
@@ -180,6 +180,9 @@
     <ClInclude Include="..\..\..\src\common\classes\MsgPrint.h">
       <Filter>Header files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\common\classes\NestConst.h">
+      <Filter>Header files</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\src\common\classes\SafeArg.h">
       <Filter>Header files</Filter>
     </ClInclude>
Modified: firebird/trunk/builds/win32/msvc10/common_classic.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/common_classic.vcxproj	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc10/common_classic.vcxproj	2010-08-09 15:48:51 UTC (rev 51418)
@@ -198,6 +198,7 @@
     <ClInclude Include="..\..\..\src\common\classes\GenericMap.h" />
     <ClInclude Include="..\..\..\src\common\classes\MetaName.h" />
     <ClInclude Include="..\..\..\src\common\classes\MsgPrint.h" />
+    <ClInclude Include="..\..\..\src\common\classes\NestConst.h" />
     <ClInclude Include="..\..\..\src\common\classes\SafeArg.h" />
     <ClInclude Include="..\..\..\src\common\StatusArg.h" />
     <ClInclude Include="..\..\..\src\common\StatusHolder.h" />
Modified: firebird/trunk/builds/win32/msvc10/common_classic.vcxproj.filters
===================================================================
--- firebird/trunk/builds/win32/msvc10/common_classic.vcxproj.filters	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc10/common_classic.vcxproj.filters	2010-08-09 15:48:51 UTC (rev 51418)
@@ -177,6 +177,9 @@
     <ClInclude Include="..\..\..\src\common\classes\MsgPrint.h">
       <Filter>Header files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\common\classes\NestConst.h">
+      <Filter>Header files</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\src\common\classes\SafeArg.h">
       <Filter>Header files</Filter>
     </ClInclude>
Modified: firebird/trunk/builds/win32/msvc10/common_static.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/common_static.vcxproj	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc10/common_static.vcxproj	2010-08-09 15:48:51 UTC (rev 51418)
@@ -193,6 +193,7 @@
     <ClInclude Include="..\..\..\src\common\classes\init.h" />
     <ClInclude Include="..\..\..\src\common\classes\MetaName.h" />
     <ClInclude Include="..\..\..\src\common\classes\MsgPrint.h" />
+    <ClInclude Include="..\..\..\src\common\classes\NestConst.h" />
     <ClInclude Include="..\..\..\src\common\classes\SafeArg.h" />
     <ClInclude Include="..\..\..\src\common\StatusArg.h" />
     <ClInclude Include="..\..\..\src\common\StatusHolder.h" />
Modified: firebird/trunk/builds/win32/msvc10/common_static.vcxproj.filters
===================================================================
--- firebird/trunk/builds/win32/msvc10/common_static.vcxproj.filters	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc10/common_static.vcxproj.filters	2010-08-09 15:48:51 UTC (rev 51418)
@@ -156,6 +156,9 @@
     <ClInclude Include="..\..\..\src\common\classes\MsgPrint.h">
       <Filter>Header files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\common\classes\NestConst.h">
+      <Filter>Header files</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\src\common\classes\SafeArg.h">
       <Filter>Header files</Filter>
     </ClInclude>
Modified: firebird/trunk/builds/win32/msvc8/common.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc8/common.vcproj	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc8/common.vcproj	2010-08-09 15:48:51 UTC (rev 51418)
@@ -501,6 +501,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\NestConst.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\SafeArg.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc8/common_classic.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc8/common_classic.vcproj	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc8/common_classic.vcproj	2010-08-09 15:48:51 UTC (rev 51418)
@@ -497,6 +497,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\NestConst.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\SafeArg.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc8/common_static.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc8/common_static.vcproj	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc8/common_static.vcproj	2010-08-09 15:48:51 UTC (rev 51418)
@@ -470,6 +470,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\NestConst.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\SafeArg.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc9/common.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/common.vcproj	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc9/common.vcproj	2010-08-09 15:48:51 UTC (rev 51418)
@@ -502,6 +502,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\NestConst.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\SafeArg.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc9/common_classic.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/common_classic.vcproj	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc9/common_classic.vcproj	2010-08-09 15:48:51 UTC (rev 51418)
@@ -498,6 +498,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\NestConst.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\SafeArg.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc9/common_static.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/common_static.vcproj	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/builds/win32/msvc9/common_static.vcproj	2010-08-09 15:48:51 UTC (rev 51418)
@@ -471,6 +471,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\common\classes\NestConst.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\common\classes\SafeArg.h"
 				>
 			</File>
Added: firebird/trunk/src/common/classes/NestConst.h
===================================================================
--- firebird/trunk/src/common/classes/NestConst.h	                        (rev 0)
+++ firebird/trunk/src/common/classes/NestConst.h	2010-08-09 15:48:51 UTC (rev 51418)
@@ -0,0 +1,52 @@
+/*
+ *  The contents of this file are subject to the Initial
+ *  Developer's Public License Version 1.0 (the "License");
+ *  you may not use this file except in compliance with the
+ *  License. You may obtain a copy of the License at
+ *  http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
+ *
+ *  Software distributed under the License is distributed AS IS,
+ *  WITHOUT WARRANTY OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing rights
+ *  and limitations under the License.
+ *
+ *  The Original Code was created by Adriano dos Santos Fernandes
+ *  for the Firebird Open Source RDBMS project.
+ *
+ *  Copyright (c) 2010 Adriano dos Santos Fernandes <adr...@gm...>
+ *  and all contributors signed below.
+ *
+ *  All Rights Reserved.
+ *  Contributor(s): ______________________________________.
+ */
+
+#ifndef COMMON_NEST_CONST_H
+#define COMMON_NEST_CONST_H
+
+// Encloses a pointer to cascade parent object constness.
+template <typename T>
+class NestConst
+{
+public:
+	NestConst(T* aPtr = NULL)
+		: ptr(aPtr)
+	{
+	}
+
+	NestConst<T>& operator =(T* aPtr)
+	{
+		ptr = aPtr;
+		return *this;
+	}
+
+	operator T*() { return ptr; }
+	operator const T*() const { return ptr; }
+
+	T* operator ->() { return ptr; }
+	const T* operator ->() const { return ptr; }
+
+private:
+	T* ptr;
+};
+
+#endif	// COMMON_NEST_CONST_H
Property changes on: firebird/trunk/src/common/classes/NestConst.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
Modified: firebird/trunk/src/dsql/AggNodes.cpp
===================================================================
--- firebird/trunk/src/dsql/AggNodes.cpp	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/src/dsql/AggNodes.cpp	2010-08-09 15:48:51 UTC (rev 51418)
@@ -553,7 +553,7 @@
 	}
 }
 
-ExprNode* AvgAggNode::copy(thread_db* tdbb, NodeCopier& copier) const
+ExprNode* AvgAggNode::copy(thread_db* tdbb, NodeCopier& copier)
 {
 	AvgAggNode* node = FB_NEW(*tdbb->getDefaultPool()) AvgAggNode(*tdbb->getDefaultPool(),
 		distinct, dialect1);
@@ -679,7 +679,7 @@
 	desc->makeBlob(desc->getBlobSubType(), desc->getTextType());
 }
 
-ExprNode* ListAggNode::copy(thread_db* tdbb, NodeCopier& copier) const
+ExprNode* ListAggNode::copy(thread_db* tdbb, NodeCopier& copier)
 {
 	ListAggNode* node = FB_NEW(*tdbb->getDefaultPool()) ListAggNode(*tdbb->getDefaultPool(),
 		distinct);
@@ -805,7 +805,7 @@
 	desc->dsc_flags = 0;
 }
 
-ExprNode* CountAggNode::copy(thread_db* tdbb, NodeCopier& copier) const
+ExprNode* CountAggNode::copy(thread_db* tdbb, NodeCopier& copier)
 {
 	CountAggNode* node = FB_NEW(*tdbb->getDefaultPool()) CountAggNode(*tdbb->getDefaultPool(),
 		distinct);
@@ -1040,7 +1040,7 @@
 	ERR_post(Arg::Gds(isc_datype_notsup));	// data type not supported for arithmetic
 }
 
-ExprNode* SumAggNode::copy(thread_db* tdbb, NodeCopier& copier) const
+ExprNode* SumAggNode::copy(thread_db* tdbb, NodeCopier& copier)
 {
 	SumAggNode* node = FB_NEW(*tdbb->getDefaultPool()) SumAggNode(*tdbb->getDefaultPool(),
 		distinct, dialect1);
@@ -1123,7 +1123,7 @@
 	CMP_get_desc(tdbb, csb, arg, desc);
 }
 
-ExprNode* MaxMinAggNode::copy(thread_db* tdbb, NodeCopier& copier) const
+ExprNode* MaxMinAggNode::copy(thread_db* tdbb, NodeCopier& copier)
 {
 	MaxMinAggNode* node = FB_NEW(*tdbb->getDefaultPool()) MaxMinAggNode(*tdbb->getDefaultPool(),
 		type);
Modified: firebird/trunk/src/dsql/AggNodes.h
===================================================================
--- firebird/trunk/src/dsql/AggNodes.h	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/src/dsql/AggNodes.h	2010-08-09 15:48:51 UTC (rev 51418)
@@ -39,7 +39,7 @@
 
 	virtual void make(dsc* desc, dsql_nod* nullReplacement);
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier);
 	virtual ExprNode* pass2(thread_db* tdbb, CompilerScratch* csb);
 
 	virtual void aggInit(thread_db* tdbb, jrd_req* request) const;
@@ -65,7 +65,7 @@
 	virtual bool setParameterType(DsqlCompilerScratch* dsqlScratch,
 		dsql_nod* node, bool forceVarChar) const;
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier);
 
 	virtual void checkOrderedWindowCapable() const
 	{
@@ -84,7 +84,7 @@
 
 private:
 	dsql_nod* dsqlDelimiter;
-	jrd_nod* delimiter;
+	NestConst<jrd_nod> delimiter;
 };
 
 class CountAggNode : public AggNode
@@ -97,7 +97,7 @@
 	virtual void make(dsc* desc, dsql_nod* nullReplacement);
 	virtual void genBlr();
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier);
 
 	virtual void aggInit(thread_db* tdbb, jrd_req* request) const;
 	virtual void aggPass(thread_db* tdbb, jrd_req* request, dsc* desc) const;
@@ -116,7 +116,7 @@
 
 	virtual void make(dsc* desc, dsql_nod* nullReplacement);
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier);
 
 	virtual void aggInit(thread_db* tdbb, jrd_req* request) const;
 	virtual void aggPass(thread_db* tdbb, jrd_req* request, dsc* desc) const;
@@ -141,7 +141,7 @@
 
 	virtual void make(dsc* desc, dsql_nod* nullReplacement);
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier);
 
 	virtual void aggInit(thread_db* tdbb, jrd_req* request) const;
 	virtual void aggPass(thread_db* tdbb, jrd_req* request, dsc* desc) const;
Modified: firebird/trunk/src/dsql/ExprNodes.cpp
===================================================================
--- firebird/trunk/src/dsql/ExprNodes.cpp	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/src/dsql/ExprNodes.cpp	2010-08-09 15:48:51 UTC (rev 51418)
@@ -57,9 +57,15 @@
 		reinterpret_cast<ExprNode*>(node->nod_arg[0]) : NULL;
 }
 
-ExprNode* ExprNode::fromLegacy(const jrd_nod* node)
+const ExprNode* ExprNode::fromLegacy(const jrd_nod* node)
 {
 	return node->nod_type == nod_class_exprnode_jrd ?
+		reinterpret_cast<const ExprNode*>(node->nod_arg[0]) : NULL;
+}
+
+ExprNode* ExprNode::fromLegacy(jrd_nod* node)
+{
+	return node->nod_type == nod_class_exprnode_jrd ?
 		reinterpret_cast<ExprNode*>(node->nod_arg[0]) : NULL;
 }
 
@@ -111,14 +117,14 @@
 
 ExprNode* ExprNode::pass1(thread_db* tdbb, CompilerScratch* csb)
 {
-	for (jrd_nod*** i = jrdChildNodes.begin(); i != jrdChildNodes.end(); ++i)
+	for (NestConst<jrd_nod>** i = jrdChildNodes.begin(); i != jrdChildNodes.end(); ++i)
 		**i = CMP_pass1(tdbb, csb, **i);
 	return this;
 }
 
 ExprNode* ExprNode::pass2(thread_db* tdbb, CompilerScratch* csb)
 {
-	for (jrd_nod*** i = jrdChildNodes.begin(); i != jrdChildNodes.end(); ++i)
+	for (NestConst<jrd_nod>** i = jrdChildNodes.begin(); i != jrdChildNodes.end(); ++i)
 		**i = CMP_pass2(tdbb, csb, **i, node);
 	return this;
 }
@@ -127,7 +133,7 @@
 {
 	bool ret = false;
 
-	for (jrd_nod*** i = jrdChildNodes.begin(); i != jrdChildNodes.end(); ++i)
+	for (NestConst<jrd_nod>** i = jrdChildNodes.begin(); i != jrdChildNodes.end(); ++i)
 		ret |= visitor.visit(**i);
 
 	return ret;
@@ -203,7 +209,7 @@
 	DataTypeUtil(tdbb).makeConcatenate(desc, &desc1, &desc2);
 }
 
-ExprNode* ConcatenateNode::copy(thread_db* tdbb, NodeCopier& copier) const
+ExprNode* ConcatenateNode::copy(thread_db* tdbb, NodeCopier& copier)
 {
 	ConcatenateNode* node = FB_NEW(*tdbb->getDefaultPool()) ConcatenateNode(*tdbb->getDefaultPool());
 	node->arg1 = copier.copy(tdbb, arg1);
@@ -591,7 +597,7 @@
 	fb_assert(false);
 }
 
-ExprNode* OverNode::copy(thread_db* /*tdbb*/, NodeCopier& /*copier*/) const
+ExprNode* OverNode::copy(thread_db* /*tdbb*/, NodeCopier& /*copier*/)
 {
 	fb_assert(false);
 	return NULL;
@@ -687,7 +693,7 @@
 	CMP_get_desc(tdbb, csb, escape, &tempDesc);
 }
 
-ExprNode* SubstringSimilarNode::copy(thread_db* tdbb, NodeCopier& copier) const
+ExprNode* SubstringSimilarNode::copy(thread_db* tdbb, NodeCopier& copier)
 {
 	SubstringSimilarNode* node = FB_NEW(*tdbb->getDefaultPool()) SubstringSimilarNode(
 		*tdbb->getDefaultPool());
@@ -947,7 +953,7 @@
 		delete *pArgs;
 }
 
-ExprNode* SysFuncCallNode::copy(thread_db* tdbb, NodeCopier& copier) const
+ExprNode* SysFuncCallNode::copy(thread_db* tdbb, NodeCopier& copier)
 {
 	SysFuncCallNode* node = FB_NEW(*tdbb->getDefaultPool()) SysFuncCallNode(
 		*tdbb->getDefaultPool(), name);
@@ -1169,7 +1175,7 @@
 		desc->clear();
 }
 
-ExprNode* UdfCallNode::copy(thread_db* tdbb, NodeCopier& copier) const
+ExprNode* UdfCallNode::copy(thread_db* tdbb, NodeCopier& copier)
 {
 	UdfCallNode* node = FB_NEW(*tdbb->getDefaultPool()) UdfCallNode(*tdbb->getDefaultPool(), name);
 	node->args = copier.copy(tdbb, args);
Modified: firebird/trunk/src/dsql/ExprNodes.h
===================================================================
--- firebird/trunk/src/dsql/ExprNodes.h	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/src/dsql/ExprNodes.h	2010-08-09 15:48:51 UTC (rev 51418)
@@ -47,7 +47,7 @@
 	virtual void make(dsc* desc, dsql_nod* nullReplacement);
 
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier);
 	virtual ExprNode* pass2(thread_db* tdbb, CompilerScratch* csb);
 	virtual dsc* execute(thread_db* tdbb, jrd_req* request) const;
 
@@ -57,8 +57,8 @@
 public:
 	dsql_nod* dsqlArg1;
 	dsql_nod* dsqlArg2;
-	jrd_nod* arg1;
-	jrd_nod* arg2;
+	NestConst<jrd_nod> arg1;
+	NestConst<jrd_nod> arg2;
 };
 
 
@@ -83,7 +83,7 @@
 	virtual void make(dsc* desc, dsql_nod* nullReplacement);
 
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier);
 	virtual dsc* execute(thread_db* tdbb, jrd_req* request) const;
 
 protected:
@@ -112,7 +112,7 @@
 	virtual void make(dsc* desc, dsql_nod* nullReplacement);
 
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier);
 	virtual ExprNode* pass1(thread_db* tdbb, CompilerScratch* csb);
 	virtual ExprNode* pass2(thread_db* tdbb, CompilerScratch* csb);
 	virtual dsc* execute(thread_db* tdbb, jrd_req* request) const;
@@ -124,9 +124,9 @@
 	dsql_nod* dsqlExpr;
 	dsql_nod* dsqlPattern;
 	dsql_nod* dsqlEscape;
-	jrd_nod* expr;
-	jrd_nod* pattern;
-	jrd_nod* escape;
+	NestConst<jrd_nod> expr;
+	NestConst<jrd_nod> pattern;
+	NestConst<jrd_nod> escape;
 };
 
 
@@ -144,7 +144,7 @@
 	virtual void make(dsc* desc, dsql_nod* nullReplacement);
 
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier);
 	virtual bool dsqlMatch(const ExprNode* other, bool ignoreMapCast) const;
 	virtual ExprNode* pass2(thread_db* tdbb, CompilerScratch* csb);
 	virtual dsc* execute(thread_db* tdbb, jrd_req* request) const;
@@ -156,7 +156,7 @@
 	Firebird::MetaName name;
 	dsql_nod* dsqlArgs;
 	bool dsqlSpecialSyntax;
-	jrd_nod* args;
+	NestConst<jrd_nod> args;
 	const SysFunction* function;
 };
 
@@ -175,7 +175,7 @@
 	virtual void make(dsc* desc, dsql_nod* nullReplacement);
 
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc);
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier);
 	virtual bool dsqlMatch(const ExprNode* other, bool ignoreMapCast) const;
 	virtual ExprNode* pass1(thread_db* tdbb, CompilerScratch* csb);
 	virtual ExprNode* pass2(thread_db* tdbb, CompilerScratch* csb);
@@ -187,7 +187,7 @@
 public:
 	Firebird::QualifiedName name;
 	dsql_nod* dsqlArgs;
-	jrd_nod* args;
+	NestConst<jrd_nod> args;
 	/*const*/ Function* function;
 
 private:
Modified: firebird/trunk/src/dsql/Nodes.h
===================================================================
--- firebird/trunk/src/dsql/Nodes.h	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/src/dsql/Nodes.h	2010-08-09 15:48:51 UTC (rev 51418)
@@ -28,7 +28,7 @@
 #include "../dsql/node.h"
 #include "../dsql/Visitors.h"
 #include "../common/classes/array.h"
-//#include "../common/classes/ByteChunk.h"
+#include "../common/classes/NestConst.h"
 
 namespace Jrd {
 
@@ -199,7 +199,7 @@
 	virtual DmlNode* pass2(thread_db* tdbb, CompilerScratch* csb) = 0;
 
 protected:
-	jrd_nod* node;
+	NestConst<jrd_nod> node;
 };
 
 
@@ -273,7 +273,8 @@
 	}
 
 	static ExprNode* fromLegacy(const dsql_nod* node);
-	static ExprNode* fromLegacy(const jrd_nod* node);
+	static const ExprNode* fromLegacy(const jrd_nod* node);
+	static ExprNode* fromLegacy(jrd_nod* node);
 
 	virtual bool dsqlAggregateFinder(AggregateFinder& visitor)
 	{
@@ -341,7 +342,7 @@
 	virtual void make(dsc* desc, dsql_nod* nullReplacement) = 0;
 
 	virtual void getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc) = 0;
-	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) const = 0;
+	virtual ExprNode* copy(thread_db* tdbb, NodeCopier& copier) = 0;
 	virtual dsc* execute(thread_db* tdbb, jrd_req* request) const = 0;
 
 protected:
@@ -349,7 +350,7 @@
 	virtual bool dsqlVisit(NonConstDsqlNodeVisitor& visitor);
 	virtual bool jrdVisit(JrdNodeVisitor& visitor);
 
-	void addChildNode(dsql_nod*& dsqlNode, jrd_nod*& jrdNode)
+	void addChildNode(dsql_nod*& dsqlNode, NestConst<jrd_nod>& jrdNode)
 	{
 		dsqlChildNodes.add(&dsqlNode);
 		jrdChildNodes.add(&jrdNode);
@@ -364,7 +365,7 @@
 	const Type type;
 	const char* dsqlCompatDialectVerb;
 	Firebird::Array<dsql_nod**> dsqlChildNodes;
-	Firebird::Array<jrd_nod**> jrdChildNodes;
+	Firebird::Array<NestConst<jrd_nod>*> jrdChildNodes;
 };
 
 class AggNode : public TypedNode<ExprNode, ExprNode::TYPE_AGGREGATE>
@@ -487,7 +488,7 @@
 	bool distinct;
 	bool dialect1;
 	dsql_nod* dsqlArg;
-	jrd_nod* arg;
+	NestConst<jrd_nod> arg;
 	const AggregateSort* asb;
 	bool indexed;
 };
@@ -553,7 +554,7 @@
 	{
 	}
 
-	virtual jrd_nod* execute(thread_db* tdbb, jrd_req* request) const = 0;
+	virtual const jrd_nod* execute(thread_db* tdbb, jrd_req* request) const = 0;
 };
 
 
@@ -580,7 +581,7 @@
 		return this;
 	}
 
-	jrd_nod* execute(thread_db* /*tdbb*/, jrd_req* /*request*/) const
+	const jrd_nod* execute(thread_db* /*tdbb*/, jrd_req* /*request*/) const
 	{
 		fb_assert(false);
 		return NULL;
Modified: firebird/trunk/src/dsql/StmtNodes.cpp
===================================================================
--- firebird/trunk/src/dsql/StmtNodes.cpp	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/src/dsql/StmtNodes.cpp	2010-08-09 15:48:51 UTC (rev 51418)
@@ -441,7 +441,7 @@
 }
 
 
-jrd_nod* IfNode::execute(thread_db* tdbb, jrd_req* request) const
+const jrd_nod* IfNode::execute(thread_db* tdbb, jrd_req* request) const
 {
 	if (request->req_operation == jrd_req::req_evaluate)
 	{
@@ -530,7 +530,7 @@
 }
 
 
-jrd_nod* InAutonomousTransactionNode::execute(thread_db* tdbb, jrd_req* request) const
+const jrd_nod* InAutonomousTransactionNode::execute(thread_db* tdbb, jrd_req* request) const
 {
 	Jrd::Attachment* attachment = request->req_attachment;
 	SLONG* savNumber = request->getImpure<SLONG>(savNumberOffset);
@@ -1090,7 +1090,7 @@
 }
 
 
-jrd_nod* ExceptionNode::execute(thread_db* tdbb, jrd_req* request) const
+const jrd_nod* ExceptionNode::execute(thread_db* tdbb, jrd_req* request) const
 {
 	if (request->req_operation == jrd_req::req_evaluate)
 	{
@@ -1428,7 +1428,7 @@
 	return this;
 }
 
-jrd_nod* ForNode::execute(thread_db* tdbb, jrd_req* request) const
+const jrd_nod* ForNode::execute(thread_db* tdbb, jrd_req* request) const
 {
 	switch (request->req_operation)
 	{
@@ -1453,7 +1453,7 @@
 
 		case jrd_req::req_unwind:
 		{
-			jrd_nod* parent = node->nod_parent;
+			const jrd_nod* parent = node->nod_parent;
 
 			if (parent && parent->nod_type == nod_label &&
 				request->req_label == (USHORT)(IPTR) parent->nod_arg[e_lbl_label] &&
@@ -1549,7 +1549,7 @@
 }
 
 
-jrd_nod* PostEventNode::execute(thread_db* tdbb, jrd_req* request) const
+const jrd_nod* PostEventNode::execute(thread_db* tdbb, jrd_req* request) const
 {
 	jrd_tra* transaction = request->req_transaction;
 
@@ -1654,7 +1654,7 @@
 }
 
 
-jrd_nod* SavepointNode::execute(thread_db* tdbb, jrd_req* request) const
+const jrd_nod* SavepointNode::execute(thread_db* tdbb, jrd_req* request) const
 {
 	jrd_tra* transaction = request->req_transaction;
 
@@ -1833,7 +1833,7 @@
 
 
 // Execute a SEND statement.
-jrd_nod* SuspendNode::execute(thread_db* /*tdbb*/, jrd_req* request) const
+const jrd_nod* SuspendNode::execute(thread_db* /*tdbb*/, jrd_req* request) const
 {
 	switch (request->req_operation)
 	{
Modified: firebird/trunk/src/dsql/StmtNodes.h
===================================================================
--- firebird/trunk/src/dsql/StmtNodes.h	2010-08-09 14:50:11 UTC (rev 51417)
+++ firebird/trunk/src/dsql/StmtNodes.h	2010-08-09 15:48:51 UTC (rev 51418)
@@ -60,15 +60,15 @@
 	virtual void genBlr();
 	virtual IfNode* pass1(thread_db* tdbb, CompilerScratch* csb);
 	virtual IfNode* pass2(thread_db* tdbb, CompilerScratch* csb);
-	virtual jrd_nod* execute(thread_db* tdbb, jrd_req* request) const;
+	virtual const jrd_nod* execute(thread_db* tdbb, jrd_req* request) const;
 
 public:
 	dsql_nod* dsqlCondition;
 	dsql_nod* dsqlTrueAction;
 	dsql_nod* dsqlFalseAction;
-	jrd_nod* condition;
-	jrd_nod* trueAction;
-	jrd_nod* falseAction;
+	NestConst<jrd_nod> condition;
+	NestConst<jrd_nod> trueAction;
+	NestConst<jrd_nod> falseAction;
 };
 
 
@@ -94,11 +94,11 @@
 	virtual void genBlr();
 	virtual InAutonomousTransactionNode* pass1(thread_db* tdbb, CompilerScratch* csb);
 	virtual InAutonomousTransactionNode* pass2(thread_db* tdbb, CompilerScratch* csb);
-	virtual jrd_nod* execute(thread_db* tdbb, jrd_req* request) const;
+	virtual const jrd_nod* execute(thread_db* tdbb, jrd_req* request) const;
 
 public:
 	dsql_nod* dsqlAction;
-	jrd_nod* action;
+	NestConst<jrd_nod> action;
 	SLONG savNumberOffset;
 };
 
@@ -160,7 +160,7 @@
 	virtual void genBlr();
 	virtual ExceptionNode* pass1(thread_db* tdbb, CompilerScratch* csb);
 	virtual ExceptionNode* pass2(thread_db* tdbb, CompilerScratch* csb);
-	virtual jrd_nod* execute(thread_db* tdbb, jrd_req* request) const;
+	virtual const jrd_nod* execute(thread_db* tdbb, jrd_req* request) const;
 
 private:
 	void setError(thread_db* tdbb) const;
@@ -169,8 +169,8 @@
 	F...
 
[truncated message content] | 
| 
      
      
      From: <fir...@us...> - 2010-08-11 03:16:25
       | 
| Revision: 51430
          http://firebird.svn.sourceforge.net/firebird/?rev=51430&view=rev
Author:   firebirds
Date:     2010-08-11 03:16:18 +0000 (Wed, 11 Aug 2010)
Log Message:
-----------
nightly update
Modified Paths:
--------------
    firebird/trunk/ChangeLog
    firebird/trunk/src/jrd/build_no.h
    firebird/trunk/src/misc/writeBuildNum.sh
Modified: firebird/trunk/ChangeLog
===================================================================
--- firebird/trunk/ChangeLog	2010-08-11 02:59:33 UTC (rev 51429)
+++ firebird/trunk/ChangeLog	2010-08-11 03:16:18 UTC (rev 51430)
@@ -1,3 +1,36 @@
+ 2010-08-11 02:59  asfernandes 
+   M src/dsql/ExprNodes.cpp
+   M src/dsql/ExprNodes.h
+   M src/dsql/StmtNodes.cpp
+   M src/jrd/exe.h
+   M src/jrd/met.epp
+   M src/jrd/nod.h
+   M src/jrd/par.cpp
+Better internal handling of dependencies
+
+ 2010-08-10 15:20  asfernandes 
+   M src/dsql/DdlNodes.epp
+   M src/dsql/DdlNodes.h
+   M src/dsql/StmtNodes.h
+   M src/dsql/parse.y
+Misc
+
+ 2010-08-10 11:08  alexpeshkoff 
+   A mkChangeLog.sh
+BuildNum and ChangeLog generator
+
+ 2010-08-10 10:42  alexpeshkoff 
+   M src/misc/writeBuildNum.sh
+misc
+
+ 2010-08-10 07:49  alexpeshkoff 
+   M ChangeLog
+rolled back test change
+
+ 2010-08-10 07:31  firebirds 
+   M ChangeLog
+nightly update - test commit, please ignore
+
  2010-08-10 00:37  asfernandes 
    M src/dsql/DdlNodes.epp
    M src/jrd/btr.cpp
Modified: firebird/trunk/src/jrd/build_no.h
===================================================================
--- firebird/trunk/src/jrd/build_no.h	2010-08-11 02:59:33 UTC (rev 51429)
+++ firebird/trunk/src/jrd/build_no.h	2010-08-11 03:16:18 UTC (rev 51430)
@@ -3,16 +3,16 @@
                *** DO NOT EDIT ***
   TO CHANGE ANY INFORMATION IN HERE PLEASE
   EDIT src/misc/writeBuildNum.sh
-  FORMAL BUILD NUMBER:28669
+  FORMAL BUILD NUMBER:28675
 */
 
-#define PRODUCT_VER_STRING "3.0.0.28669"
-#define FILE_VER_STRING "WI-T3.0.0.28669"
-#define LICENSE_VER_STRING "WI-T3.0.0.28669"
-#define FILE_VER_NUMBER 3, 0, 0, 28669
+#define PRODUCT_VER_STRING "3.0.0.28675"
+#define FILE_VER_STRING "WI-T3.0.0.28675"
+#define LICENSE_VER_STRING "WI-T3.0.0.28675"
+#define FILE_VER_NUMBER 3, 0, 0, 28675
 #define FB_MAJOR_VER "3"
 #define FB_MINOR_VER "0"
 #define FB_REV_NO "0"
-#define FB_BUILD_NO "28669"
+#define FB_BUILD_NO "28675"
 #define FB_BUILD_TYPE "T"
 #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable"
Modified: firebird/trunk/src/misc/writeBuildNum.sh
===================================================================
--- firebird/trunk/src/misc/writeBuildNum.sh	2010-08-11 02:59:33 UTC (rev 51429)
+++ firebird/trunk/src/misc/writeBuildNum.sh	2010-08-11 03:16:18 UTC (rev 51430)
@@ -9,7 +9,7 @@
 MajorVer=3
 MinorVer=0
 RevNo=0
-BuildNum=28669
+BuildNum=28675
 
 if [ "$SPECIAL_BUILD_SUFFIX" = "" ]; then
 # Normal builds
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <fir...@us...> - 2010-08-12 03:13:33
       | 
| Revision: 51437
          http://firebird.svn.sourceforge.net/firebird/?rev=51437&view=rev
Author:   firebirds
Date:     2010-08-12 03:13:26 +0000 (Thu, 12 Aug 2010)
Log Message:
-----------
nightly update
Modified Paths:
--------------
    firebird/trunk/ChangeLog
    firebird/trunk/src/jrd/build_no.h
    firebird/trunk/src/misc/writeBuildNum.sh
Modified: firebird/trunk/ChangeLog
===================================================================
--- firebird/trunk/ChangeLog	2010-08-12 00:59:48 UTC (rev 51436)
+++ firebird/trunk/ChangeLog	2010-08-12 03:13:26 UTC (rev 51437)
@@ -1,3 +1,20 @@
+ 2010-08-12 00:59  asfernandes 
+   M src/dsql/ExprNodes.cpp
+   M src/jrd/JrdStatement.cpp
+   M src/jrd/JrdStatement.h
+   M src/jrd/exe.cpp
+   M src/jrd/exe.h
+More consts
+
+ 2010-08-11 15:33  asfernandes 
+   M src/common/classes/NestConst.h
+   M src/dsql/StmtNodes.h
+Misc
+
+ 2010-08-11 15:22  firebirds 
+   M src/misc/smallog.cpp
+make output in brnches better
+
  2010-08-11 02:59  asfernandes 
    M src/dsql/ExprNodes.cpp
    M src/dsql/ExprNodes.h
Modified: firebird/trunk/src/jrd/build_no.h
===================================================================
--- firebird/trunk/src/jrd/build_no.h	2010-08-12 00:59:48 UTC (rev 51436)
+++ firebird/trunk/src/jrd/build_no.h	2010-08-12 03:13:26 UTC (rev 51437)
@@ -3,16 +3,16 @@
                *** DO NOT EDIT ***
   TO CHANGE ANY INFORMATION IN HERE PLEASE
   EDIT src/misc/writeBuildNum.sh
-  FORMAL BUILD NUMBER:28675
+  FORMAL BUILD NUMBER:28678
 */
 
-#define PRODUCT_VER_STRING "3.0.0.28675"
-#define FILE_VER_STRING "WI-T3.0.0.28675"
-#define LICENSE_VER_STRING "WI-T3.0.0.28675"
-#define FILE_VER_NUMBER 3, 0, 0, 28675
+#define PRODUCT_VER_STRING "3.0.0.28678"
+#define FILE_VER_STRING "WI-T3.0.0.28678"
+#define LICENSE_VER_STRING "WI-T3.0.0.28678"
+#define FILE_VER_NUMBER 3, 0, 0, 28678
 #define FB_MAJOR_VER "3"
 #define FB_MINOR_VER "0"
 #define FB_REV_NO "0"
-#define FB_BUILD_NO "28675"
+#define FB_BUILD_NO "28678"
 #define FB_BUILD_TYPE "T"
 #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable"
Modified: firebird/trunk/src/misc/writeBuildNum.sh
===================================================================
--- firebird/trunk/src/misc/writeBuildNum.sh	2010-08-12 00:59:48 UTC (rev 51436)
+++ firebird/trunk/src/misc/writeBuildNum.sh	2010-08-12 03:13:26 UTC (rev 51437)
@@ -9,7 +9,7 @@
 MajorVer=3
 MinorVer=0
 RevNo=0
-BuildNum=28675
+BuildNum=28678
 
 if [ "$SPECIAL_BUILD_SUFFIX" = "" ]; then
 # Normal builds
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <fir...@us...> - 2010-08-13 03:16:40
       | 
| Revision: 51440
          http://firebird.svn.sourceforge.net/firebird/?rev=51440&view=rev
Author:   firebirds
Date:     2010-08-13 03:16:33 +0000 (Fri, 13 Aug 2010)
Log Message:
-----------
nightly update
Modified Paths:
--------------
    firebird/trunk/ChangeLog
    firebird/trunk/src/jrd/build_no.h
    firebird/trunk/src/misc/writeBuildNum.sh
Modified: firebird/trunk/ChangeLog
===================================================================
--- firebird/trunk/ChangeLog	2010-08-12 10:32:50 UTC (rev 51439)
+++ firebird/trunk/ChangeLog	2010-08-13 03:16:33 UTC (rev 51440)
@@ -1,3 +1,8 @@
+ 2010-08-12 10:32  robocop 
+   M src/jrd/exe.h
+   M src/jrd/par.cpp
+Misc.
+
  2010-08-12 00:59  asfernandes 
    M src/dsql/ExprNodes.cpp
    M src/jrd/JrdStatement.cpp
Modified: firebird/trunk/src/jrd/build_no.h
===================================================================
--- firebird/trunk/src/jrd/build_no.h	2010-08-12 10:32:50 UTC (rev 51439)
+++ firebird/trunk/src/jrd/build_no.h	2010-08-13 03:16:33 UTC (rev 51440)
@@ -3,16 +3,16 @@
                *** DO NOT EDIT ***
   TO CHANGE ANY INFORMATION IN HERE PLEASE
   EDIT src/misc/writeBuildNum.sh
-  FORMAL BUILD NUMBER:28678
+  FORMAL BUILD NUMBER:28679
 */
 
-#define PRODUCT_VER_STRING "3.0.0.28678"
-#define FILE_VER_STRING "WI-T3.0.0.28678"
-#define LICENSE_VER_STRING "WI-T3.0.0.28678"
-#define FILE_VER_NUMBER 3, 0, 0, 28678
+#define PRODUCT_VER_STRING "3.0.0.28679"
+#define FILE_VER_STRING "WI-T3.0.0.28679"
+#define LICENSE_VER_STRING "WI-T3.0.0.28679"
+#define FILE_VER_NUMBER 3, 0, 0, 28679
 #define FB_MAJOR_VER "3"
 #define FB_MINOR_VER "0"
 #define FB_REV_NO "0"
-#define FB_BUILD_NO "28678"
+#define FB_BUILD_NO "28679"
 #define FB_BUILD_TYPE "T"
 #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable"
Modified: firebird/trunk/src/misc/writeBuildNum.sh
===================================================================
--- firebird/trunk/src/misc/writeBuildNum.sh	2010-08-12 10:32:50 UTC (rev 51439)
+++ firebird/trunk/src/misc/writeBuildNum.sh	2010-08-13 03:16:33 UTC (rev 51440)
@@ -9,7 +9,7 @@
 MajorVer=3
 MinorVer=0
 RevNo=0
-BuildNum=28678
+BuildNum=28679
 
 if [ "$SPECIAL_BUILD_SUFFIX" = "" ]; then
 # Normal builds
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <fir...@us...> - 2010-08-14 03:14:23
       | 
| Revision: 51447
          http://firebird.svn.sourceforge.net/firebird/?rev=51447&view=rev
Author:   firebirds
Date:     2010-08-14 03:14:17 +0000 (Sat, 14 Aug 2010)
Log Message:
-----------
nightly update
Modified Paths:
--------------
    firebird/trunk/ChangeLog
    firebird/trunk/src/jrd/build_no.h
    firebird/trunk/src/misc/writeBuildNum.sh
Modified: firebird/trunk/ChangeLog
===================================================================
--- firebird/trunk/ChangeLog	2010-08-13 15:22:00 UTC (rev 51446)
+++ firebird/trunk/ChangeLog	2010-08-14 03:14:17 UTC (rev 51447)
@@ -1,3 +1,28 @@
+ 2010-08-13 15:22  asfernandes 
+   M src/common/classes/NestConst.h
+   M src/jrd/ExtEngineManager.cpp
+   M src/jrd/ExtEngineManager.h
+   M src/jrd/Function.h
+   M src/jrd/ValuesImpl.h
+   M src/jrd/cmp.cpp
+   M src/jrd/cmp_proto.h
+   M src/jrd/exe.h
+   M src/jrd/jrd.h
+   M src/jrd/met.epp
+   M src/jrd/par.cpp
+   M src/jrd/recsrc/ProcedureScan.cpp
+   M src/jrd/recsrc/RecordSource.cpp
+   M src/jrd/recsrc/RecordSource.h
+More consts
+
+ 2010-08-13 09:37  firebirds 
+   M mkChangeLog.sh
+per-branch consts
+
+ 2010-08-13 08:41  firebirds 
+   M src/misc/smallog.cpp
+Better handling of commits to be skipped
+
  2010-08-12 10:32  robocop 
    M src/jrd/exe.h
    M src/jrd/par.cpp
@@ -49,10 +74,6 @@
    M ChangeLog
 rolled back test change
 
- 2010-08-10 07:31  firebirds 
-   M ChangeLog
-nightly update - test commit, please ignore
-
  2010-08-10 00:37  asfernandes 
    M src/dsql/DdlNodes.epp
    M src/jrd/btr.cpp
Modified: firebird/trunk/src/jrd/build_no.h
===================================================================
--- firebird/trunk/src/jrd/build_no.h	2010-08-13 15:22:00 UTC (rev 51446)
+++ firebird/trunk/src/jrd/build_no.h	2010-08-14 03:14:17 UTC (rev 51447)
@@ -3,16 +3,16 @@
                *** DO NOT EDIT ***
   TO CHANGE ANY INFORMATION IN HERE PLEASE
   EDIT src/misc/writeBuildNum.sh
-  FORMAL BUILD NUMBER:28679
+  FORMAL BUILD NUMBER:28681
 */
 
-#define PRODUCT_VER_STRING "3.0.0.28679"
-#define FILE_VER_STRING "WI-T3.0.0.28679"
-#define LICENSE_VER_STRING "WI-T3.0.0.28679"
-#define FILE_VER_NUMBER 3, 0, 0, 28679
+#define PRODUCT_VER_STRING "3.0.0.28681"
+#define FILE_VER_STRING "WI-T3.0.0.28681"
+#define LICENSE_VER_STRING "WI-T3.0.0.28681"
+#define FILE_VER_NUMBER 3, 0, 0, 28681
 #define FB_MAJOR_VER "3"
 #define FB_MINOR_VER "0"
 #define FB_REV_NO "0"
-#define FB_BUILD_NO "28679"
+#define FB_BUILD_NO "28681"
 #define FB_BUILD_TYPE "T"
 #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable"
Modified: firebird/trunk/src/misc/writeBuildNum.sh
===================================================================
--- firebird/trunk/src/misc/writeBuildNum.sh	2010-08-13 15:22:00 UTC (rev 51446)
+++ firebird/trunk/src/misc/writeBuildNum.sh	2010-08-14 03:14:17 UTC (rev 51447)
@@ -9,7 +9,7 @@
 MajorVer=3
 MinorVer=0
 RevNo=0
-BuildNum=28679
+BuildNum=28681
 
 if [ "$SPECIAL_BUILD_SUFFIX" = "" ]; then
 # Normal builds
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <fir...@us...> - 2010-08-16 03:14:09
       | 
| Revision: 51451
          http://firebird.svn.sourceforge.net/firebird/?rev=51451&view=rev
Author:   firebirds
Date:     2010-08-16 03:14:03 +0000 (Mon, 16 Aug 2010)
Log Message:
-----------
nightly update
Modified Paths:
--------------
    firebird/trunk/ChangeLog
    firebird/trunk/src/jrd/build_no.h
    firebird/trunk/src/misc/writeBuildNum.sh
Modified: firebird/trunk/ChangeLog
===================================================================
--- firebird/trunk/ChangeLog	2010-08-16 01:47:24 UTC (rev 51450)
+++ firebird/trunk/ChangeLog	2010-08-16 03:14:03 UTC (rev 51451)
@@ -1,3 +1,7 @@
+ 2010-08-16 01:47  asfernandes 
+   M src/misc/blrtable.cpp
+Fix wrong nod_type of scrollable cursors
+
  2010-08-13 15:22  asfernandes 
    M src/common/classes/NestConst.h
    M src/jrd/ExtEngineManager.cpp
Modified: firebird/trunk/src/jrd/build_no.h
===================================================================
--- firebird/trunk/src/jrd/build_no.h	2010-08-16 01:47:24 UTC (rev 51450)
+++ firebird/trunk/src/jrd/build_no.h	2010-08-16 03:14:03 UTC (rev 51451)
@@ -3,16 +3,16 @@
                *** DO NOT EDIT ***
   TO CHANGE ANY INFORMATION IN HERE PLEASE
   EDIT src/misc/writeBuildNum.sh
-  FORMAL BUILD NUMBER:28681
+  FORMAL BUILD NUMBER:28682
 */
 
-#define PRODUCT_VER_STRING "3.0.0.28681"
-#define FILE_VER_STRING "WI-T3.0.0.28681"
-#define LICENSE_VER_STRING "WI-T3.0.0.28681"
-#define FILE_VER_NUMBER 3, 0, 0, 28681
+#define PRODUCT_VER_STRING "3.0.0.28682"
+#define FILE_VER_STRING "WI-T3.0.0.28682"
+#define LICENSE_VER_STRING "WI-T3.0.0.28682"
+#define FILE_VER_NUMBER 3, 0, 0, 28682
 #define FB_MAJOR_VER "3"
 #define FB_MINOR_VER "0"
 #define FB_REV_NO "0"
-#define FB_BUILD_NO "28681"
+#define FB_BUILD_NO "28682"
 #define FB_BUILD_TYPE "T"
 #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable"
Modified: firebird/trunk/src/misc/writeBuildNum.sh
===================================================================
--- firebird/trunk/src/misc/writeBuildNum.sh	2010-08-16 01:47:24 UTC (rev 51450)
+++ firebird/trunk/src/misc/writeBuildNum.sh	2010-08-16 03:14:03 UTC (rev 51451)
@@ -9,7 +9,7 @@
 MajorVer=3
 MinorVer=0
 RevNo=0
-BuildNum=28681
+BuildNum=28682
 
 if [ "$SPECIAL_BUILD_SUFFIX" = "" ]; then
 # Normal builds
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <asf...@us...> - 2010-08-24 04:10:38
       | 
| Revision: 51464
          http://firebird.svn.sourceforge.net/firebird/?rev=51464&view=rev
Author:   asfernandes
Date:     2010-08-24 03:25:01 +0000 (Tue, 24 Aug 2010)
Log Message:
-----------
Refactor nod_rse, nod_relation, nod_procedure, nod_union, nod_aggregate and nod_window.
Modified Paths:
--------------
    firebird/trunk/builds/posix/make.shared.variables
    firebird/trunk/builds/win32/msvc10/engine.vcxproj
    firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj
    firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj.filters
    firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj
    firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj.filters
    firebird/trunk/builds/win32/msvc9/engine.vcproj
    firebird/trunk/builds/win32/msvc9/engine_classic.vcproj
    firebird/trunk/builds/win32/msvc9/engine_embed.vcproj
    firebird/trunk/src/dsql/ExprNodes.cpp
    firebird/trunk/src/dsql/Nodes.h
    firebird/trunk/src/dsql/StmtNodes.cpp
    firebird/trunk/src/dsql/StmtNodes.h
    firebird/trunk/src/dsql/Visitors.h
    firebird/trunk/src/jrd/Attachment.h
    firebird/trunk/src/jrd/Optimizer.cpp
    firebird/trunk/src/jrd/Optimizer.h
    firebird/trunk/src/jrd/Relation.h
    firebird/trunk/src/jrd/cmp.cpp
    firebird/trunk/src/jrd/cmp_proto.h
    firebird/trunk/src/jrd/exe.cpp
    firebird/trunk/src/jrd/exe.h
    firebird/trunk/src/jrd/jrd.h
    firebird/trunk/src/jrd/lls.h
    firebird/trunk/src/jrd/met.epp
    firebird/trunk/src/jrd/nod.h
    firebird/trunk/src/jrd/opt.cpp
    firebird/trunk/src/jrd/opt_proto.h
    firebird/trunk/src/jrd/par.cpp
    firebird/trunk/src/jrd/par_proto.h
    firebird/trunk/src/jrd/recsrc/RecordSource.h
    firebird/trunk/src/jrd/recsrc/Union.cpp
    firebird/trunk/src/misc/blrtable.cpp
Added Paths:
-----------
    firebird/trunk/src/jrd/RecordSourceNodes.cpp
    firebird/trunk/src/jrd/RecordSourceNodes.h
Modified: firebird/trunk/builds/posix/make.shared.variables
===================================================================
--- firebird/trunk/builds/posix/make.shared.variables	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/builds/posix/make.shared.variables	2010-08-24 03:25:01 UTC (rev 51464)
@@ -42,7 +42,7 @@
 		svc.cpp SysFunction.cpp TempSpace.cpp tpc.cpp tra.cpp validation.cpp \
 		ValueImpl.cpp ValuesImpl.cpp vio.cpp \
 		nodebug.cpp nbak.cpp $(Physical_IO_Module) TextType.cpp \
-		unicode_util.cpp RuntimeStatistics.cpp DebugInterface.cpp \
+		unicode_util.cpp RecordSourceNodes.cpp RuntimeStatistics.cpp DebugInterface.cpp \
 		extds/ExtDS.cpp extds/InternalDS.cpp extds/IscDS.cpp \
 		trace/TraceConfigStorage.cpp trace/TraceLog.cpp \
 		trace/TraceManager.cpp trace/TraceObjects.cpp \
Modified: firebird/trunk/builds/win32/msvc10/engine.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine.vcxproj	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/builds/win32/msvc10/engine.vcxproj	2010-08-24 03:25:01 UTC (rev 51464)
@@ -221,6 +221,7 @@
     <ClCompile Include="..\..\..\src\jrd\PreparedStatement.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RandomGenerator.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RecordBuffer.cpp" />
+    <ClCompile Include="..\..\..\src\jrd\RecordSourceNodes.cpp" />
     <ClCompile Include="..\..\..\src\jrd\Relation.cpp" />
     <ClCompile Include="..\..\..\src\jrd\ResultSet.cpp" />
     <ClCompile Include="..\..\..\src\jrd\rlck.cpp" />
@@ -427,6 +428,7 @@
     <ClInclude Include="..\..\..\src\jrd\que.h" />
     <ClInclude Include="..\..\..\src\jrd\RandomGenerator.h" />
     <ClInclude Include="..\..\..\src\jrd\RecordBuffer.h" />
+    <ClInclude Include="..\..\..\src\jrd\RecordSourceNodes.h" />
     <ClInclude Include="..\..\..\src\jrd\recsrc\RecordSource.h" />
     <ClInclude Include="..\..\..\src\jrd\Relation.h" />
     <ClInclude Include="..\..\..\src\jrd\relations.h" />
Modified: firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters	2010-08-24 03:25:01 UTC (rev 51464)
@@ -240,6 +240,9 @@
     <ClCompile Include="..\..\..\src\jrd\RecordBuffer.cpp">
       <Filter>JRD files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\src\jrd\RecordSourceNodes.cpp">
+      <Filter>JRD files</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\src\jrd\Relation.cpp">
       <Filter>JRD files</Filter>
     </ClCompile>
@@ -854,6 +857,9 @@
     <ClInclude Include="..\..\..\src\jrd\RecordBuffer.h">
       <Filter>Header files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\jrd\RecordSourceNodes.h">
+      <Filter>Header files</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\src\jrd\recsrc\RecordSource.h">
       <Filter>Header files</Filter>
     </ClInclude>
Modified: firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj	2010-08-24 03:25:01 UTC (rev 51464)
@@ -221,6 +221,7 @@
     <ClCompile Include="..\..\..\src\jrd\PreparedStatement.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RandomGenerator.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RecordBuffer.cpp" />
+    <ClCompile Include="..\..\..\src\jrd\RecordSourceNodes.cpp" />
     <ClCompile Include="..\..\..\src\jrd\Relation.cpp" />
     <ClCompile Include="..\..\..\src\jrd\ResultSet.cpp" />
     <ClCompile Include="..\..\..\src\jrd\rlck.cpp" />
@@ -427,6 +428,7 @@
     <ClInclude Include="..\..\..\src\jrd\que.h" />
     <ClInclude Include="..\..\..\src\jrd\RandomGenerator.h" />
     <ClInclude Include="..\..\..\src\jrd\RecordBuffer.h" />
+    <ClInclude Include="..\..\..\src\jrd\RecordSourceNodes.h" />
     <ClInclude Include="..\..\..\src\jrd\recsrc\RecordSource.h" />
     <ClInclude Include="..\..\..\src\jrd\Relation.h" />
     <ClInclude Include="..\..\..\src\jrd\relations.h" />
Modified: firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj.filters
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj.filters	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/builds/win32/msvc10/engine_classic.vcxproj.filters	2010-08-24 03:25:01 UTC (rev 51464)
@@ -240,6 +240,9 @@
     <ClCompile Include="..\..\..\src\jrd\RecordBuffer.cpp">
       <Filter>JRD files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\src\jrd\RecordSourceNodes.cpp">
+      <Filter>JRD files</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\src\jrd\Relation.cpp">
       <Filter>JRD files</Filter>
     </ClCompile>
@@ -854,6 +857,9 @@
     <ClInclude Include="..\..\..\src\jrd\RecordBuffer.h">
       <Filter>Header files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\jrd\RecordSourceNodes.h">
+      <Filter>Header files</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\src\jrd\recsrc\RecordSource.h">
       <Filter>Header files</Filter>
     </ClInclude>
Modified: firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj	2010-08-24 03:25:01 UTC (rev 51464)
@@ -221,6 +221,7 @@
     <ClCompile Include="..\..\..\src\jrd\PreparedStatement.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RandomGenerator.cpp" />
     <ClCompile Include="..\..\..\src\jrd\RecordBuffer.cpp" />
+    <ClCompile Include="..\..\..\src\jrd\RecordSourceNodes.cpp" />
     <ClCompile Include="..\..\..\src\jrd\Relation.cpp" />
     <ClCompile Include="..\..\..\src\jrd\ResultSet.cpp" />
     <ClCompile Include="..\..\..\src\jrd\rlck.cpp" />
@@ -427,6 +428,7 @@
     <ClInclude Include="..\..\..\src\jrd\que.h" />
     <ClInclude Include="..\..\..\src\jrd\RandomGenerator.h" />
     <ClInclude Include="..\..\..\src\jrd\RecordBuffer.h" />
+    <ClInclude Include="..\..\..\src\jrd\RecordSourceNodes.h" />
     <ClInclude Include="..\..\..\src\jrd\recsrc\RecordSource.h" />
     <ClInclude Include="..\..\..\src\jrd\Relation.h" />
     <ClInclude Include="..\..\..\src\jrd\relations.h" />
Modified: firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj.filters
===================================================================
--- firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj.filters	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/builds/win32/msvc10/engine_embed.vcxproj.filters	2010-08-24 03:25:01 UTC (rev 51464)
@@ -240,6 +240,9 @@
     <ClCompile Include="..\..\..\src\jrd\RecordBuffer.cpp">
       <Filter>JRD files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\..\src\jrd\RecordSourceNodes.cpp">
+      <Filter>JRD files</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\..\src\jrd\Relation.cpp">
       <Filter>JRD files</Filter>
     </ClCompile>
@@ -857,6 +860,9 @@
     <ClInclude Include="..\..\..\src\jrd\recsrc\RecordSource.h">
       <Filter>Header files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\..\src\jrd\RecordSourceNodes.h">
+      <Filter>Header files</Filter>
+    </ClInclude>
     <ClInclude Include="..\..\..\src\jrd\Relation.h">
       <Filter>Header files</Filter>
     </ClInclude>
Modified: firebird/trunk/builds/win32/msvc9/engine.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/engine.vcproj	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/builds/win32/msvc9/engine.vcproj	2010-08-24 03:25:01 UTC (rev 51464)
@@ -572,6 +572,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\jrd\RecordSourceNodes.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\jrd\Relation.cpp"
 				>
 			</File>
@@ -1392,6 +1396,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\jrd\RecordSourceNodes.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\jrd\recsrc\RecordSource.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc9/engine_classic.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/engine_classic.vcproj	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/builds/win32/msvc9/engine_classic.vcproj	2010-08-24 03:25:01 UTC (rev 51464)
@@ -572,6 +572,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\jrd\RecordSourceNodes.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\jrd\Relation.cpp"
 				>
 			</File>
@@ -1392,6 +1396,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\jrd\RecordSourceNodes.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\jrd\recsrc\RecordSource.h"
 				>
 			</File>
Modified: firebird/trunk/builds/win32/msvc9/engine_embed.vcproj
===================================================================
--- firebird/trunk/builds/win32/msvc9/engine_embed.vcproj	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/builds/win32/msvc9/engine_embed.vcproj	2010-08-24 03:25:01 UTC (rev 51464)
@@ -572,6 +572,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\jrd\RecordSourceNodes.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\jrd\Relation.cpp"
 				>
 			</File>
@@ -1392,6 +1396,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\src\jrd\RecordSourceNodes.h"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\src\jrd\recsrc\RecordSource.h"
 				>
 			</File>
Modified: firebird/trunk/src/dsql/ExprNodes.cpp
===================================================================
--- firebird/trunk/src/dsql/ExprNodes.cpp	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/src/dsql/ExprNodes.cpp	2010-08-24 03:25:01 UTC (rev 51464)
@@ -709,7 +709,7 @@
 
 	// We need to take care of invariantness expressions to be able to pre-compile the pattern.
 	node->nod_flags |= nod_invariant;
-	csb->csb_current_nodes.push(node);
+	csb->csb_current_nodes.push(node.getObject());
 
 	pattern = CMP_pass1(tdbb, csb, pattern);
 	escape = CMP_pass1(tdbb, csb, escape);
@@ -721,11 +721,11 @@
 	if ((node->nod_flags & nod_invariant) &&
 		(pattern->nod_type != nod_literal || escape->nod_type != nod_literal))
 	{
-		const jrd_node_base* const* ctx_node, *const *end;
+		const LegacyNodeOrRseNode* ctx_node, *end;
 		for (ctx_node = csb->csb_current_nodes.begin(), end = csb->csb_current_nodes.end();
-			 ctx_node < end; ctx_node++)
+			 ctx_node != end; ++ctx_node)
 		{
-			if ((*ctx_node)->nod_type == nod_rse)
+			if (ctx_node->rseNode)
 				break;
 		}
 
Modified: firebird/trunk/src/dsql/Nodes.h
===================================================================
--- firebird/trunk/src/dsql/Nodes.h	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/src/dsql/Nodes.h	2010-08-24 03:25:01 UTC (rev 51464)
@@ -38,7 +38,7 @@
 class dsql_nod;
 class ExprNode;
 class jrd_nod;
-class RecordSelExpr;
+class RseNode;
 class SlidingWindow;
 class TypeClause;
 
@@ -550,7 +550,7 @@
 	}
 
 public:
-	virtual void pass2Cursor(RecordSelExpr*& /*rsePtr*/, Cursor**& /*cursorPtr*/)
+	virtual void pass2Cursor(RseNode*& /*rsePtr*/, Cursor**& /*cursorPtr*/)
 	{
 	}
 
Modified: firebird/trunk/src/dsql/StmtNodes.cpp
===================================================================
--- firebird/trunk/src/dsql/StmtNodes.cpp	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/src/dsql/StmtNodes.cpp	2010-08-24 03:25:01 UTC (rev 51464)
@@ -26,6 +26,7 @@
 #include "../dsql/node.h"
 #include "../jrd/blr.h"
 #include "../jrd/tra.h"
+#include "../jrd/RecordSourceNodes.h"
 #include "../jrd/recsrc/Cursor.h"
 #include "../jrd/cmp_proto.h"
 #include "../jrd/dfw_proto.h"
@@ -1291,10 +1292,10 @@
 		csb->csb_blr_reader.peekByte() == (UCHAR) blr_singular ||
 		csb->csb_blr_reader.peekByte() == (UCHAR) blr_scrollable)
 	{
-		node->rse = PAR_parse_node(tdbb, csb, TYPE_RSE);
+		node->rse = RseNode::getFrom(PAR_parse_node(tdbb, csb, TYPE_RSE));
 	}
 	else
-		node->rse = PAR_rse(tdbb, csb, blrOp);
+		node->rse = RseNode::getFrom(PAR_rse(tdbb, csb, blrOp));
 
 	node->statement = PAR_parse_node(tdbb, csb, STATEMENT);
 
@@ -1414,7 +1415,7 @@
 StmtNode* ForNode::pass1(thread_db* tdbb, CompilerScratch* csb)
 {
 	stall = CMP_pass1(tdbb, csb, stall);
-	rse = CMP_pass1(tdbb, csb, rse);
+	rse->pass1(tdbb, csb, csb->csb_view);
 	statement = CMP_pass1(tdbb, csb, statement);
 	return this;
 }
@@ -1422,7 +1423,7 @@
 StmtNode* ForNode::pass2(thread_db* tdbb, CompilerScratch* csb)
 {
 	stall = CMP_pass2(tdbb, csb, stall, node);
-	rse = CMP_pass2(tdbb, csb, rse, node);
+	rse->pass2(tdbb, csb);
 	statement = CMP_pass2(tdbb, csb, statement, node);
 	return this;
 }
Modified: firebird/trunk/src/dsql/StmtNodes.h
===================================================================
--- firebird/trunk/src/dsql/StmtNodes.h	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/src/dsql/StmtNodes.h	2010-08-24 03:25:01 UTC (rev 51464)
@@ -220,9 +220,9 @@
 	virtual StmtNode* pass1(thread_db* tdbb, CompilerScratch* csb);
 	virtual StmtNode* pass2(thread_db* tdbb, CompilerScratch* csb);
 
-	virtual void pass2Cursor(RecordSelExpr*& rsePtr, Cursor**& cursorPtr)
+	virtual void pass2Cursor(RseNode*& rsePtr, Cursor**& cursorPtr)
 	{
-		rsePtr = reinterpret_cast<RecordSelExpr*>(static_cast<jrd_nod*>(rse));
+		rsePtr = rse;
 		cursorPtr = cursor.getAddress();
 	}
 
@@ -236,7 +236,7 @@
 	dsql_nod* dsqlLabel;
 	bool dsqlForceSingular;
 	NestConst<jrd_nod> stall;
-	NestConst<jrd_nod> rse;
+	NestConst<RseNode> rse;
 	NestConst<jrd_nod> statement;
 	NestConst<Cursor> cursor;
 };
Modified: firebird/trunk/src/dsql/Visitors.h
===================================================================
--- firebird/trunk/src/dsql/Visitors.h	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/src/dsql/Visitors.h	2010-08-24 03:25:01 UTC (rev 51464)
@@ -427,7 +427,7 @@
 
 	virtual USHORT getFieldId(jrd_nod* input);
 
-protected:
+public:
 	CompilerScratch* csb;
 	UCHAR* remap;
 	jrd_nod* message;
Modified: firebird/trunk/src/jrd/Attachment.h
===================================================================
--- firebird/trunk/src/jrd/Attachment.h	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/src/jrd/Attachment.h	2010-08-24 03:25:01 UTC (rev 51464)
@@ -65,7 +65,6 @@
 	class IndexLock;
 	class ArrayField;
 	struct sort_context;
-	class RecordSelExpr;
 	class vcl;
 	class TextType;
 	class Parameter;
Modified: firebird/trunk/src/jrd/Optimizer.cpp
===================================================================
--- firebird/trunk/src/jrd/Optimizer.cpp	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/src/jrd/Optimizer.cpp	2010-08-24 03:25:01 UTC (rev 51464)
@@ -36,6 +36,7 @@
 #include "../jrd/rse.h"
 #include "../jrd/ods.h"
 #include "../jrd/Optimizer.h"
+#include "../jrd/RecordSourceNodes.h"
 #include "../jrd/recsrc/RecordSource.h"
 #include "../dsql/ExprNodes.h"
 #include "../dsql/StmtNodes.h"
@@ -89,44 +90,17 @@
 	DEV_BLKCHK(csb, type_csb);
 	DEV_BLKCHK(node, type_nod);
 
-	if (node->nod_flags & nod_deoptimize) {
+	if (node->nod_flags & nod_deoptimize)
 		return false;
-	}
 
 	// Recurse thru interesting sub-nodes
 
 	switch (node->nod_type)
 	{
-		case nod_procedure:
-		{
-			jrd_nod* inputs = node->nod_arg[e_prc_inputs];
-			if (inputs)
-			{
-				fb_assert(inputs->nod_type == nod_asn_list);
-				jrd_nod* const* ptr = inputs->nod_arg;
-				for (const jrd_nod* const* const end = ptr + inputs->nod_count; ptr < end; ptr++)
-				{
-					if (!OPT_computable(csb, *ptr, stream, idx_use, allowOnlyCurrentStream)) {
-						return false;
-					}
-				}
-			}
-			break;
-		}
+		case nod_class_recsrcnode_jrd:
+			return reinterpret_cast<RecordSourceNode*>(node->nod_arg[0])->computable(
+				csb, stream, idx_use, allowOnlyCurrentStream, NULL);
 
-		case nod_union:
-		{
-			jrd_nod* clauses = node->nod_arg[e_uni_clauses];
-			jrd_nod* const* ptr = clauses->nod_arg;
-			for (const jrd_nod* const* const end = ptr + clauses->nod_count; ptr < end; ptr += 2)
-			{
-				if (!OPT_computable(csb, *ptr, stream, idx_use, allowOnlyCurrentStream)) {
-					return false;
-				}
-			}
-			break;
-		}
-
 		case nod_class_exprnode_jrd:
 		{
 			ExprNode* exprNode = reinterpret_cast<ExprNode*>(node->nod_arg[0]);
@@ -146,17 +120,13 @@
 			jrd_nod* const* ptr = node->nod_arg;
 			for (const jrd_nod* const* const end = ptr + node->nod_count; ptr < end; ptr++)
 			{
-				if (!OPT_computable(csb, *ptr, stream, idx_use, allowOnlyCurrentStream)) {
+				if (!OPT_computable(csb, *ptr, stream, idx_use, allowOnlyCurrentStream))
 					return false;
-				}
 			}
 			break;
 		}
 	}
 
-	RecordSelExpr* rse;
-	jrd_nod* sub;
-	jrd_nod* value;
 	USHORT n;
 
 	switch (node->nod_type)
@@ -166,15 +136,12 @@
 		if (allowOnlyCurrentStream)
 		{
 			if (n != stream && !(csb->csb_rpt[n].csb_flags & csb_sub_stream))
-			{
 				return false;
-			}
 		}
 		else
 		{
-			if (n == stream) {
+			if (n == stream)
 				return false;
-			}
 		}
 		return csb->csb_rpt[n].csb_flags & csb_active;
 
@@ -225,115 +192,24 @@
 	case nod_total:
 	case nod_count:
 	case nod_from:
-		if ((sub = node->nod_arg[e_stat_default]) &&
-			!OPT_computable(csb, sub, stream, idx_use, allowOnlyCurrentStream))
 		{
-			return false;
-		}
-		rse = (RecordSelExpr*) node->nod_arg[e_stat_rse];
-		value = node->nod_arg[e_stat_value];
-		break;
+			jrd_nod* sub;
 
-	case nod_rse:
-		rse = (RecordSelExpr*) node;
-		value = NULL;
-		break;
-
-	case nod_aggregate:
-		rse = (RecordSelExpr*) node->nod_arg[e_agg_rse];
-		rse->rse_sorted = node->nod_arg[e_agg_group];
-		value = NULL;
-		break;
-
-	case nod_window:
-		rse = (RecordSelExpr*) node->nod_arg[e_win_rse];
-		value = NULL;
-		break;
-
-	default:
-		return true;
-	}
-
-	// Node is a record selection expression.
-	bool result = true;
-
-	if ((sub = rse->rse_first) && !OPT_computable(csb, sub, stream, idx_use, allowOnlyCurrentStream)) {
-		return false;
-	}
-
-    if ((sub = rse->rse_skip) && !OPT_computable(csb, sub, stream, idx_use, allowOnlyCurrentStream)) {
-        return false;
-	}
-
-	// Set sub-streams of rse active
-	jrd_nod* const* ptr;
-	const jrd_nod* const* end;
-
-	for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++)
-	{
-		const jrd_nod* const node = *ptr;
-
-		if (node->nod_type == nod_window)
-		{
-			const jrd_nod* windows = node->nod_arg[e_win_windows];
-
-			for (unsigned i = 0; i < windows->nod_count; ++i)
+			if ((sub = node->nod_arg[e_stat_default]) &&
+				!OPT_computable(csb, sub, stream, idx_use, allowOnlyCurrentStream))
 			{
-				n = (USHORT)(IPTR) windows->nod_arg[i]->nod_arg[e_part_stream];
-				csb->csb_rpt[n].csb_flags |= (csb_active | csb_sub_stream);
+				return false;
 			}
-		}
-		else if (node->nod_type != nod_rse)
-		{
-			n = (USHORT)(IPTR) node->nod_arg[STREAM_INDEX(node)];
-			csb->csb_rpt[n].csb_flags |= (csb_active | csb_sub_stream);
-		}
-	}
 
-	// Check sub-stream
-	if (((sub = rse->rse_boolean) && !OPT_computable(csb, sub, stream, idx_use, allowOnlyCurrentStream)) ||
-	    ((sub = rse->rse_sorted) && !OPT_computable(csb, sub, stream, idx_use, allowOnlyCurrentStream)) ||
-	    ((sub = rse->rse_projection) && !OPT_computable(csb, sub, stream, idx_use, allowOnlyCurrentStream)))
-	{
-		result = false;
-	}
+			fb_assert(node->nod_arg[e_stat_rse]->nod_type == nod_class_recsrcnode_jrd);
+			RseNode* rse = reinterpret_cast<RseNode*>(node->nod_arg[e_stat_rse]->nod_arg[0]);
 
-	for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end && result; ptr++)
-	{
-		if (!OPT_computable(csb, (*ptr), stream, idx_use, allowOnlyCurrentStream))
-		{
-			result = false;
+			return rse->computable(csb, stream, idx_use, allowOnlyCurrentStream,
+				node->nod_arg[e_stat_value]);
 		}
 	}
 
-	// Check value expression, if any
-	if (result && value && !OPT_computable(csb, value, stream, idx_use, allowOnlyCurrentStream)) {
-		result = false;
-	}
-
-	// Reset streams inactive
-	for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++)
-	{
-		const jrd_nod* const node = *ptr;
-
-		if (node->nod_type == nod_window)
-		{
-			const jrd_nod* windows = node->nod_arg[e_win_windows];
-
-			for (unsigned i = 0; i < windows->nod_count; ++i)
-			{
-				n = (USHORT)(IPTR) windows->nod_arg[i]->nod_arg[e_part_stream];
-				csb->csb_rpt[n].csb_flags &= ~(csb_active | csb_sub_stream);
-			}
-		}
-		else if (node->nod_type != nod_rse)
-		{
-			n = (USHORT)(IPTR) (*ptr)->nod_arg[STREAM_INDEX((*ptr))];
-			csb->csb_rpt[n].csb_flags &= ~(csb_active | csb_sub_stream);
-		}
-	}
-
-	return result;
+	return true;
 }
 
 
@@ -1067,6 +943,7 @@
 	return OPT_make_binary_node(node_type, node1, node2, false);
 }
 
+
 void OptimizerRetrieval::findDependentFromStreams(jrd_nod* node, SortedStreamList* streamList) const
 {
 /**************************************
@@ -1081,30 +958,8 @@
 
 	// Recurse thru interesting sub-nodes
 
-	if (node->nod_type == nod_procedure)
+	if (node->nod_type == nod_class_exprnode_jrd)
 	{
-		jrd_nod* const inputs = node->nod_arg[e_prc_inputs];
-		if (inputs)
-		{
-			fb_assert(inputs->nod_type == nod_asn_list);
-			jrd_nod* const* ptr = inputs->nod_arg;
-			for (const jrd_nod* const* const end = ptr + inputs->nod_count; ptr < end; ptr++)
-			{
-				findDependentFromStreams(*ptr, streamList);
-			}
-		}
-	}
-	else if (node->nod_type == nod_union)
-	{
-		jrd_nod* const clauses = node->nod_arg[e_uni_clauses];
-		jrd_nod* const* ptr = clauses->nod_arg;
-		for (const jrd_nod* const* const end = ptr + clauses->nod_count; ptr < end; ptr += 2)
-		{
-			findDependentFromStreams(*ptr, streamList);
-		}
-	}
-	else if (node->nod_type == nod_class_exprnode_jrd)
-	{
 		ExprNode* exprNode = reinterpret_cast<ExprNode*>(node->nod_arg[0]);
 
 		for (NestConst<NestConst<jrd_nod> >* i = exprNode->jrdChildNodes.begin();
@@ -1113,19 +968,19 @@
 			findDependentFromStreams(**i, streamList);
 		}
 	}
+	else if (node->nod_type == nod_class_recsrcnode_jrd)
+	{
+		reinterpret_cast<RecordSourceNode*>(node->nod_arg[0])->findDependentFromStreams(
+			this, streamList);
+	}
 	else
 	{
 		jrd_nod* const* ptr = node->nod_arg;
+
 		for (const jrd_nod* const* const end = ptr + node->nod_count; ptr < end; ptr++)
-		{
 			findDependentFromStreams(*ptr, streamList);
-		}
 	}
 
-	RecordSelExpr* rse;
-	jrd_nod* sub;
-	jrd_nod* value;
-
 	switch (node->nod_type)
 	{
 		case nod_field:
@@ -1136,9 +991,8 @@
 				(csb->csb_rpt[fieldStream].csb_flags & csb_active) &&
 				!(csb->csb_rpt[fieldStream].csb_flags & csb_trigger))
 			{
-				if (!streamList->exist(fieldStream)) {
+				if (!streamList->exist(fieldStream))
 					streamList->add(fieldStream);
-				}
 			}
 			return;
 		}
@@ -1180,67 +1034,26 @@
 		case nod_total:
 		case nod_count:
 		case nod_from:
-			if (sub = node->nod_arg[e_stat_default]) {
+		{
+			jrd_nod* sub;
+
+			if (sub = node->nod_arg[e_stat_default])
 				findDependentFromStreams(sub, streamList);
-			}
-			rse = (RecordSelExpr*) node->nod_arg[e_stat_rse];
-			value = node->nod_arg[e_stat_value];
-			break;
 
-		case nod_rse:
-			rse = (RecordSelExpr*) node;
-			value = NULL;
-			break;
+			fb_assert(node->nod_arg[e_stat_rse]->nod_type == nod_class_recsrcnode_jrd);
+			RseNode* rse = reinterpret_cast<RseNode*>(node->nod_arg[e_stat_rse]->nod_arg[0]);
 
-		case nod_aggregate:
-			rse = (RecordSelExpr*) node->nod_arg[e_agg_rse];
-			rse->rse_sorted = node->nod_arg[e_agg_group];
-			value = NULL;
-			break;
+			rse->findDependentFromStreams(this, streamList);
 
-		case nod_window:
-			rse = (RecordSelExpr*) node->nod_arg[e_win_rse];
-			value = NULL;
-			break;
+			jrd_nod* value = node->nod_arg[e_stat_value];
 
-		default:
-			return;
-	}
+			// Check value expression, if any
+			if (value)
+				findDependentFromStreams(value, streamList);
 
-	// Node is a record selection expression.
-	if (sub = rse->rse_first) {
-		findDependentFromStreams(sub, streamList);
+			break;
+		}
 	}
-
-    if (sub = rse->rse_skip) {
-        findDependentFromStreams(sub, streamList);
-	}
-
-	if (sub = rse->rse_boolean) {
-		findDependentFromStreams(sub, streamList);
-	}
-
-	if (sub = rse->rse_sorted) {
-		findDependentFromStreams(sub, streamList);
-	}
-
-	if (sub = rse->rse_projection) {
-		findDependentFromStreams(sub, streamList);
-	}
-
-	jrd_nod* const* ptr;
-	const jrd_nod* const* end;
-	for (ptr = rse->rse_relation, end = ptr + rse->rse_count; ptr < end; ptr++)
-	{
-		findDependentFromStreams(*ptr, streamList);
-	}
-
-	// Check value expression, if any
-	if (value) {
-		findDependentFromStreams(value, streamList);
-	}
-
-	return;
 }
 
 const string& OptimizerRetrieval::getAlias()
Modified: firebird/trunk/src/jrd/Optimizer.h
===================================================================
--- firebird/trunk/src/jrd/Optimizer.h	2010-08-24 03:15:58 UTC (rev 51463)
+++ firebird/trunk/src/jrd/Optimizer.h	2010-08-24 03:25:01 UTC (rev 51464)
@@ -80,24 +80,6 @@
 Firebird::string OPT_make_alias(thread_db*, const CompilerScratch*, const CompilerScratch::csb_repeat*);
 jrd_nod* OPT_make_binary_node(nod_t, jrd_nod*, jrd_nod*, bool);
 
-inline int STREAM_INDEX(const jrd_nod* node)
-{
-	switch (node->nod_type)
-	{
-		case nod_relation:
-			return e_rel_stream;
-		case nod_procedure:
-			return e_prc_stream;
-		case nod_union:
-			return e_uni_stream;
-		case nod_aggregate:
-			return e_agg_stream;
-		default:
-			fb_assert(false);
-			return 0; // silence compiler warning.
-	}
-}
-
 enum segmentScanType {
 	segmentScanNone,
 	segmentScanGreater,
@@ -146,8 +128,6 @@
 	Firebird::Array<IndexScratchSegment*> segments;
 };
 
-typedef Firebird::SortedArray<int> SortedStreamList;
-
 class InversionCandidate
 {
 public:
@@ -182,9 +162,10 @@
 	InversionCandidate* getCost();
 	InversionCandidate* getInversion(IndexTableScan** rsb);
 
+	void findDependentFromStreams(jrd_nod* node, SortedStreamList* streamList) const;
+
 protected:
 	jrd_nod* composeInversion(jrd_nod* node1, jrd_nod* node2, nod_t node_type) const;
-	void findDependentFromStreams(jrd_nod* node, SortedStreamList* streamList) const;
 	const Firebird::string& getAlias();
 	InversionCandidate* generateInversion(IndexTableScan** rsb);
 	IndexTableScan* generateNavigation();
Added: firebird/trunk/src/jrd/RecordSourceNodes.cpp
===================================================================
--- firebird/trunk/src/jrd/RecordSourceNodes.cpp	                        (rev 0)
+++ firebird/trunk/src/jrd/RecordSourceNodes.cpp	2010-08-24 03:25:01 UTC (rev 51464)
@@ -0,0 +1,2444 @@
+/*
+ * The contents of this file are subject to the Interbase Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy
+ * of the License at http://www.Inprise.com/IPL.html
+ *
+ * Software distributed under the License is distributed on an
+ * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * The Original Code was created by Inprise Corporation
+ * and its predecessors. Portions created by Inprise Corporation are
+ * Copyright (C) Inprise Corporation.
+ *
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ * Adriano dos Santos Fernandes
+ */
+
+#include "firebird.h"
+#include "../jrd/common.h"
+#include "../jrd/align.h"
+#include "../jrd/RecordSourceNodes.h"
+#include "../jrd/DataTypeUtil.h"
+#include "../jrd/Optimizer.h"
+#include "../jrd/recsrc/RecordSource.h"
+#include "../jrd/btr_proto.h"
+#include "../jrd/cmp_proto.h"
+#include "../jrd/dbg_proto.h"
+#include "../jrd/dsc_proto.h"
+#include "../jrd/met_proto.h"
+#include "../jrd/opt_proto.h"
+#include "../jrd/par_proto.h"
+
+using namespace Firebird;
+using namespace Jrd;
+
+
+static jrd_nod* parseMap(thread_db* tdbb, CompilerScratch* csb, USHORT stream);
+static SSHORT strcmpSpace(const char* p, const char* q);
+static void processSource(thread_db* tdbb, CompilerScra...
 
[truncated message content] | 
| 
      
      
      From: <fir...@us...> - 2010-08-25 03:15:31
       | 
| Revision: 51474
          http://firebird.svn.sourceforge.net/firebird/?rev=51474&view=rev
Author:   firebirds
Date:     2010-08-25 03:15:25 +0000 (Wed, 25 Aug 2010)
Log Message:
-----------
nightly update
Modified Paths:
--------------
    firebird/trunk/ChangeLog
    firebird/trunk/src/jrd/build_no.h
    firebird/trunk/src/misc/writeBuildNum.sh
Modified: firebird/trunk/ChangeLog
===================================================================
--- firebird/trunk/ChangeLog	2010-08-25 03:10:12 UTC (rev 51473)
+++ firebird/trunk/ChangeLog	2010-08-25 03:15:25 UTC (rev 51474)
@@ -1,3 +1,73 @@
+ 2010-08-25 01:35  asfernandes 
+   M src/jrd/RecordSourceNodes.cpp
+   M src/jrd/RecordSourceNodes.h
+   M src/jrd/opt.cpp
+Misc
+
+ 2010-08-25 01:01  asfernandes 
+   M src/jrd/RecordSourceNodes.cpp
+Remove do-nothing checks from the new file
+
+ 2010-08-25 00:42  asfernandes 
+   M src/jrd/cmp.cpp
+   M src/jrd/met.epp
+Misc
+
+ 2010-08-24 17:49  dimitr 
+   M src/jrd/opt.cpp
+Refactored the rivers management a bit.
+
+ 2010-08-24 16:26  asfernandes 
+   M src/jrd/cmp.cpp
+Correction
+
+ 2010-08-24 11:58  dimitr 
+   M src/dsql/ExprNodes.cpp
+Fixed incomplete processing of UDF arguments, causing server crashes.
+
+ 2010-08-24 08:27  firebirds 
+   M mkChangeLog.sh
+Fixed correct buildno in 2.5
+
+ 2010-08-24 03:25  asfernandes 
+   M builds/posix/make.shared.variables
+   M builds/win32/msvc10/engine.vcxproj
+   M builds/win32/msvc10/engine.vcxproj.filters
+   M builds/win32/msvc10/engine_classic.vcxproj
+   M builds/win32/msvc10/engine_classic.vcxproj.filters
+   M builds/win32/msvc10/engine_embed.vcxproj
+   M builds/win32/msvc10/engine_embed.vcxproj.filters
+   M builds/win32/msvc9/engine.vcproj
+   M builds/win32/msvc9/engine_classic.vcproj
+   M builds/win32/msvc9/engine_embed.vcproj
+   M src/dsql/ExprNodes.cpp
+   M src/dsql/Nodes.h
+   M src/dsql/StmtNodes.cpp
+   M src/dsql/StmtNodes.h
+   M src/dsql/Visitors.h
+   M src/jrd/Attachment.h
+   M src/jrd/Optimizer.cpp
+   M src/jrd/Optimizer.h
+   A src/jrd/RecordSourceNodes.cpp
+   A src/jrd/RecordSourceNodes.h
+   M src/jrd/Relation.h
+   M src/jrd/cmp.cpp
+   M src/jrd/cmp_proto.h
+   M src/jrd/exe.cpp
+   M src/jrd/exe.h
+   M src/jrd/jrd.h
+   M src/jrd/lls.h
+   M src/jrd/met.epp
+   M src/jrd/nod.h
+   M src/jrd/opt.cpp
+   M src/jrd/opt_proto.h
+   M src/jrd/par.cpp
+   M src/jrd/par_proto.h
+   M src/jrd/recsrc/RecordSource.h
+   M src/jrd/recsrc/Union.cpp
+   M src/misc/blrtable.cpp
+Refactor nod_rse, nod_relation, nod_procedure, nod_union, nod_aggregate and nod_window.
+
  2010-08-16 01:47  asfernandes 
    M src/misc/blrtable.cpp
 Fix wrong nod_type of scrollable cursors
Modified: firebird/trunk/src/jrd/build_no.h
===================================================================
--- firebird/trunk/src/jrd/build_no.h	2010-08-25 03:10:12 UTC (rev 51473)
+++ firebird/trunk/src/jrd/build_no.h	2010-08-25 03:15:25 UTC (rev 51474)
@@ -3,16 +3,16 @@
                *** DO NOT EDIT ***
   TO CHANGE ANY INFORMATION IN HERE PLEASE
   EDIT src/misc/writeBuildNum.sh
-  FORMAL BUILD NUMBER:28682
+  FORMAL BUILD NUMBER:28690
 */
 
-#define PRODUCT_VER_STRING "3.0.0.28682"
-#define FILE_VER_STRING "WI-T3.0.0.28682"
-#define LICENSE_VER_STRING "WI-T3.0.0.28682"
-#define FILE_VER_NUMBER 3, 0, 0, 28682
+#define PRODUCT_VER_STRING "3.0.0.28690"
+#define FILE_VER_STRING "WI-T3.0.0.28690"
+#define LICENSE_VER_STRING "WI-T3.0.0.28690"
+#define FILE_VER_NUMBER 3, 0, 0, 28690
 #define FB_MAJOR_VER "3"
 #define FB_MINOR_VER "0"
 #define FB_REV_NO "0"
-#define FB_BUILD_NO "28682"
+#define FB_BUILD_NO "28690"
 #define FB_BUILD_TYPE "T"
 #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable"
Modified: firebird/trunk/src/misc/writeBuildNum.sh
===================================================================
--- firebird/trunk/src/misc/writeBuildNum.sh	2010-08-25 03:10:12 UTC (rev 51473)
+++ firebird/trunk/src/misc/writeBuildNum.sh	2010-08-25 03:15:25 UTC (rev 51474)
@@ -9,7 +9,7 @@
 MajorVer=3
 MinorVer=0
 RevNo=0
-BuildNum=28682
+BuildNum=28690
 
 if [ "$SPECIAL_BUILD_SUFFIX" = "" ]; then
 # Normal builds
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <fir...@us...> - 2010-08-26 03:14:21
       | 
| Revision: 51483
          http://firebird.svn.sourceforge.net/firebird/?rev=51483&view=rev
Author:   firebirds
Date:     2010-08-26 03:14:14 +0000 (Thu, 26 Aug 2010)
Log Message:
-----------
nightly update
Modified Paths:
--------------
    firebird/trunk/ChangeLog
    firebird/trunk/src/jrd/build_no.h
    firebird/trunk/src/misc/writeBuildNum.sh
Modified: firebird/trunk/ChangeLog
===================================================================
--- firebird/trunk/ChangeLog	2010-08-25 15:52:46 UTC (rev 51482)
+++ firebird/trunk/ChangeLog	2010-08-26 03:14:14 UTC (rev 51483)
@@ -1,3 +1,39 @@
+ 2010-08-25 15:52  asfernandes 
+   M src/jrd/RecordSourceNodes.cpp
+   M src/jrd/RecordSourceNodes.h
+   M src/jrd/exe.h
+   M src/jrd/recsrc/RecordSource.h
+   M src/jrd/recsrc/WindowedStream.cpp
+Rework WindowSourceNode to use type-safe partitions
+
+ 2010-08-25 13:36  mapopa 
+   M doc/README.build.msvc.html
+Added links to visual c++ studio 2008 
+
+ 2010-08-25 13:25  mapopa 
+   M doc/README.build.msvc.html
+Added unicode/classic innosetup note (we are not using unicode version for the moment , only for 3.0 maybe in the future)
+
+ 2010-08-25 12:00  mapopa 
+   M doc/README.build.msvc.html
+added innosetup 5 to the build instructions 
+
+ 2010-08-25 10:16  mapopa 
+   M doc/README.build.msvc.html
+added sed instructions 
+
+ 2010-08-25 08:02  dimitr 
+   M src/jrd/cmp.cpp
+Fixed a few suspicious places related to the variable cloning.
+
+ 2010-08-25 03:10  asfernandes 
+   M src/jrd/RecordSourceNodes.cpp
+   M src/jrd/RecordSourceNodes.h
+   M src/jrd/exe.h
+   M src/jrd/opt.cpp
+   M src/jrd/rse.h
+Move dozen of parameters of virtual/overriden function to OptimizerBlk
+
  2010-08-25 01:35  asfernandes 
    M src/jrd/RecordSourceNodes.cpp
    M src/jrd/RecordSourceNodes.h
Modified: firebird/trunk/src/jrd/build_no.h
===================================================================
--- firebird/trunk/src/jrd/build_no.h	2010-08-25 15:52:46 UTC (rev 51482)
+++ firebird/trunk/src/jrd/build_no.h	2010-08-26 03:14:14 UTC (rev 51483)
@@ -3,16 +3,16 @@
                *** DO NOT EDIT ***
   TO CHANGE ANY INFORMATION IN HERE PLEASE
   EDIT src/misc/writeBuildNum.sh
-  FORMAL BUILD NUMBER:28690
+  FORMAL BUILD NUMBER:28697
 */
 
-#define PRODUCT_VER_STRING "3.0.0.28690"
-#define FILE_VER_STRING "WI-T3.0.0.28690"
-#define LICENSE_VER_STRING "WI-T3.0.0.28690"
-#define FILE_VER_NUMBER 3, 0, 0, 28690
+#define PRODUCT_VER_STRING "3.0.0.28697"
+#define FILE_VER_STRING "WI-T3.0.0.28697"
+#define LICENSE_VER_STRING "WI-T3.0.0.28697"
+#define FILE_VER_NUMBER 3, 0, 0, 28697
 #define FB_MAJOR_VER "3"
 #define FB_MINOR_VER "0"
 #define FB_REV_NO "0"
-#define FB_BUILD_NO "28690"
+#define FB_BUILD_NO "28697"
 #define FB_BUILD_TYPE "T"
 #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable"
Modified: firebird/trunk/src/misc/writeBuildNum.sh
===================================================================
--- firebird/trunk/src/misc/writeBuildNum.sh	2010-08-25 15:52:46 UTC (rev 51482)
+++ firebird/trunk/src/misc/writeBuildNum.sh	2010-08-26 03:14:14 UTC (rev 51483)
@@ -9,7 +9,7 @@
 MajorVer=3
 MinorVer=0
 RevNo=0
-BuildNum=28690
+BuildNum=28697
 
 if [ "$SPECIAL_BUILD_SUFFIX" = "" ]; then
 # Normal builds
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <asf...@us...> - 2010-08-27 02:18:09
       | 
| Revision: 51488
          http://firebird.svn.sourceforge.net/firebird/?rev=51488&view=rev
Author:   asfernandes
Date:     2010-08-27 02:18:00 +0000 (Fri, 27 Aug 2010)
Log Message:
-----------
1) Separate DsqlCompilerScratch in its own files.
2) Move BlockNode functionality to it.
3) Move some related CTE functions to it.
Modified Paths:
--------------
    firebird/trunk/builds/posix/make.shared.variables
    firebird/trunk/src/dsql/DSqlDataTypeUtil.cpp
    firebird/trunk/src/dsql/DdlNodes.epp
    firebird/trunk/src/dsql/DdlNodes.h
    firebird/trunk/src/dsql/Nodes.h
    firebird/trunk/src/dsql/StmtNodes.cpp
    firebird/trunk/src/dsql/StmtNodes.h
    firebird/trunk/src/dsql/dsql.h
    firebird/trunk/src/dsql/gen.cpp
    firebird/trunk/src/dsql/misc_func.cpp
    firebird/trunk/src/dsql/pass1.cpp
    firebird/trunk/src/dsql/pass1_proto.h
Added Paths:
-----------
    firebird/trunk/src/dsql/DsqlCompilerScratch.cpp
    firebird/trunk/src/dsql/DsqlCompilerScratch.h
Modified: firebird/trunk/builds/posix/make.shared.variables
===================================================================
--- firebird/trunk/builds/posix/make.shared.variables	2010-08-26 15:40:51 UTC (rev 51487)
+++ firebird/trunk/builds/posix/make.shared.variables	2010-08-27 02:18:00 UTC (rev 51488)
@@ -81,7 +81,8 @@
 DSQL_ServerFiles=	metd.epp DSqlDataTypeUtil.cpp \
                 ddl.cpp dsql.cpp errd.cpp gen.cpp hsh.cpp make.cpp \
 	            movd.cpp parse.cpp Parser.cpp pass1.cpp misc_func.cpp \
-	            DdlNodes.epp PackageNodes.epp AggNodes.cpp BlrWriter.cpp ExprNodes.cpp StmtNodes.cpp WinNodes.cpp
+	            DdlNodes.epp PackageNodes.epp AggNodes.cpp BlrWriter.cpp DsqlCompilerScratch.cpp \
+	            ExprNodes.cpp StmtNodes.cpp WinNodes.cpp
 
 
 DSQL_Files = $(DSQL_ClientFiles) $(DSQL_ServerFiles)
Modified: firebird/trunk/src/dsql/DSqlDataTypeUtil.cpp
===================================================================
--- firebird/trunk/src/dsql/DSqlDataTypeUtil.cpp	2010-08-26 15:40:51 UTC (rev 51487)
+++ firebird/trunk/src/dsql/DSqlDataTypeUtil.cpp	2010-08-27 02:18:00 UTC (rev 51488)
@@ -24,7 +24,7 @@
 
 #include "firebird.h"
 #include "../dsql/DSqlDataTypeUtil.h"
-#include "../dsql/dsql.h"
+#include "../dsql/DsqlCompilerScratch.h"
 #include "../dsql/metd_proto.h"
 
 UCHAR Jrd::DSqlDataTypeUtil::maxBytesPerChar(UCHAR charSet)
Modified: firebird/trunk/src/dsql/DdlNodes.epp
===================================================================
--- firebird/trunk/src/dsql/DdlNodes.epp	2010-08-26 15:40:51 UTC (rev 51487)
+++ firebird/trunk/src/dsql/DdlNodes.epp	2010-08-27 02:18:00 UTC (rev 51488)
@@ -1157,8 +1157,6 @@
 
 DdlNode* CreateAlterFunctionNode::internalDsqlPass()
 {
-	DsqlCompiledStatement* const statement = dsqlScratch->getStatement();
-	statement->setBlockNode(this);
 	dsqlScratch->flags |= (DsqlCompilerScratch::FLAG_BLOCK | DsqlCompilerScratch::FLAG_FUNCTION);
 
 	const dsql_nod* variables = localDeclList;
@@ -1488,7 +1486,6 @@
 	unsigned pos, const ParameterClause& parameter)
 {
 	Attachment* attachment = transaction->getAttachment();
-	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
 
 	AutoCacheRequest requestHandle(tdbb, drq_s_func_args2, DYN_REQUESTS);
 
@@ -1591,7 +1588,7 @@
 
 			dsqlScratch->getBlrData().clear();
 
-			if (statement->getFlags() & DsqlCompiledStatement::FLAG_BLR_VERSION4)
+			if (dsqlScratch->isVersion4())
 				dsqlScratch->appendUChar(blr_version4);
 			else
 				dsqlScratch->appendUChar(blr_version5);
@@ -1618,14 +1615,12 @@
 	compiled = true;
 	invalid = true;
 
-	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
-
 	if (body)
 	{
 		dsqlScratch->beginDebug();
 		dsqlScratch->getBlrData().clear();
 
-		if (statement->getFlags() & DsqlCompiledStatement::FLAG_BLR_VERSION4)
+		if (dsqlScratch->isVersion4())
 			dsqlScratch->appendUChar(blr_version4);
 		else
 			dsqlScratch->appendUChar(blr_version5);
@@ -1650,7 +1645,7 @@
 				dsqlScratch->appendUChar(blr_short);
 				dsqlScratch->appendUChar(0);
 
-				variables.add(MAKE_variable(parameter.legacyField,
+				dsqlScratch->variables.add(MAKE_variable(parameter.legacyField,
 					parameter.name.c_str(), VAR_input, 0, (USHORT) (2 * i), 0));
 			}
 		}
@@ -1667,8 +1662,8 @@
 		dsqlScratch->appendUChar(0);
 
 		dsql_nod* const var = MAKE_variable(returnType.legacyField, "", VAR_output, 1, 0, 0);
-		variables.add(var);
-		outputVariables.add(var);
+		dsqlScratch->variables.add(var);
+		dsqlScratch->outputVariables.add(var);
 
 		if (parameters.getCount() != 0)
 		{
@@ -1695,14 +1690,15 @@
 			}
 		}
 
-		dsql_var* const variable = (dsql_var*) outputVariables[0]->nod_arg[Dsql::e_var_variable];
-		putLocalVariable(dsqlScratch, variable, 0, NULL);
+		dsql_var* const variable =
+			(dsql_var*) dsqlScratch->outputVariables[0]->nod_arg[Dsql::e_var_variable];
+		dsqlScratch->putLocalVariable(variable, 0, NULL);
 
 		// ASF: This is here to not change the old logic (proc_flag)
 		// of previous calls to PASS1_node and PASS1_statement.
 		dsqlScratch->setPsql(true);
 
-		putLocalVariables(dsqlScratch, localDeclList, 1);
+		dsqlScratch->putLocalVariables(localDeclList, 1);
 
 		dsqlScratch->appendUChar(blr_stall);
 		// put a label before body of procedure,
@@ -1714,10 +1710,9 @@
 
 		GEN_statement(dsqlScratch, PASS1_statement(dsqlScratch, body));
 
-		statement->setType(DsqlCompiledStatement::TYPE_DDL);
+		dsqlScratch->getStatement()->setType(DsqlCompiledStatement::TYPE_DDL);
 		dsqlScratch->appendUChar(blr_end);
-		genReturn(dsqlScratch, false);
-
+		dsqlScratch->genReturn(false);
 		dsqlScratch->appendUChar(blr_end);
 		dsqlScratch->appendUChar(blr_eoc);
 
@@ -1902,8 +1897,6 @@
 
 DdlNode* CreateAlterProcedureNode::internalDsqlPass()
 {
-	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
-	statement->setBlockNode(this);
 	dsqlScratch->flags |= (DsqlCompilerScratch::FLAG_BLOCK | DsqlCompilerScratch::FLAG_PROCEDURE);
 
 	const dsql_nod* variables = localDeclList;
@@ -2340,11 +2333,9 @@
 			string defaultSource = string(defaultString->str_data, defaultString->str_length);
 			attachment->storeMetaDataBlob(tdbb, transaction, &PRM.RDB$DEFAULT_SOURCE, defaultSource);
 
-			DsqlCompiledStatement* statement = dsqlScratch->getStatement();
-
 			dsqlScratch->getBlrData().clear();
 
-			if (statement->getFlags() & DsqlCompiledStatement::FLAG_BLR_VERSION4)
+			if (dsqlScratch->isVersion4())
 				dsqlScratch->appendUChar(blr_version4);
 			else
 				dsqlScratch->appendUChar(blr_version5);
@@ -2375,12 +2366,10 @@
 
 	invalid = true;
 
-	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
-
 	dsqlScratch->beginDebug();
 	dsqlScratch->getBlrData().clear();
 
-	if (statement->getFlags() & DsqlCompiledStatement::FLAG_BLR_VERSION4)
+	if (dsqlScratch->isVersion4())
 		dsqlScratch->appendUChar(blr_version4);
 	else
 		dsqlScratch->appendUChar(blr_version5);
@@ -2404,7 +2393,7 @@
 			dsqlScratch->appendUChar(blr_short);
 			dsqlScratch->appendUChar(0);
 
-			variables.add(MAKE_variable(parameter.legacyField,
+			dsqlScratch->variables.add(MAKE_variable(parameter.legacyField,
 				parameter.name.c_str(), VAR_input, 0, (USHORT) (2 * i), 0));
 		}
 	}
@@ -2429,8 +2418,8 @@
 			dsql_nod* const var = MAKE_variable(parameter.legacyField,
 				parameter.name.c_str(), VAR_output, 1, (USHORT) (2 * i), i);
 
-			variables.add(var);
-			outputVariables.add(var);
+			dsqlScratch->variables.add(var);
+			dsqlScratch->outputVariables.add(var);
 		}
 	}
 
@@ -2463,18 +2452,20 @@
 		}
 	}
 
-	for (Array<dsql_nod*>::const_iterator i = outputVariables.begin(); i != outputVariables.end(); ++i)
+	for (Array<dsql_nod*>::const_iterator i = dsqlScratch->outputVariables.begin();
+		 i != dsqlScratch->outputVariables.end();
+		 ++i)
 	{
 		dsql_nod* parameter = *i;
 		dsql_var* const variable = (dsql_var*) parameter->nod_arg[Dsql::e_var_variable];
-		putLocalVariable(dsqlScratch, variable, 0, NULL);
+		dsqlScratch->putLocalVariable(variable, 0, NULL);
 	}
 
 	// ASF: This is here to not change the old logic (proc_flag)
 	// of previous calls to PASS1_node and PASS1_statement.
 	dsqlScratch->setPsql(true);
 
-	putLocalVariables(dsqlScratch, localDeclList, returns.getCount());
+	dsqlScratch->putLocalVariables(localDeclList, returns.getCount());
 
 	dsqlScratch->appendUChar(blr_stall);
 	// put a label before body of procedure,
@@ -2486,10 +2477,9 @@
 
 	GEN_statement(dsqlScratch, PASS1_statement(dsqlScratch, body));
 
-	statement->setType(DsqlCompiledStatement::TYPE_DDL);
+	dsqlScratch->getStatement()->setType(DsqlCompiledStatement::TYPE_DDL);
 	dsqlScratch->appendUChar(blr_end);
-	genReturn(dsqlScratch, true);
-
+	dsqlScratch->genReturn(true);
 	dsqlScratch->appendUChar(blr_end);
 	dsqlScratch->appendUChar(blr_eoc);
 
@@ -2779,8 +2769,6 @@
 
 DdlNode* CreateAlterTriggerNode::internalDsqlPass()
 {
-	DsqlCompiledStatement* statement = dsqlScratch->getStatement();
-	statement->setBlockNode(this);
 	dsqlScratch->flags |= (DsqlCompilerScratch::FLAG_BLOCK | DsqlCompilerScratch::FLAG_TRIGGER);
 
 	if (type.specified)
@@ -2876,8 +2864,6 @@
 
 	if (body)
 	{
-		DsqlCompiledStatement* statement = dsqlScratch->getStatement();
-
 		dsqlScratch->beginDebug();
 		dsqlScratch->getBlrData().clear();
 
@@ -2921,7 +2907,7 @@
 
 		// generate the trigger blr
 
-		if (statement->getFlags() & DsqlCompiledStatement::FLAG_BLR_VERSION4)
+		if (dsqlScratch->isVersion4())
 			dsqlScratch->appendUChar(blr_version4);
 		else
 			dsqlScratch->appendUChar(blr_version5);
@@ -2929,9 +2915,8 @@
 		dsqlScratch->appendUChar(blr_begin);
 
 		dsqlScratch->setPsql(true);
+		dsqlScratch->putLocalVariables(localDeclList, 0);
 
-		putLocalVariables(dsqlScratch, localDeclList, 0);
-
 		dsqlScratch->scopeLevel++;
 		// dimitr: I see no reason to deny EXIT command in triggers,
 		// hence I've added zero label at the beginning.
@@ -2954,7 +2939,7 @@
 		// The statement type may have been set incorrectly when parsing
 		// the trigger actions, so reset it to reflect the fact that this
 		// is a data definition statement; also reset the ddl node.
-		statement->setType(DsqlCompiledStatement::TYPE_DDL);
+		dsqlScratch->getStatement()->setType(DsqlCompiledStatement::TYPE_DDL);
 	}
 
 	invalid = false;
Modified: firebird/trunk/src/dsql/DdlNodes.h
===================================================================
--- firebird/trunk/src/dsql/DdlNodes.h	2010-08-26 15:40:51 UTC (rev 51487)
+++ firebird/trunk/src/dsql/DdlNodes.h	2010-08-27 02:18:00 UTC (rev 51488)
@@ -229,12 +229,11 @@
 };
 
 
-class CreateAlterFunctionNode : public DdlNode, public BlockNode
+class CreateAlterFunctionNode : public DdlNode
 {
 public:
 	CreateAlterFunctionNode(MemoryPool& pool, const Firebird::MetaName& aName)
 		: DdlNode(pool),
-		  BlockNode(pool, false),
 		  name(pool, aName),
 		  create(true),
 		  alter(false),
@@ -334,12 +333,11 @@
 	RecreateFunctionNode;
 
 
-class CreateAlterProcedureNode : public DdlNode, public BlockNode
+class CreateAlterProcedureNode : public DdlNode
 {
 public:
 	CreateAlterProcedureNode(MemoryPool& pool, const Firebird::MetaName& aName)
 		: DdlNode(pool),
-		  BlockNode(pool, true),
 		  name(pool, aName),
 		  create(true),
 		  alter(false),
@@ -476,12 +474,11 @@
 };
 
 
-class CreateAlterTriggerNode : public DdlNode, public BlockNode, public TriggerDefinition
+class CreateAlterTriggerNode : public DdlNode, public TriggerDefinition
 {
 public:
 	CreateAlterTriggerNode(MemoryPool& p, const Firebird::MetaName& aName)
 		: DdlNode(p),
-		  BlockNode(p, false),
 		  TriggerDefinition(p),
 		  create(true),
 		  alter(false),
Added: firebird/trunk/src/dsql/DsqlCompilerScratch.cpp
===================================================================
--- firebird/trunk/src/dsql/DsqlCompilerScratch.cpp	                        (rev 0)
+++ firebird/trunk/src/dsql/DsqlCompilerScratch.cpp	2010-08-27 02:18:00 UTC (rev 51488)
@@ -0,0 +1,761 @@
+/*
+ * The contents of this file are subject to the Interbase Public
+ * License Version 1.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy
+ * of the License at http://www.Inprise.com/IPL.html
+ *
+ * Software distributed under the License is distributed on an
+ * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+ * or implied. See the License for the specific language governing
+ * rights and limitations under the License.
+ *
+ * The Original Code was created by Inprise Corporation
+ * and its predecessors. Portions created by Inprise Corporation are
+ * Copyright (C) Inprise Corporation.
+ *
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ * Adriano dos Santos Fernandes
+ */
+
+#include "firebird.h"
+#include "../jrd/common.h"
+#include "../dsql/DsqlCompilerScratch.h"
+#include "../jrd/jrd.h"
+#include "../jrd/blr.h"
+#include "../dsql/node.h"
+#include "../dsql/ddl_proto.h"
+#include "../dsql/errd_proto.h"
+#include "../dsql/gen_proto.h"
+#include "../dsql/make_proto.h"
+#include "../dsql/pass1_proto.h"
+
+using namespace Firebird;
+using namespace Dsql;
+using namespace Jrd;
+
+
+// Write out field data type.
+// Taking special care to declare international text.
+void DsqlCompilerScratch::putDtype(const dsql_fld* field, bool useSubType)
+{
+#ifdef DEV_BUILD
+	// Check if the field describes a known datatype
+
+	if (field->fld_dtype > FB_NELEM(blr_dtypes) || !blr_dtypes[field->fld_dtype])
+	{
+		SCHAR buffer[100];
+
+		sprintf(buffer, "Invalid dtype %d in BlockNode::putDtype", field->fld_dtype);
+		ERRD_bugcheck(buffer);
+	}
+#endif
+
+	if (field->fld_not_nullable)
+		appendUChar(blr_not_nullable);
+
+	if (field->fld_type_of_name.hasData())
+	{
+		if (field->fld_type_of_table)
+		{
+			if (field->fld_explicit_collation)
+			{
+				appendUChar(blr_column_name2);
+				appendUChar(field->fld_full_domain ? blr_domain_full : blr_domain_type_of);
+				appendMetaString(field->fld_type_of_table->str_data);
+				appendMetaString(field->fld_type_of_name.c_str());
+				appendUShort(field->fld_ttype);
+			}
+			else
+			{
+				appendUChar(blr_column_name);
+				appendUChar(field->fld_full_domain ? blr_domain_full : blr_domain_type_of);
+				appendMetaString(field->fld_type_of_table->str_data);
+				appendMetaString(field->fld_type_of_name.c_str());
+			}
+		}
+		else
+		{
+			if (field->fld_explicit_collation)
+			{
+				appendUChar(blr_domain_name2);
+				appendUChar(field->fld_full_domain ? blr_domain_full : blr_domain_type_of);
+				appendMetaString(field->fld_type_of_name.c_str());
+				appendUShort(field->fld_ttype);
+			}
+			else
+			{
+				appendUChar(blr_domain_name);
+				appendUChar(field->fld_full_domain ? blr_domain_full : blr_domain_type_of);
+				appendMetaString(field->fld_type_of_name.c_str());
+			}
+		}
+
+		return;
+	}
+
+	switch (field->fld_dtype)
+	{
+		case dtype_cstring:
+		case dtype_text:
+		case dtype_varying:
+		case dtype_blob:
+			if (!useSubType)
+				appendUChar(blr_dtypes[field->fld_dtype]);
+			else if (field->fld_dtype == dtype_varying)
+			{
+				appendUChar(blr_varying2);
+				appendUShort(field->fld_ttype);
+			}
+			else if (field->fld_dtype == dtype_cstring)
+			{
+				appendUChar(blr_cstring2);
+				appendUShort(field->fld_ttype);
+			}
+			else if (field->fld_dtype == dtype_blob)
+			{
+				appendUChar(blr_blob2);
+				appendUShort(field->fld_sub_type);
+				appendUShort(field->fld_ttype);
+			}
+			else
+			{
+				appendUChar(blr_text2);
+				appendUShort(field->fld_ttype);
+			}
+
+			if (field->fld_dtype == dtype_varying)
+				appendUShort(field->fld_length - sizeof(USHORT));
+			else if (field->fld_dtype != dtype_blob)
+				appendUShort(field->fld_length);
+			break;
+
+		default:
+			appendUChar(blr_dtypes[field->fld_dtype]);
+			if (DTYPE_IS_EXACT(field->fld_dtype) || (dtype_quad == field->fld_dtype))
+				appendUChar(field->fld_scale);
+			break;
+	}
+}
+
+// Emit dyn for the local variables declared in a procedure or trigger.
+void DsqlCompilerScratch::putLocalVariables(const dsql_nod* parameters, SSHORT locals)
+{
+	if (!parameters)
+		return;
+
+	dsql_nod* const* ptr = parameters->nod_arg;
+
+	for (const dsql_nod* const* const end = ptr + parameters->nod_count; ptr < end; ptr++)
+	{
+		dsql_nod* parameter = *ptr;
+
+		putDebugSrcInfo(parameter->nod_line, parameter->nod_column);
+
+		if (parameter->nod_type == Dsql::nod_def_field)
+		{
+			dsql_fld* field = (dsql_fld*) parameter->nod_arg[Dsql::e_dfl_field];
+			const dsql_nod* const* rest = ptr;
+
+			while (++rest != end)
+			{
+				if ((*rest)->nod_type == Dsql::nod_def_field)
+				{
+					const dsql_fld* rest_field = (dsql_fld*) (*rest)->nod_arg[Dsql::e_dfl_field];
+					if (field->fld_name == rest_field->fld_name)
+					{
+						ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-637) <<
+								  Arg::Gds(isc_dsql_duplicate_spec) << Arg::Str(field->fld_name));
+					}
+				}
+			}
+
+			dsql_nod* varNode = MAKE_variable(field, field->fld_name.c_str(), VAR_local, 0, 0, locals);
+			variables.add(varNode);
+
+			dsql_var* variable = (dsql_var*) varNode->nod_arg[Dsql::e_var_variable];
+			putLocalVariable(variable, parameter,
+				reinterpret_cast<const dsql_str*>(parameter->nod_arg[Dsql::e_dfl_collate]));
+
+			// Some field attributes are calculated inside
+			// putLocalVariable(), so we reinitialize the
+			// descriptor
+			MAKE_desc_from_field(&varNode->nod_desc, field);
+
+			++locals;
+		}
+		else if (parameter->nod_type == Dsql::nod_cursor)
+		{
+			PASS1_statement(this, parameter);
+			GEN_statement(this, parameter);
+		}
+	}
+}
+
+// Write out local variable field data type.
+void DsqlCompilerScratch::putLocalVariable(dsql_var* variable, dsql_nod* hostParam,
+	const dsql_str* collationName)
+{
+	dsql_fld* field = variable->var_field;
+
+	appendUChar(blr_dcl_variable);
+	appendUShort(variable->var_variable_number);
+	DDL_resolve_intl_type(this, field, collationName);
+
+	//const USHORT dtype = field->fld_dtype;
+
+	putDtype(field, true);
+	//field->fld_dtype = dtype;
+
+	// Check for a default value, borrowed from define_domain
+	dsql_nod* node = hostParam ? hostParam->nod_arg[Dsql::e_dfl_default] : NULL;
+
+	if (node || (!field->fld_full_domain && !field->fld_not_nullable))
+	{
+		appendUChar(blr_assignment);
+
+		if (node)
+		{
+			fb_assert(node->nod_type == Dsql::nod_def_default);
+			PsqlChanger psqlChanger(this, false);
+			node = PASS1_node(this, node->nod_arg[Dsql::e_dft_default]);
+			GEN_expr(this, node);
+		}
+		else
+			appendUChar(blr_null);	// Initialize variable to NULL
+
+		appendUChar(blr_variable);
+		appendUShort(variable->var_variable_number);
+	}
+	else
+	{
+		appendUChar(blr_init_variable);
+		appendUShort(variable->var_variable_number);
+	}
+
+	if (variable->var_name[0])	// Not a function return value
+		putDebugVariable(variable->var_variable_number, variable->var_name);
+
+	++hiddenVarsNumber;
+}
+
+// Try to resolve variable name against parameters and local variables.
+dsql_nod* DsqlCompilerScratch::resolveVariable(const dsql_str* varName)
+{
+	for (dsql_nod* const* i = variables.begin(); i != variables.end(); ++i)
+	{
+		dsql_nod* varNode = *i;
+		fb_assert(varNode->nod_type == Dsql::nod_variable);
+
+		if (varNode->nod_type == Dsql::nod_variable)
+		{
+			const dsql_var* variable = (dsql_var*) varNode->nod_arg[Dsql::e_var_variable];
+			DEV_BLKCHK(variable, dsql_type_var);
+
+			if (!strcmp(varName->str_data, variable->var_name))
+				return varNode;
+		}
+	}
+
+	return NULL;
+}
+
+// Generate BLR for a return.
+void DsqlCompilerScratch::genReturn(bool eosFlag)
+{
+	const bool hasEos = !(flags & (FLAG_TRIGGER | FLAG_FUNCTION));
+
+	if (hasEos && !eosFlag)
+		appendUChar(blr_begin);
+
+	appendUChar(blr_send);
+	appendUChar(1);
+	appendUChar(blr_begin);
+
+	for (Array<dsql_nod*>::const_iterator i = outputVariables.begin(); i != outputVariables.end(); ++i)
+	{
+		const dsql_nod* parameter = *i;
+		const dsql_var* variable = (dsql_var*) parameter->nod_arg[Dsql::e_var_variable];
+		appendUChar(blr_assignment);
+		appendUChar(blr_variable);
+		appendUShort(variable->var_variable_number);
+		appendUChar(blr_parameter2);
+		appendUChar(variable->var_msg_number);
+		appendUShort(variable->var_msg_item);
+		appendUShort(variable->var_msg_item + 1);
+	}
+
+	if (hasEos)
+	{
+		appendUChar(blr_assignment);
+		appendUChar(blr_literal);
+		appendUChar(blr_short);
+		appendUChar(0);
+		appendUShort((eosFlag ? 0 : 1));
+		appendUChar(blr_parameter);
+		appendUChar(1);
+		appendUShort(USHORT(2 * outputVariables.getCount()));
+	}
+
+	appendUChar(blr_end);
+
+	if (hasEos && !eosFlag)
+	{
+		appendUChar(blr_stall);
+		appendUChar(blr_end);
+	}
+}
+
+void DsqlCompilerScratch::addCTEs(dsql_nod* with)
+{
+	DEV_BLKCHK(with, dsql_type_nod);
+	fb_assert(with->nod_type == Dsql::nod_with);
+
+	if (ctes.getCount())
+	{
+		ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+				  // WITH clause can't be nested
+				  Arg::Gds(isc_dsql_cte_nested_with));
+	}
+
+	if (with->nod_flags & NOD_UNION_RECURSIVE)
+		flags |= DsqlCompilerScratch::FLAG_RECURSIVE_CTE;
+
+	const dsql_nod* list = with->nod_arg[0];
+	const dsql_nod* const* end = list->nod_arg + list->nod_count;
+
+	for (dsql_nod* const* cte = list->nod_arg; cte < end; cte++)
+	{
+		fb_assert((*cte)->nod_type == Dsql::nod_derived_table);
+
+		if (with->nod_flags & NOD_UNION_RECURSIVE)
+		{
+			currCtes.push(*cte);
+			PsqlChanger changer(this, false);
+			ctes.add(pass1RecursiveCte(*cte));
+			currCtes.pop();
+
+			// Add CTE name into CTE aliases stack. It allows later to search for
+			// aliases of given CTE.
+			const dsql_str* cteName = (dsql_str*) (*cte)->nod_arg[Dsql::e_derived_table_alias];
+			addCTEAlias(cteName);
+		}
+		else
+			ctes.add(*cte);
+	}
+}
+
+dsql_nod* DsqlCompilerScratch::findCTE(const dsql_str* name)
+{
+	for (size_t i = 0; i < ctes.getCount(); ++i)
+	{
+		dsql_nod* cte = ctes[i];
+		const dsql_str* cteName = (dsql_str*) cte->nod_arg[Dsql::e_derived_table_alias];
+
+		if (name->str_length == cteName->str_length &&
+			strncmp(name->str_data, cteName->str_data, cteName->str_length) == 0)
+		{
+			return cte;
+		}
+	}
+
+	return NULL;
+}
+
+void DsqlCompilerScratch::clearCTEs()
+{
+	flags &= ~DsqlCompilerScratch::FLAG_RECURSIVE_CTE;
+	ctes.clear();
+	cteAliases.clear();
+}
+
+void DsqlCompilerScratch::checkUnusedCTEs() const
+{
+	for (size_t i = 0; i < ctes.getCount(); ++i)
+	{
+		const dsql_nod* cte = ctes[i];
+
+		if (!(cte->nod_flags & NOD_DT_CTE_USED))
+		{
+			const dsql_str* cteName = (dsql_str*) cte->nod_arg[Dsql::e_derived_table_alias];
+
+			ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+					  Arg::Gds(isc_dsql_cte_not_used) << Arg::Str(cteName->str_data));
+		}
+	}
+}
+
+// Process derived table which can be recursive CTE.
+// If it is non-recursive return input node unchanged.
+// If it is recursive return new derived table which is an union of union of anchor (non-recursive)
+// queries and union of recursive queries. Check recursive queries to satisfy various criterias.
+// Note that our parser is right-to-left therefore nested list linked as first node in parent list
+// and second node is always query spec.
+//  For example, if we have 4 CTE's where first two is non-recursive and last two is recursive:
+//
+//				list							  union
+//			  [0]	[1]						   [0]		[1]
+//			list	cte3		===>		anchor		recursive
+//		  [0]	[1]						 [0]	[1]		[0]		[1]
+//		list	cte3					cte1	cte2	cte3	cte4
+//	  [0]	[1]
+//	cte1	cte2
+//
+// Also, we should not change layout of original parse tree to allow it to be parsed again if
+// needed. Therefore recursive part is built using newly allocated list nodes.
+dsql_nod* DsqlCompilerScratch::pass1RecursiveCte(dsql_nod* input)
+{
+	dsql_str* const cte_alias = (dsql_str*) input->nod_arg[Dsql::e_derived_table_alias];
+	dsql_nod* const select_expr = input->nod_arg[Dsql::e_derived_table_rse];
+	dsql_nod* query = select_expr->nod_arg[Dsql::e_sel_query_spec];
+
+	if (query->nod_type != Dsql::nod_list && pass1RseIsRecursive(query))
+	{
+		ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+				  // Recursive CTE (%s) must be an UNION
+				  Arg::Gds(isc_dsql_cte_not_a_union) << Arg::Str(cte_alias->str_data));
+	}
+
+	// split queries list on two parts: anchor and recursive
+	dsql_nod* anchorRse = NULL, *recursiveRse = NULL;
+	dsql_nod* qry = query;
+
+	dsql_nod* newQry = MAKE_node(Dsql::nod_list, 2);
+	newQry->nod_flags = query->nod_flags;
+
+	while (true)
+	{
+		dsql_nod* rse = NULL;
+
+		if (qry->nod_type == Dsql::nod_list)
+			rse = qry->nod_arg[1];
+		else
+			rse = qry;
+
+		dsql_nod* newRse = pass1RseIsRecursive(rse);
+
+		if (newRse) // rse is recursive
+		{
+			if (anchorRse)
+			{
+				ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+					// CTE '%s' defined non-recursive member after recursive
+					Arg::Gds(isc_dsql_cte_nonrecurs_after_recurs) << Arg::Str(cte_alias->str_data));
+			}
+
+			if (newRse->nod_arg[Dsql::e_qry_distinct])
+			{
+				ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+					// Recursive member of CTE '%s' has %s clause
+					Arg::Gds(isc_dsql_cte_wrong_clause) << Arg::Str(cte_alias->str_data) <<
+														   Arg::Str("DISTINCT"));
+			}
+
+			if (newRse->nod_arg[Dsql::e_qry_group])
+			{
+				ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+					// Recursive member of CTE '%s' has %s clause
+					Arg::Gds(isc_dsql_cte_wrong_clause) << Arg::Str(cte_alias->str_data) <<
+														   Arg::Str("GROUP BY"));
+			}
+
+			if (newRse->nod_arg[Dsql::e_qry_having])
+			{
+				ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+					// Recursive member of CTE '%s' has %s clause
+					Arg::Gds(isc_dsql_cte_wrong_clause) << Arg::Str(cte_alias->str_data) <<
+														   Arg::Str("HAVING"));
+			}
+			// hvlad: we need also forbid any aggregate function here
+			// but for now i have no idea how to do it simple
+
+			if ((newQry->nod_type == Dsql::nod_list) && !(newQry->nod_flags & NOD_UNION_ALL))
+			{
+				ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+					// Recursive members of CTE (%s) must be linked with another members via UNION ALL
+					Arg::Gds(isc_dsql_cte_union_all) << Arg::Str(cte_alias->str_data));
+			}
+
+			if (!recursiveRse)
+				recursiveRse = newQry;
+
+			newRse->nod_flags |= NOD_SELECT_EXPR_RECURSIVE;
+
+			if (qry->nod_type == Dsql::nod_list)
+				newQry->nod_arg[1] = newRse;
+			else
+				newQry->nod_arg[0] = newRse;
+		}
+		else
+		{
+			if (qry->nod_type == Dsql::nod_list)
+				newQry->nod_arg[1] = rse;
+			else
+				newQry->nod_arg[0] = rse;
+
+			if (!anchorRse)
+			{
+				if (qry->nod_type == Dsql::nod_list)
+					anchorRse = newQry;
+				else
+					anchorRse = rse;
+			}
+		}
+
+		if (qry->nod_type != Dsql::nod_list)
+			break;
+
+		qry = qry->nod_arg[0];
+
+		if (qry->nod_type == Dsql::nod_list)
+		{
+			newQry->nod_arg[0] = MAKE_node(Dsql::nod_list, 2);
+			newQry = newQry->nod_arg[0];
+			newQry->nod_flags = qry->nod_flags;
+		}
+	}
+
+	if (!recursiveRse)
+		return input;
+
+	if (!anchorRse)
+	{
+		ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+			// Non-recursive member is missing in CTE '%s'
+			Arg::Gds(isc_dsql_cte_miss_nonrecursive) << Arg::Str(cte_alias->str_data));
+	}
+
+	qry = recursiveRse;
+	dsql_nod* list = NULL;
+
+	while (qry->nod_arg[0] != anchorRse)
+	{
+		list = qry;
+		qry = qry->nod_arg[0];
+	}
+
+	qry->nod_arg[0] = 0;
+
+	if (list)
+		list->nod_arg[0] = qry->nod_arg[1];
+	else
+		recursiveRse = qry->nod_arg[1];
+
+	dsql_nod* unionNode = MAKE_node(Dsql::nod_list, 2);
+	unionNode->nod_flags = NOD_UNION_ALL | NOD_UNION_RECURSIVE;
+	unionNode->nod_arg[0] = anchorRse;
+	unionNode->nod_arg[1] = recursiveRse;
+
+	dsql_nod* select = MAKE_node(Dsql::nod_select_expr, Dsql::e_sel_count);
+	select->nod_arg[Dsql::e_sel_query_spec] = unionNode;
+	select->nod_arg[Dsql::e_sel_order] = select->nod_arg[Dsql::e_sel_rows] =
+		select->nod_arg[Dsql::e_sel_with_list] = NULL;
+
+	dsql_nod* node = MAKE_node(Dsql::nod_derived_table, Dsql::e_derived_table_count);
+	dsql_str* alias = (dsql_str*) input->nod_arg[Dsql::e_derived_table_alias];
+	node->nod_arg[Dsql::e_derived_table_alias] = (dsql_nod*) alias;
+	node->nod_arg[Dsql::e_derived_table_column_alias] =
+		input->nod_arg[Dsql::e_derived_table_column_alias];
+	node->nod_arg[Dsql::e_derived_table_rse] = select;
+	node->nod_arg[Dsql::e_derived_table_context] = input->nod_arg[Dsql::e_derived_table_context];
+
+	return node;
+}
+
+// Check if rse is recursive. If recursive reference is a table in the FROM list remove it.
+// If recursive reference is a part of join add join boolean (returned by pass1JoinIsRecursive)
+// to the WHERE clause. Punt if more than one recursive reference is found.
+dsql_nod* DsqlCompilerScratch::pass1RseIsRecursive(dsql_nod* input)
+{
+	fb_assert(input->nod_type == Dsql::nod_query_spec);
+
+	dsql_nod* result = MAKE_node(Dsql::nod_query_spec, Dsql::e_qry_count);
+	memcpy(result->nod_arg, input->nod_arg, Dsql::e_qry_count * sizeof(dsql_nod*));
+
+	dsql_nod* srcTables = input->nod_arg[Dsql::e_qry_from];
+	dsql_nod* dstTables = MAKE_node(Dsql::nod_list, srcTables->nod_count);
+	result->nod_arg[Dsql::e_qry_from] = dstTables;
+
+	dsql_nod** pDstTable = dstTables->nod_arg;
+	dsql_nod** pSrcTable = srcTables->nod_arg;
+	dsql_nod** end = srcTables->nod_arg + srcTables->nod_count;
+	bool found = false;
+
+	for (dsql_nod** prev = pDstTable; pSrcTable < end; ++pSrcTable, ++pDstTable)
+	{
+		*prev++ = *pDstTable = *pSrcTable;
+
+		switch ((*pDstTable)->nod_type)
+		{
+			case Dsql::nod_rel_proc_name:
+			case Dsql::nod_relation_name:
+				if (pass1RelProcIsRecursive(*pDstTable))
+				{
+					if (found)
+					{
+						ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+								  // Recursive member of CTE can't reference itself more than once
+								  Arg::Gds(isc_dsql_cte_mult_references));
+					}
+					found = true;
+
+					prev--;
+					dstTables->nod_count--;
+				}
+				break;
+
+			case Dsql::nod_join:
+			{
+				*pDstTable = MAKE_node(Dsql::nod_join, Dsql::e_join_count);
+				memcpy((*pDstTable)->nod_arg, (*pSrcTable)->nod_arg,
+					Dsql::e_join_count * sizeof(dsql_nod*));
+
+				dsql_nod* joinBool = pass1JoinIsRecursive(*pDstTable);
+				if (joinBool)
+				{
+					if (found)
+					{
+						ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) <<
+								  // Recursive member of CTE can't reference itself more than once
+								  Arg::Gds...
 
[truncated message content] | 
| 
      
      
      From: <fir...@us...> - 2010-08-27 03:15:17
       | 
| Revision: 51491
          http://firebird.svn.sourceforge.net/firebird/?rev=51491&view=rev
Author:   firebirds
Date:     2010-08-27 03:15:10 +0000 (Fri, 27 Aug 2010)
Log Message:
-----------
nightly update
Modified Paths:
--------------
    firebird/trunk/ChangeLog
    firebird/trunk/src/jrd/build_no.h
    firebird/trunk/src/misc/writeBuildNum.sh
Modified: firebird/trunk/ChangeLog
===================================================================
--- firebird/trunk/ChangeLog	2010-08-27 02:55:09 UTC (rev 51490)
+++ firebird/trunk/ChangeLog	2010-08-27 03:15:10 UTC (rev 51491)
@@ -1,3 +1,32 @@
+ 2010-08-27 02:55  asfernandes 
+   M src/jrd/dyn.epp
+Fixed CORE-3109 - [Crash] isc_dql_exec_immed3_m for "create database ..." and NULL transaction
+
+ 2010-08-27 02:18  asfernandes 
+   M builds/posix/make.shared.variables
+   M src/dsql/DSqlDataTypeUtil.cpp
+   M src/dsql/DdlNodes.epp
+   M src/dsql/DdlNodes.h
+   A src/dsql/DsqlCompilerScratch.cpp
+   A src/dsql/DsqlCompilerScratch.h
+   M src/dsql/Nodes.h
+   M src/dsql/StmtNodes.cpp
+   M src/dsql/StmtNodes.h
+   M src/dsql/dsql.h
+   M src/dsql/gen.cpp
+   M src/dsql/misc_func.cpp
+   M src/dsql/pass1.cpp
+   M src/dsql/pass1_proto.h
+1) Separate DsqlCompilerScratch in its own files.
+2) Move BlockNode functionality to it.
+3) Move some related CTE functions to it.
+
+ 2010-08-26 15:40  asfernandes 
+   M src/jrd/Function.epp
+   M src/jrd/Function.h
+   M src/jrd/fun.epp
+Misc
+
  2010-08-25 15:52  asfernandes 
    M src/jrd/RecordSourceNodes.cpp
    M src/jrd/RecordSourceNodes.h
Modified: firebird/trunk/src/jrd/build_no.h
===================================================================
--- firebird/trunk/src/jrd/build_no.h	2010-08-27 02:55:09 UTC (rev 51490)
+++ firebird/trunk/src/jrd/build_no.h	2010-08-27 03:15:10 UTC (rev 51491)
@@ -3,16 +3,16 @@
                *** DO NOT EDIT ***
   TO CHANGE ANY INFORMATION IN HERE PLEASE
   EDIT src/misc/writeBuildNum.sh
-  FORMAL BUILD NUMBER:28697
+  FORMAL BUILD NUMBER:28700
 */
 
-#define PRODUCT_VER_STRING "3.0.0.28697"
-#define FILE_VER_STRING "WI-T3.0.0.28697"
-#define LICENSE_VER_STRING "WI-T3.0.0.28697"
-#define FILE_VER_NUMBER 3, 0, 0, 28697
+#define PRODUCT_VER_STRING "3.0.0.28700"
+#define FILE_VER_STRING "WI-T3.0.0.28700"
+#define LICENSE_VER_STRING "WI-T3.0.0.28700"
+#define FILE_VER_NUMBER 3, 0, 0, 28700
 #define FB_MAJOR_VER "3"
 #define FB_MINOR_VER "0"
 #define FB_REV_NO "0"
-#define FB_BUILD_NO "28697"
+#define FB_BUILD_NO "28700"
 #define FB_BUILD_TYPE "T"
 #define FB_BUILD_SUFFIX "Firebird 3.0 Unstable"
Modified: firebird/trunk/src/misc/writeBuildNum.sh
===================================================================
--- firebird/trunk/src/misc/writeBuildNum.sh	2010-08-27 02:55:09 UTC (rev 51490)
+++ firebird/trunk/src/misc/writeBuildNum.sh	2010-08-27 03:15:10 UTC (rev 51491)
@@ -9,7 +9,7 @@
 MajorVer=3
 MinorVer=0
 RevNo=0
-BuildNum=28697
+BuildNum=28700
 
 if [ "$SPECIAL_BUILD_SUFFIX" = "" ]; then
 # Normal builds
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |