From: <fir...@us...> - 2011-11-14 03:18:21
|
Revision: 53628 http://firebird.svn.sourceforge.net/firebird/?rev=53628&view=rev Author: firebirds Date: 2011-11-14 03:18:14 +0000 (Mon, 14 Nov 2011) 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 2011-11-13 21:32:12 UTC (rev 53627) +++ firebird/trunk/ChangeLog 2011-11-14 03:18:14 UTC (rev 53628) @@ -1,3 +1,32 @@ + 2011-11-13 21:32 asfernandes + M builds/win32/msvc10/engine.vcxproj + M builds/win32/msvc10/engine.vcxproj.filters + M builds/win32/msvc9/engine.vcproj + M builds/win32/preprocess.bat + M lang_helpers/gds_codes.ftn + M lang_helpers/gds_codes.pas + M src/dsql/DdlNodes.epp + M src/dsql/DdlNodes.h + M src/dsql/ddl.cpp + M src/dsql/node.h + M src/dsql/parse.y + M src/dsql/pass1.cpp + M src/include/gen/codetext.h + M src/include/gen/iberror.h + M src/include/gen/msgs.h + M src/include/gen/sql_code.h + M src/include/gen/sql_state.h + M src/jrd/dyn.epp + M src/jrd/dyn.h + M src/jrd/dyn_def.epp + D src/jrd/dyn_del.epp + M src/jrd/dyn_df_proto.h + D src/jrd/dyn_dl_proto.h + M src/msgs/facilities2.sql + M src/msgs/messages2.sql + M src/msgs/system_errors2.sql +Refactor DDL commands: DROP INDEX, DROP FILTER, DROP SHADOW, CREATE/DROP ROLE and DROP USER. + 2011-11-10 15:03 asfernandes M src/dsql/parse.y Cleanup for RECREATE commands. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-11-13 21:32:12 UTC (rev 53627) +++ firebird/trunk/src/jrd/build_no.h 2011-11-14 03:18:14 UTC (rev 53628) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29611 + FORMAL BUILD NUMBER:29612 */ -#define PRODUCT_VER_STRING "3.0.0.29611" -#define FILE_VER_STRING "WI-T3.0.0.29611" -#define LICENSE_VER_STRING "WI-T3.0.0.29611" -#define FILE_VER_NUMBER 3, 0, 0, 29611 +#define PRODUCT_VER_STRING "3.0.0.29612" +#define FILE_VER_STRING "WI-T3.0.0.29612" +#define LICENSE_VER_STRING "WI-T3.0.0.29612" +#define FILE_VER_NUMBER 3, 0, 0, 29612 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29611" +#define FB_BUILD_NO "29612" #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 2011-11-13 21:32:12 UTC (rev 53627) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-11-14 03:18:14 UTC (rev 53628) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29611 +BuildNum=29612 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-11-15 03:20:57
|
Revision: 53634 http://firebird.svn.sourceforge.net/firebird/?rev=53634&view=rev Author: firebirds Date: 2011-11-15 03:20:50 +0000 (Tue, 15 Nov 2011) 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 2011-11-14 23:10:30 UTC (rev 53633) +++ firebird/trunk/ChangeLog 2011-11-15 03:20:50 UTC (rev 53634) @@ -1,3 +1,23 @@ + 2011-11-14 23:10 hvlad + M src/utilities/ntrace/fbtrace.conf +Update documentation + + 2011-11-14 18:15 asfernandes + M src/dsql/DdlNodes.epp + M src/dsql/PackageNodes.epp + M src/jrd/dyn.epp +Correction. + + 2011-11-14 18:15 asfernandes + M src/dsql/parse.y +Misc. + + 2011-11-14 18:06 asfernandes + M src/dsql/DdlNodes.epp + M src/dsql/node.h + M src/dsql/parse.y +Misc. + 2011-11-13 21:32 asfernandes M builds/win32/msvc10/engine.vcxproj M builds/win32/msvc10/engine.vcxproj.filters Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-11-14 23:10:30 UTC (rev 53633) +++ firebird/trunk/src/jrd/build_no.h 2011-11-15 03:20:50 UTC (rev 53634) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29612 + FORMAL BUILD NUMBER:29616 */ -#define PRODUCT_VER_STRING "3.0.0.29612" -#define FILE_VER_STRING "WI-T3.0.0.29612" -#define LICENSE_VER_STRING "WI-T3.0.0.29612" -#define FILE_VER_NUMBER 3, 0, 0, 29612 +#define PRODUCT_VER_STRING "3.0.0.29616" +#define FILE_VER_STRING "WI-T3.0.0.29616" +#define LICENSE_VER_STRING "WI-T3.0.0.29616" +#define FILE_VER_NUMBER 3, 0, 0, 29616 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29612" +#define FB_BUILD_NO "29616" #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 2011-11-14 23:10:30 UTC (rev 53633) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-11-15 03:20:50 UTC (rev 53634) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29612 +BuildNum=29616 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-11-17 03:21:16
|
Revision: 53637 http://firebird.svn.sourceforge.net/firebird/?rev=53637&view=rev Author: firebirds Date: 2011-11-17 03:21:09 +0000 (Thu, 17 Nov 2011) 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 2011-11-16 17:41:27 UTC (rev 53636) +++ firebird/trunk/ChangeLog 2011-11-17 03:21:09 UTC (rev 53637) @@ -1,3 +1,7 @@ + 2011-11-16 17:41 dimitr + M src/jrd/GlobalRWLock.cpp +Misc. + 2011-11-14 23:10 hvlad M src/utilities/ntrace/fbtrace.conf Update documentation Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-11-16 17:41:27 UTC (rev 53636) +++ firebird/trunk/src/jrd/build_no.h 2011-11-17 03:21:09 UTC (rev 53637) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29616 + FORMAL BUILD NUMBER:29617 */ -#define PRODUCT_VER_STRING "3.0.0.29616" -#define FILE_VER_STRING "WI-T3.0.0.29616" -#define LICENSE_VER_STRING "WI-T3.0.0.29616" -#define FILE_VER_NUMBER 3, 0, 0, 29616 +#define PRODUCT_VER_STRING "3.0.0.29617" +#define FILE_VER_STRING "WI-T3.0.0.29617" +#define LICENSE_VER_STRING "WI-T3.0.0.29617" +#define FILE_VER_NUMBER 3, 0, 0, 29617 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29616" +#define FB_BUILD_NO "29617" #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 2011-11-16 17:41:27 UTC (rev 53636) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-11-17 03:21:09 UTC (rev 53637) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29616 +BuildNum=29617 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-11-18 03:20:49
|
Revision: 53639 http://firebird.svn.sourceforge.net/firebird/?rev=53639&view=rev Author: firebirds Date: 2011-11-18 03:20:43 +0000 (Fri, 18 Nov 2011) 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 2011-11-18 01:07:26 UTC (rev 53638) +++ firebird/trunk/ChangeLog 2011-11-18 03:20:43 UTC (rev 53639) @@ -1,3 +1,9 @@ + 2011-11-18 01:07 asfernandes + M src/burp/backup.epp + M src/burp/canonical.cpp + M src/burp/restore.epp +Fixed backup/restore of BOOLEAN columns. + 2011-11-16 17:41 dimitr M src/jrd/GlobalRWLock.cpp Misc. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-11-18 01:07:26 UTC (rev 53638) +++ firebird/trunk/src/jrd/build_no.h 2011-11-18 03:20:43 UTC (rev 53639) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29617 + FORMAL BUILD NUMBER:29618 */ -#define PRODUCT_VER_STRING "3.0.0.29617" -#define FILE_VER_STRING "WI-T3.0.0.29617" -#define LICENSE_VER_STRING "WI-T3.0.0.29617" -#define FILE_VER_NUMBER 3, 0, 0, 29617 +#define PRODUCT_VER_STRING "3.0.0.29618" +#define FILE_VER_STRING "WI-T3.0.0.29618" +#define LICENSE_VER_STRING "WI-T3.0.0.29618" +#define FILE_VER_NUMBER 3, 0, 0, 29618 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29617" +#define FB_BUILD_NO "29618" #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 2011-11-18 01:07:26 UTC (rev 53638) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-11-18 03:20:43 UTC (rev 53639) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29617 +BuildNum=29618 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <asf...@us...> - 2011-11-22 16:33:37
|
Revision: 53641 http://firebird.svn.sourceforge.net/firebird/?rev=53641&view=rev Author: asfernandes Date: 2011-11-22 16:33:25 +0000 (Tue, 22 Nov 2011) Log Message: ----------- DDL refactor: ALTER EXTERNAL FUNCTION, ALTER INDEX, SET STATISTICS, CREATE SHADOW, ALTER ROLE, CREATE/ALTER DATABASE. Modified Paths: -------------- firebird/trunk/builds/win32/msvc10/engine.vcxproj firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters firebird/trunk/builds/win32/msvc8/engine.vcproj firebird/trunk/builds/win32/msvc9/engine.vcproj firebird/trunk/builds/win32/preprocess.bat firebird/trunk/lang_helpers/gds_codes.ftn firebird/trunk/lang_helpers/gds_codes.pas firebird/trunk/src/common/classes/MetaName.h firebird/trunk/src/dsql/BlrWriter.cpp 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/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_df_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 Removed Paths: ------------- firebird/trunk/src/jrd/dyn_md_proto.h firebird/trunk/src/jrd/dyn_mod.epp Modified: firebird/trunk/builds/win32/msvc10/engine.vcxproj =================================================================== --- firebird/trunk/builds/win32/msvc10/engine.vcxproj 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/builds/win32/msvc10/engine.vcxproj 2011-11-22 16:33:25 UTC (rev 53641) @@ -26,7 +26,6 @@ <ClCompile Include="..\..\..\gen\jrd\dpm.cpp" /> <ClCompile Include="..\..\..\gen\jrd\dyn.cpp" /> <ClCompile Include="..\..\..\gen\jrd\dyn_def.cpp" /> - <ClCompile Include="..\..\..\gen\jrd\dyn_mod.cpp" /> <ClCompile Include="..\..\..\gen\jrd\dyn_util.cpp" /> <ClCompile Include="..\..\..\gen\jrd\fun.cpp" /> <ClCompile Include="..\..\..\gen\jrd\Function.cpp" /> @@ -219,7 +218,6 @@ <ClInclude Include="..\..\..\src\jrd\drq.h" /> <ClInclude Include="..\..\..\src\jrd\dyn.h" /> <ClInclude Include="..\..\..\src\jrd\dyn_df_proto.h" /> - <ClInclude Include="..\..\..\src\jrd\dyn_md_proto.h" /> <ClInclude Include="..\..\..\src\jrd\dyn_proto.h" /> <ClInclude Include="..\..\..\src\jrd\dyn_ut_proto.h" /> <ClInclude Include="..\..\..\src\jrd\ErrorImpl.h" /> @@ -351,7 +349,6 @@ <None Include="..\..\..\src\jrd\dpm.epp" /> <None Include="..\..\..\src\jrd\dyn.epp" /> <None Include="..\..\..\src\jrd\dyn_def.epp" /> - <None Include="..\..\..\src\jrd\dyn_mod.epp" /> <None Include="..\..\..\src\jrd\dyn_util.epp" /> <None Include="..\..\..\src\jrd\fun.epp" /> <None Include="..\..\..\src\jrd\Function.epp" /> Modified: firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters =================================================================== --- firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters 2011-11-22 16:33:25 UTC (rev 53641) @@ -417,9 +417,6 @@ <ClCompile Include="..\..\..\gen\jrd\dyn_def.cpp"> <Filter>JRD files\GPRE cpp</Filter> </ClCompile> - <ClCompile Include="..\..\..\gen\jrd\dyn_mod.cpp"> - <Filter>JRD files\GPRE cpp</Filter> - </ClCompile> <ClCompile Include="..\..\..\gen\jrd\dyn_util.cpp"> <Filter>JRD files\GPRE cpp</Filter> </ClCompile> @@ -683,9 +680,6 @@ <ClInclude Include="..\..\..\src\jrd\dyn_df_proto.h"> <Filter>Header files</Filter> </ClInclude> - <ClInclude Include="..\..\..\src\jrd\dyn_md_proto.h"> - <Filter>Header files</Filter> - </ClInclude> <ClInclude Include="..\..\..\src\jrd\dyn_proto.h"> <Filter>Header files</Filter> </ClInclude> @@ -1021,9 +1015,6 @@ <None Include="..\..\..\src\jrd\dyn_def.epp"> <Filter>JRD files\GPRE files</Filter> </None> - <None Include="..\..\..\src\jrd\dyn_mod.epp"> - <Filter>JRD files\GPRE files</Filter> - </None> <None Include="..\..\..\src\jrd\dyn_util.epp"> <Filter>JRD files\GPRE files</Filter> </None> Modified: firebird/trunk/builds/win32/msvc8/engine.vcproj =================================================================== --- firebird/trunk/builds/win32/msvc8/engine.vcproj 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/builds/win32/msvc8/engine.vcproj 2011-11-22 16:33:25 UTC (rev 53641) @@ -735,10 +735,6 @@ > </File> <File - RelativePath="..\..\..\gen\jrd\dyn_mod.cpp" - > - </File> - <File RelativePath="..\..\..\gen\jrd\dyn_util.cpp" > </File> @@ -795,10 +791,6 @@ > </File> <File - RelativePath="..\..\..\src\jrd\dyn_mod.epp" - > - </File> - <File RelativePath="..\..\..\src\jrd\dyn_util.epp" > </File> @@ -1048,10 +1040,6 @@ > </File> <File - RelativePath="..\..\..\src\jrd\dyn_md_proto.h" - > - </File> - <File RelativePath="..\..\..\src\jrd\dyn_proto.h" > </File> Modified: firebird/trunk/builds/win32/msvc9/engine.vcproj =================================================================== --- firebird/trunk/builds/win32/msvc9/engine.vcproj 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/builds/win32/msvc9/engine.vcproj 2011-11-22 16:33:25 UTC (rev 53641) @@ -731,10 +731,6 @@ > </File> <File - RelativePath="..\..\..\gen\jrd\dyn_mod.cpp" - > - </File> - <File RelativePath="..\..\..\gen\jrd\dyn_util.cpp" > </File> @@ -787,10 +783,6 @@ > </File> <File - RelativePath="..\..\..\src\jrd\dyn_mod.epp" - > - </File> - <File RelativePath="..\..\..\src\jrd\dyn_util.epp" > </File> @@ -1036,10 +1028,6 @@ > </File> <File - RelativePath="..\..\..\src\jrd\dyn_md_proto.h" - > - </File> - <File RelativePath="..\..\..\src\jrd\dyn_proto.h" > </File> Modified: firebird/trunk/builds/win32/preprocess.bat =================================================================== --- firebird/trunk/builds/win32/preprocess.bat 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/builds/win32/preprocess.bat 2011-11-22 16:33:25 UTC (rev 53641) @@ -67,7 +67,7 @@ @for %%i in (array, blob) do @call :PREPROCESS yvalve %%i @for %%i in (metd, DdlNodes, PackageNodes) do @call :PREPROCESS dsql %%i -gds_cxx @for %%i in (gpre_meta) do @call :PREPROCESS gpre/std %%i -@for %%i in (dfw, dpm, dyn, dyn_def, dyn_mod, dyn_util, fun, grant, ini, met, pcmet, scl, Function) do @call :PREPROCESS jrd %%i -gds_cxx +@for %%i in (dfw, dpm, dyn, dyn_def, dyn_util, fun, grant, ini, met, pcmet, scl, Function) do @call :PREPROCESS jrd %%i -gds_cxx @for %%i in (stats) do @call :PREPROCESS utilities %%i @goto :EOF @@ -81,7 +81,7 @@ @for %%i in (metd) do @call :PREPROCESS dsql %%i -gds_cxx @for %%i in (DdlNodes, PackageNodes) do @call :PREPROCESS dsql %%i -gds_cxx @for %%i in (gpre_meta) do @call :PREPROCESS gpre/std %%i -@for %%i in (dfw, dpm, dyn, dyn_def, dyn_mod, dyn_util, fun, grant, ini, met, pcmet, scl, Function) do @call :PREPROCESS jrd %%i -gds_cxx +@for %%i in (dfw, dpm, dyn, dyn_def, dyn_util, fun, grant, ini, met, pcmet, scl, Function) do @call :PREPROCESS jrd %%i -gds_cxx @for %%i in (codes) do @call :PREPROCESS misc %%i @for %%i in (build_file) do @call :PREPROCESS msgs %%i @for %%i in (help, meta, proc, show) do @call :PREPROCESS qli %%i Modified: firebird/trunk/lang_helpers/gds_codes.ftn =================================================================== --- firebird/trunk/lang_helpers/gds_codes.ftn 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/lang_helpers/gds_codes.ftn 2011-11-22 16:33:25 UTC (rev 53641) @@ -2130,6 +2130,14 @@ PARAMETER (GDS__dsql_drop_user_failed = 336397309) INTEGER*4 GDS__dsql_create_role_failed PARAMETER (GDS__dsql_create_role_failed = 336397310) + INTEGER*4 GDS__dsql_alter_role_failed + PARAMETER (GDS__dsql_alter_role_failed = 336397311) + INTEGER*4 GDS__dsql_alter_index_failed + PARAMETER (GDS__dsql_alter_index_failed = 336397312) + INTEGER*4 GDS__dsql_alter_database_failed + PARAMETER (GDS__dsql_alter_database_failed = 336397313) + INTEGER*4 GDS__dsql_create_shadow_failed + PARAMETER (GDS__dsql_create_shadow_failed = 336397314) 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 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/lang_helpers/gds_codes.pas 2011-11-22 16:33:25 UTC (rev 53641) @@ -1072,6 +1072,10 @@ gds_dsql_drop_role_failed = 336397308; gds_dsql_drop_user_failed = 336397309; gds_dsql_create_role_failed = 336397310; + gds_dsql_alter_role_failed = 336397311; + gds_dsql_alter_index_failed = 336397312; + gds_dsql_alter_database_failed = 336397313; + gds_dsql_create_shadow_failed = 336397314; gds_gsec_cant_open_db = 336723983; gds_gsec_switches_error = 336723984; gds_gsec_no_op_spec = 336723985; Modified: firebird/trunk/src/common/classes/MetaName.h =================================================================== --- firebird/trunk/src/common/classes/MetaName.h 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/common/classes/MetaName.h 2011-11-22 16:33:25 UTC (rev 53641) @@ -105,19 +105,6 @@ static void adjustLength(const char* const s, size_t& l); }; -// This class is used to simplify calls from GDML, when pointer to MetaName -// should be passed to some function, at the same time reflecting changes in -// associated GDML variable (database field). -class MetaNameProxy : public MetaName -{ - char* target; -public: - explicit MetaNameProxy(char* s) - : Firebird::MetaName(s), target(s) - { } - ~MetaNameProxy() { strcpy(target, c_str()); } -}; - typedef Pair<Full<MetaName, MetaName> > MetaNamePair; } // namespace Firebird Modified: firebird/trunk/src/dsql/BlrWriter.cpp =================================================================== --- firebird/trunk/src/dsql/BlrWriter.cpp 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/dsql/BlrWriter.cpp 2011-11-22 16:33:25 UTC (rev 53641) @@ -84,18 +84,6 @@ 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) { Modified: firebird/trunk/src/dsql/BlrWriter.h =================================================================== --- firebird/trunk/src/dsql/BlrWriter.h 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/dsql/BlrWriter.h 2011-11-22 16:33:25 UTC (rev 53641) @@ -122,8 +122,6 @@ 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(); Modified: firebird/trunk/src/dsql/DdlNodes.epp =================================================================== --- firebird/trunk/src/dsql/DdlNodes.epp 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/dsql/DdlNodes.epp 2011-11-22 16:33:25 UTC (rev 53641) @@ -94,6 +94,9 @@ 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 void defineFile(thread_db* tdbb, jrd_tra* transaction, SLONG shadowNumber, bool manualShadow, + bool conditionalShadow, SLONG& dbAlloc, + const PathName& name, SLONG start, SLONG length); 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); @@ -330,6 +333,46 @@ } } +// Define a database or shadow file. +static void defineFile(thread_db* tdbb, jrd_tra* transaction, SLONG shadowNumber, bool manualShadow, + bool conditionalShadow, SLONG& dbAlloc, const PathName& name, SLONG start, SLONG length) +{ + PathName expandedName = name; + + if (!ISC_expand_filename(expandedName, false)) + status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(231, DYN_MSG_FAC))); // File name is invalid. + + if (tdbb->getDatabase()->dbb_filename == expandedName) + status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(166, DYN_MSG_FAC))); + + AutoCacheRequest request(tdbb, drq_l_files, DYN_REQUESTS); + + FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + FIRST 1 X IN RDB$FILES + WITH X.RDB$FILE_NAME EQ expandedName.c_str() + { + status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(166, DYN_MSG_FAC))); + } + END_FOR + + request.reset(tdbb, drq_s_files, DYN_REQUESTS); + + STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + X IN RDB$FILES + { + expandedName.copyTo(X.RDB$FILE_NAME, sizeof(X.RDB$FILE_NAME)); + X.RDB$SHADOW_NUMBER = shadowNumber; + X.RDB$FILE_FLAGS = (manualShadow ? FILE_manual : 0) | + (conditionalShadow ? FILE_conditional : 0); + + dbAlloc = MAX(dbAlloc, start); + X.RDB$FILE_START = dbAlloc; + X.RDB$FILE_LENGTH = length; + dbAlloc += length; + } + END_STORE +} + // 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) @@ -1501,21 +1544,13 @@ strcpy(FUN.RDB$ENGINE_NAME, external->engine.c_str()); if (external->udfModule.length() >= sizeof(FUN.RDB$MODULE_NAME)) - { - status_exception::raise( - Arg::Gds(isc_arith_except) << - Arg::Gds(isc_string_truncation)); - } + status_exception::raise(Arg::Gds(isc_dyn_name_longer)); FUN.RDB$MODULE_NAME.NULL = (SSHORT) external->udfModule.isEmpty(); strcpy(FUN.RDB$MODULE_NAME, external->udfModule.c_str()); if (external->name.length() >= sizeof(FUN.RDB$ENTRYPOINT)) - { - status_exception::raise( - Arg::Gds(isc_arith_except) << - Arg::Gds(isc_string_truncation)); - } + status_exception::raise(Arg::Gds(isc_dyn_name_longer)); FUN.RDB$ENTRYPOINT.NULL = (SSHORT) external->name.isEmpty(); strcpy(FUN.RDB$ENTRYPOINT, external->name.c_str()); @@ -1850,6 +1885,88 @@ //---------------------- +void AlterExternalFunctionNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const +{ + text.printf( + "AlterExternalFunctionNode\n" + " name: '%s'\n" + " entrypoint: '%s'\n" + " module: '%s'\n", + name.c_str(), clauses.name.c_str(), clauses.udfModule.c_str()); +} + +// Allow changing the entry point and/or the module name of a UDF. +void AlterExternalFunctionNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, + jrd_tra* transaction) +{ + if (clauses.name.isEmpty() && clauses.udfModule.isEmpty()) + { + status_exception::raise( + Arg::Gds(isc_sqlerr) << Arg::Num(-104) /*** FIXME: << + // Unexpected end of command + Arg::Gds(isc_command_end_err2) << Arg::Num(node->nod_line) << + Arg::Num(node->nod_column + obj_name->str_length)***/); // + strlen("FUNCTION") + } + + // run all statements under savepoint control + AutoSavePoint savePoint(tdbb, transaction); + + AutoCacheRequest request(tdbb, drq_m_fun, DYN_REQUESTS); + bool found = false; + + FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + FUN IN RDB$FUNCTIONS + WITH FUN.RDB$FUNCTION_NAME EQ name.c_str() AND + FUN.RDB$PACKAGE_NAME MISSING + { + found = true; + + executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_BEFORE, DDL_TRIGGER_ALTER_FUNCTION, name); + + if (!FUN.RDB$ENGINE_NAME.NULL || !FUN.RDB$FUNCTION_BLR.NULL) + status_exception::raise(Arg::Gds(isc_dyn_newfc_oldsyntax) << name); + + MODIFY FUN + if (clauses.name.hasData()) + { + if (clauses.name.length() >= sizeof(FUN.RDB$ENTRYPOINT)) + status_exception::raise(Arg::Gds(isc_dyn_name_longer)); + + FUN.RDB$ENTRYPOINT.NULL = FALSE; + strcpy(FUN.RDB$ENTRYPOINT, clauses.name.c_str()); + } + + if (clauses.udfModule.hasData()) + { + if (clauses.udfModule.length() >= sizeof(FUN.RDB$MODULE_NAME)) + status_exception::raise(Arg::Gds(isc_dyn_name_longer)); + + FUN.RDB$MODULE_NAME.NULL = FALSE; + strcpy(FUN.RDB$MODULE_NAME, clauses.udfModule.c_str()); + } + END_MODIFY + } + END_FOR + + if (found) + executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_AFTER, DDL_TRIGGER_ALTER_FUNCTION, name); + else + { + // msg 41: "Function %s not found" + status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(41, DYN_MSG_FAC)) << name); + } + + savePoint.release(); // everything is ok + + // Update DSQL cache + METD_drop_function(transaction, QualifiedName(name, "")); + MET_dsql_cache_release(tdbb, SYM_udf, name, ""); +} + + +//---------------------- + + void DropFunctionNode::dropArguments(thread_db* tdbb, jrd_tra* transaction, const MetaName& functionName, const MetaName& packageName) { @@ -2300,11 +2417,7 @@ strcpy(P.RDB$ENGINE_NAME, external->engine.c_str()); if (external->name.length() >= sizeof(P.RDB$ENTRYPOINT)) - { - status_exception::raise( - Arg::Gds(isc_arith_except) << - Arg::Gds(isc_string_truncation)); - } + status_exception::raise(Arg::Gds(isc_dyn_name_longer)); P.RDB$ENTRYPOINT.NULL = (SSHORT) external->name.isEmpty(); strcpy(P.RDB$ENTRYPOINT, external->name.c_str()); @@ -2832,11 +2945,7 @@ strcpy(TRG.RDB$ENGINE_NAME, external->engine.c_str()); if (external->name.length() >= sizeof(TRG.RDB$ENTRYPOINT)) - { - status_exception::raise( - Arg::Gds(isc_arith_except) << - Arg::Gds(isc_string_truncation)); - } + status_exception::raise(Arg::Gds(isc_dyn_name_longer)); TRG.RDB$ENTRYPOINT.NULL = (SSHORT) external->name.isEmpty(); strcpy(TRG.RDB$ENTRYPOINT, external->name.c_str()); @@ -3752,7 +3861,7 @@ default: fb_assert(FALSE); - errorCode = 87; // MODIFY RDB$FIELDS FAILED + errorCode = ENCODE_ISC_MSG(87, DYN_MSG_FAC); // MODIFY RDB$FIELDS FAILED break; } break; @@ -3947,14 +4056,14 @@ default: fb_assert(FALSE); - errorCode = 87; // MODIFY RDB$FIELDS FAILED + errorCode = ENCODE_ISC_MSG(87, DYN_MSG_FAC); // MODIFY RDB$FIELDS FAILED break; } break; default: fb_assert(FALSE); - errorCode = 87; // MODIFY RDB$FIELDS FAILED + errorCode = ENCODE_ISC_MSG(87, DYN_MSG_FAC); // MODIFY RDB$FIELDS FAILED break; } @@ -8738,6 +8847,100 @@ //---------------------- +void AlterIndexNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const +{ + text.printf( + "AlterIndexNode\n" + " name: '%s'\n" + " active: '%d'\n", + name.c_str(), active); +} + +void AlterIndexNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction) +{ + // run all statements under savepoint control + AutoSavePoint savePoint(tdbb, transaction); + + AutoCacheRequest request(tdbb, drq_m_index, DYN_REQUESTS); + bool found = false; + + FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + IDX IN RDB$INDICES + WITH IDX.RDB$INDEX_NAME EQ name.c_str() + { + found = true; + + executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_BEFORE, DDL_TRIGGER_ALTER_INDEX, name); + + MODIFY IDX + IDX.RDB$INDEX_INACTIVE.NULL = FALSE; + IDX.RDB$INDEX_INACTIVE = active ? FALSE : TRUE; + END_MODIFY + } + END_FOR + + if (found) + executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_AFTER, DDL_TRIGGER_ALTER_INDEX, name); + else + { + // msg 48: "Index not found" + status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(48, DYN_MSG_FAC))); + } + + savePoint.release(); // everything is ok +} + + +//---------------------- + + +void SetStatisticsNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const +{ + text.printf( + "SetStatisticsNode\n" + " name: '%s'\n", + name.c_str()); +} + +void SetStatisticsNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction) +{ + // run all statements under savepoint control + AutoSavePoint savePoint(tdbb, transaction); + + AutoCacheRequest request(tdbb, drq_m_set_statistics, DYN_REQUESTS); + bool found = false; + + FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + IDX IN RDB$INDICES + WITH IDX.RDB$INDEX_NAME EQ name.c_str() + { + found = true; + + executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_BEFORE, DDL_TRIGGER_ALTER_INDEX, name); + + MODIFY IDX + // For V4 index selectivity can be set only to -1. + IDX.RDB$STATISTICS.NULL = FALSE; + IDX.RDB$STATISTICS = -1.0; + END_MODIFY + } + END_FOR + + if (found) + executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_AFTER, DDL_TRIGGER_ALTER_INDEX, name); + else + { + // msg 48: "Index not found" + status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(48, DYN_MSG_FAC))); + } + + savePoint.release(); // everything is ok +} + + +//---------------------- + + // Delete the records in RDB$INDEX_SEGMENTS pertaining to an index. bool DropIndexNode::deleteSegmentRecords(thread_db* tdbb, jrd_tra* transaction, const MetaName& name) @@ -8844,6 +9047,71 @@ //---------------------- +void CreateShadowNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const +{ + text.printf( + "CreateShadowNode\n" + " number: '%d'\n", + number); +} + +void CreateShadowNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction) +{ + if (!tdbb->getAttachment()->locksmith()) + status_exception::raise(Arg::Gds(isc_adm_task_denied)); + + // Should be caught by the parser. + if (number == 0) + { + status_exception::raise( + Arg::Gds(isc_sqlerr) << Arg::Num(-607) << + Arg::Gds(isc_dsql_command_err) << + Arg::Gds(isc_dsql_shadow_number_err)); + } + + // run all statements under savepoint control + AutoSavePoint savePoint(tdbb, transaction); + + // If a shadow set identified by the shadow number already exists return error. + + AutoCacheRequest request(tdbb, drq_l_shadow, DYN_REQUESTS); + + FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + FIRST 1 X IN RDB$FILES + WITH X.RDB$SHADOW_NUMBER EQ number + { + // msg 165: "Shadow %ld already exists" + status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(165, DYN_MSG_FAC)) << Arg::Num(number)); + } + END_FOR + + SLONG start = 0; + + for (DbFileClause** i = files.begin(); i != files.end(); ++i) + { + bool first = i == files.begin(); + DbFileClause* file = *i; + + if (!first && i[-1]->length == 0 && file->start == 0) + { + // Preceding file did not specify length, so %s must include starting page number + status_exception::raise( + Arg::Gds(isc_sqlerr) << Arg::Num(-607) << + Arg::Gds(isc_dsql_command_err) << + Arg::Gds(isc_dsql_file_length_err) << file->name); + } + + defineFile(tdbb, transaction, number, manual && first, conditional && first, + start, file->name, file->start, file->length); + } + + savePoint.release(); // everything is ok +} + + +//---------------------- + + void DropShadowNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const { text.printf( @@ -8983,6 +9251,62 @@ //---------------------- +void AlterRoleNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const +{ + text.printf( + "AlterRoleNode\n" + " name: '%s'\n" + " map: '%d'\n", + name.c_str(), map); +} + +// It's purpose is to add/drop mapping from OS security name to DB security object. +void AlterRoleNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction) +{ + // run all statements under savepoint control + AutoSavePoint savePoint(tdbb, transaction); + + // This is FB 2.5 limited implementation! + // Later it should work with new system table, something like RDB$MAPPING. + + if (name != ADMIN_ROLE) + status_exception::raise(Arg::Gds(isc_wish_list)); + + if (!(tdbb->getAttachment() && tdbb->getAttachment()->locksmith())) + status_exception::raise(Arg::Gds(isc_adm_task_denied)); + + AutoCacheRequest request(tdbb, drq_m_map, DYN_REQUESTS); + bool found = false; + + FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + ROL IN RDB$ROLES + WITH ROL.RDB$ROLE_NAME EQ name.c_str() + { + found = true; + + executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_BEFORE, DDL_TRIGGER_ALTER_ROLE, name); + + MODIFY ROL + ROL.RDB$SYSTEM_FLAG = ROLE_FLAG_DBO | (map ? ROLE_FLAG_MAY_TRUST : 0); + END_MODIFY + } + END_FOR + + if (found) + executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_AFTER, DDL_TRIGGER_ALTER_ROLE, name); + else + { + status_exception::raise( + Arg::Gds(isc_random) << Arg::Str("Missing RDB$ADMIN role in the database")); + } + + savePoint.release(); // everything is ok +} + + +//---------------------- + + void DropRoleNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const { text.printf( @@ -9088,4 +9412,196 @@ } +//---------------------- + + +void AlterDatabaseNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const +{ + text.printf( + "AlterDatabaseNode\n"); +} + +void AlterDatabaseNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, + jrd_tra* transaction) +{ + if (!tdbb->getAttachment()->locksmith()) + status_exception::raise(Arg::Gds(isc_adm_task_denied)); + + // run all statements under savepoint control + AutoSavePoint savePoint(tdbb, transaction); + + Attachment* attachment = transaction->tra_attachment; + SLONG dbAlloc = PageSpace::maxAlloc(tdbb->getDatabase()); + SLONG start = create ? createLength + 1 : 0; + AutoCacheRequest request(tdbb, drq_m_database, DYN_REQUESTS); + + FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + DBB IN RDB$DATABASE + { + MODIFY DBB USING + if (clauses & CLAUSE_DROP_DIFFERENCE) + changeBackupMode(tdbb, transaction, CLAUSE_DROP_DIFFERENCE); + + for (DbFileClause** i = files.begin(); i != files.end(); ++i) + { + DbFileClause* file = *i; + + start = MAX(start, file->start); + defineFile(tdbb, transaction, 0, false, false, dbAlloc, + file->name, start, file->length); + start += file->length; + } + + if (differenceFile.hasData()) + defineDifference(tdbb, transaction, differenceFile); + + if (setDefaultCharSet.hasData()) + { + //// TODO: Validate! + DBB.RDB$CHARACTER_SET_NAME.NULL = FALSE; + strcpy(DBB.RDB$CHARACTER_SET_NAME, setDefaultCharSet.c_str()); + } + + if (!DBB.RDB$CHARACTER_SET_NAME.NULL && setDefaultCollation.hasData()) + { + string sql; + sql.printf("alter character set \"%s\" set default collation \"%s\"", + PreparedStatement::escapeName(DBB.RDB$CHARACTER_SET_NAME).c_str(), + PreparedStatement::escapeName(setDefaultCollation).c_str()); + + AutoPtr<PreparedStatement> ps(attachment->prepareStatement(tdbb, transaction, sql)); + ps->execute(tdbb, transaction); + } + + if (clauses & CLAUSE_BEGIN_BACKUP) + changeBackupMode(tdbb, transaction, CLAUSE_BEGIN_BACKUP); + + if (clauses & CLAUSE_END_BACKUP) + changeBackupMode(tdbb, transaction, CLAUSE_END_BACKUP); + END_MODIFY + } + END_FOR + + savePoint.release(); // everything is ok +} + +// Drop backup difference file for the database, begin or end backup. +void AlterDatabaseNode::changeBackupMode(thread_db* tdbb, jrd_tra* transaction, unsigned clause) +{ + AutoCacheRequest request(tdbb, drq_d_difference, DYN_REQUESTS); + bool invalidState = false; + bool found = false; + + FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + X IN RDB$FILES + { + if (X.RDB$FILE_FLAGS & FILE_difference) + { + found = true; + + switch (clause) + { + case CLAUSE_DROP_DIFFERENCE: + ERASE X; + break; + + case CLAUSE_BEGIN_BACKUP: + if (X.RDB$FILE_FLAGS & FILE_backing_up) + invalidState = true; + else + { + MODIFY X USING + X.RDB$FILE_FLAGS |= FILE_backing_up; + END_MODIFY + } + break; + + case CLAUSE_END_BACKUP: + if (X.RDB$FILE_FLAGS & FILE_backing_up) + { + if (X.RDB$FILE_NAME.NULL) + ERASE X; + else + { + MODIFY X USING + X.RDB$FILE_FLAGS &= ~FILE_backing_up; + END_MODIFY + } + } + else + invalidState = true; + break; + } + } + } + END_FOR + + if (!found && clause == CLAUSE_BEGIN_BACKUP) + { + request.reset(tdbb, drq_s2_difference, DYN_REQUESTS); + + STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + X IN RDB$FILES + { + X.RDB$FILE_FLAGS = FILE_difference | FILE_backing_up; + X.RDB$FILE_START = 0; + } + END_STORE + + found = true; + } + + if (invalidState) + { + // msg 217: "Database is already in the physical backup mode" + // msg 218: "Database is not in the physical backup mode" + status_exception::raise( + Arg::Gds(ENCODE_ISC_MSG(clause == CLAUSE_BEGIN_BACKUP ? 217 : 218, DYN_MSG_FAC))); + } + + if (!found) + { + // msg 218: "Database is not in the physical backup mode" + // msg 215: "Difference file is not defined" + status_exception::raise( + Arg::Gds(ENCODE_ISC_MSG(clause == CLAUSE_END_BACKUP ? 218 : 215, DYN_MSG_FAC))); + } +} + +// Define backup difference file. +void AlterDatabaseNode::defineDifference(thread_db* tdbb, jrd_tra* transaction, const PathName& file) +{ + AutoCacheRequest request(tdbb, drq_l_difference, DYN_REQUESTS); + bool found = false; + + FOR(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + FIL IN RDB$FILES + { + if (FIL.RDB$FILE_FLAGS & FILE_difference) + found = true; + } + END_FOR + + if (found) + { + // msg 216: "Difference file is already defined" + status_exception::raise(Arg::Gds(ENCODE_ISC_MSG(216, DYN_MSG_FAC))); + } + + request.reset(tdbb, drq_s_difference, DYN_REQUESTS); + + STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + FIL IN RDB$FILES + { + if (file.length() >= sizeof(FIL.RDB$FILE_NAME)) + status_exception::raise(Arg::Gds(isc_dyn_name_longer)); + + strcpy(FIL.RDB$FILE_NAME, file.c_str()); + FIL.RDB$FILE_FLAGS = FILE_difference; + FIL.RDB$FILE_START = 0; + } + END_STORE +} + + } // namespace Jrd Modified: firebird/trunk/src/dsql/DdlNodes.h =================================================================== --- firebird/trunk/src/dsql/DdlNodes.h 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/dsql/DdlNodes.h 2011-11-22 16:33:25 UTC (rev 53641) @@ -42,13 +42,37 @@ class CompoundStmtNode; +class DbFileClause +{ +public: + DbFileClause(MemoryPool& p, const DbFileClause& o) + : name(p, o.name), + start(o.start), + length(o.length) + { + } + + explicit DbFileClause(MemoryPool& p, const Firebird::PathName& aName) + : name(p, aName), + start(0), + length(0) + { + } + +public: + Firebird::PathName name; // File name + SLONG start; // Starting page + SLONG length; // File length in pages +}; + + class ExternalClause { public: ExternalClause(MemoryPool& p, const ExternalClause& o) : name(p, o.name), engine(p, o.engine), - udfModule(p) + udfModule(p, o.udfModule) { } @@ -309,6 +333,34 @@ }; + + +class AlterExternalFunctionNode : public DdlNode +{ +public: + AlterExternalFunctionNode(MemoryPool& p, const Firebird::MetaName& aName) + : DdlNode(p), + name(p, aName), + clauses(p) + { + } + +public: + virtual void print(Firebird::string& text, Firebird::Array<dsql_nod*>& nodes) const; + virtual void execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction); + +protected: + virtual void putErrorPrefix(Firebird::Arg::StatusVector& statusVector) + { + statusVector << Firebird::Arg::Gds(isc_dsql_alter_func_failed) << name; + } + +public: + Firebird::MetaName name; + ExternalClause clauses; +}; + + class DropFunctionNode : public DdlNode { public: @@ -1245,6 +1297,57 @@ }; +class AlterIndexNode : public DdlNode +{ +public: + AlterIndexNode(MemoryPool& p, const Firebird::MetaName& aName, bool aActive) + : DdlNode(p), + name(p, aName), + active(aActive) + { + } + +public: + virtual void print(Firebird::string& text, Firebird::Array<dsql_nod*>& nodes) const; + virtual void execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction); + +protected: + virtual void putErrorPrefix(Firebird::Arg::StatusVector& statusVector) + { + statusVector << Firebird::Arg::Gds(isc_dsql_alter_index_failed) << name; + } + +public: + Firebird::MetaName name; + bool active; +}; + + +class SetStatisticsNode : public DdlNode +{ +public: + SetStatisticsNode(MemoryPool& p, const Firebird::MetaName& aName) + : DdlNode(p), + name(p, aName) + { + } + +public: + virtual void print(Firebird::string& text, Firebird::Array<dsql_nod*>& nodes) const; + virtual void execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction); + +protected: + virtual void putErrorPrefix(Firebird::Arg::StatusVector& statusVector) + { + // ASF: using ALTER INDEX's code. + statusVector << Firebird::Arg::Gds(isc_dsql_alter_index_failed) << name; + } + +public: + Firebird::MetaName name; +}; + + class DropIndexNode : public DdlNode { public: @@ -1296,6 +1399,37 @@ }; +class CreateShadowNode : public DdlNode +{ +public: + CreateShadowNode(MemoryPool& p, const SSHORT aNumber) + : DdlNode(p), + number(aNumber), + manual(false), + conditional(false), + files(p) + { + } + +public: + virtual void print(Firebird::string& text, Firebird::Array<dsql_nod*>& nodes) const; + virtual void execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction); + +protected: + virtual void putErrorPrefix(Firebird::Arg::StatusVector& statusVector) + { + statusVector << Firebird::Arg::Gds(isc_dsql_create_shadow_failed) << Firebird::Arg::Num(number); + } + +public: + SSHORT number; + bool manual; + bool conditional; + Nullable<SLONG> firstLength; + Firebird::Array<DbFileClause*> files; +}; + + class DropShadowNode : public DdlNode { public: @@ -1347,6 +1481,32 @@ }; +class AlterRoleNode : public DdlNode +{ +public: + AlterRoleNode(MemoryPool& p, const Firebird::MetaName& aName, bool aMap) + : DdlNode(p), + name(p, aName), + map(aMap) + { + } + +public: + virtual void print(Firebird::string& text, Firebird::Array<dsql_nod*>& nodes) const; + virtual void execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction); + +protected: + virtual void putErrorPrefix(Firebird::Arg::StatusVector& statusVector) + { + statusVector << Firebird::Arg::Gds(isc_dsql_alter_role_failed) << name; + } + +public: + Firebird::MetaName name; + bool map; +}; + + class DropRoleNode : public DdlNode { public: @@ -1395,6 +1555,58 @@ }; +class AlterDatabaseNode : public DdlNode +{ +public: + static const unsigned CLAUSE_BEGIN_BACKUP = 0x01; + static const unsigned CLAUSE_END_BACKUP = 0x02; + static const unsigned CLAUSE_DROP_DIFFERENCE = 0x04; + +public: + AlterDatabaseNode(MemoryPool& p) + : DdlNode(p), + create(false), + createLength(0), + clauses(0), + differenceFile(p), + setDefaultCharSet(p), + setDefaultCollation(p), + files(p) + { + } + +public: + virtual DdlNode* dsqlPass(DsqlCompilerScratch* dsqlScratch) + { + dsqlScratch->getStatement()->setType( + create ? DsqlCompiledStatement::TYPE_CREATE_DB : DsqlCompiledStatement::TYPE_DDL); + return this; + } + + virtual void print(Firebird::string& text, Firebird::Array<dsql_nod*>& nodes) const; + virtual void execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction); + +protected: + virtual void putErrorPrefix(Firebird::Arg::StatusVector& statusVector) + { + statusVector << Firebird::Arg::Gds(isc_dsql_alter_database_failed); + } + +private: + static void changeBackupMode(thread_db* tdbb, jrd_tra* transaction, unsigned clause); + static void defineDifference(thread_db* tdbb, jrd_tra* transaction, const Firebird::PathName& file); + +public: + bool create; // Is the node created with a CREATE DATABASE command? + SLONG createLength; + unsigned clauses; + Firebird::PathName differenceFile; + Firebird::MetaName setDefaultCharSet; + Firebird::MetaName setDefaultCollation; + Firebird::Array<DbFileClause*> files; +}; + + } // namespace #endif // DSQL_DDL_NODES_H Modified: firebird/trunk/src/dsql/Nodes.h =================================================================== --- firebird/trunk/src/dsql/Nodes.h 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/dsql/Nodes.h 2011-11-22 16:33:25 UTC (rev 53641) @@ -133,7 +133,9 @@ { using namespace Firebird; - dsqlScratch->setTransaction(transaction); + // dsqlScratch should be NULL with CREATE DATABASE. + if (dsqlScratch) + dsqlScratch->setTransaction(transaction); try { Modified: firebird/trunk/src/dsql/Parser.h =================================================================== --- firebird/trunk/src/dsql/Parser.h 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/dsql/Parser.h 2011-11-22 16:33:25 UTC (rev 53641) @@ -83,7 +83,6 @@ { // This is, in fact, parser state. Not used in lexer itself dsql_fld* g_field; - dsql_fil* g_file; dsql_nod* g_field_name; int dsql_debug; Modified: firebird/trunk/src/dsql/ddl.cpp =================================================================== --- firebird/trunk/src/dsql/ddl.cpp 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/dsql/ddl.cpp 2011-11-22 16:33:25 UTC (rev 53641) @@ -116,25 +116,18 @@ static void assign_field_length(dsql_fld*, USHORT); static void define_computed(DsqlCompilerScratch*, dsql_nod*, dsql_fld*, dsql_nod*); -static void define_database(DsqlCompilerScratch*); static void define_filter(DsqlCompilerScratch*); static SSHORT getBlobFilterSubType(DsqlCompilerScratch* dsqlScratch, const dsql_nod* node); static void define_index(DsqlCompilerScratch*); -static void define_shadow(DsqlCompilerScratch*); static void generate_dyn(DsqlCompilerScratch*, dsql_nod*); static void grant_revoke(DsqlCompilerScratch*); -static void modify_database(DsqlCompilerScratch*); -static void modify_index(DsqlCompilerScratch*); static void modify_privilege(DsqlCompilerScratch* dsqlScratch, NOD_TYPE type, SSHORT option, const UCHAR* privs, const dsql_nod* table, const dsql_nod* user, const dsql_nod* grantor, const dsql_str* field_name); static char modify_privileges(DsqlCompilerScratch*, NOD_TYPE, SSHORT, const dsql_nod*, const dsql_nod*, const dsql_nod*, const dsql_nod*); -static void modify_udf(DsqlCompilerScratch*); -static void modify_map(DsqlCompilerScratch*); static void process_role_nm_list(DsqlCompilerScratch*, SSHORT, const dsql_nod*, const dsql_nod*, NOD_TYPE, const dsql_nod*); -static void set_statistics(DsqlCompilerScratch*); static void define_user(DsqlCompilerScratch*, UCHAR); static void put_grantor(DsqlCompilerScratch* dsqlScratch, const dsql_nod* grantor); static void post_607(const Arg::StatusVector& v); @@ -177,17 +170,6 @@ const NOD_TYPE type = statement->getDdlNode()->nod_type; - switch (type) - { - case nod_del_udf: - case nod_mod_udf: - // Signal UDF for obsolescence - string = (dsql_str*) statement->getDdlNode()->nod_arg[e_udf_name]; - sym_type = SYM_udf; - METD_drop_function(request->getTransaction(), QualifiedName(string->str_data, "")); - break; - } - if (string) MET_dsql_cache_release(tdbb, sym_type, string->str_data); @@ -712,97 +694,6 @@ } -static void define_database(DsqlCompilerScratch* dsqlScratch) -{ -/************************************** - * - * d e f i n e _ d a t a b a s e - * - ************************************** - * - * Function - * Create a database. Assumes that - * database is created elsewhere with - * initial options. Modify the - * database using DYN to add the remaining - * options. - * - **************************************/ - SLONG start = 0; - - DsqlCompiledStatement* statement = dsqlScratch->getStatement(); - const dsql_nod* ddl_node = statement->getDdlNode(); - - dsqlScratch->appendUChar(isc_dyn_mod_database); - - // dsqlScratch->appendNumber(isc_dyn_rel_sql_protection, 1); - - const dsql_nod* elements = ddl_node->nod_arg[e_database_initial_desc]; - - if (elements) - { - const dsql_nod* const* ptr = elements->nod_arg; - for (const dsql_nod* const* const end = ptr + elements->nod_count; ptr < end; ptr++) - { - const dsql_nod* element = *ptr; - - switch (element->nod_type) - { - case nod_file_length: - start = (IPTR) element->nod_arg[0] + 1; - break; - - default: - break; - } - } - } - - const dsql_str* name; - const dsql_fil* file; - elements = ddl_node->nod_arg[e_database_rem_desc]; - if (elements) - { - const dsql_nod* const* ptr = elements->nod_arg; - for (const dsql_nod* const* const end = ptr + elements->nod_count; ptr < end; ptr++) - { - const dsql_nod* element = *ptr; - - switch (element->nod_type) - { - case nod_difference_file: - dsqlScratch->appendNullString(isc_dyn_def_difference, - ((dsql_str*) element->nod_arg[0])->str_data); - break; - case nod_file_desc: - file = (dsql_fil*) element->nod_arg[0]; - dsqlScratch->appendNullString(isc_dyn_def_file, file->fil_name->str_data); - - start = MAX(start, file->fil_start); - dsqlScratch->appendFileStart(start); - dsqlScratch->appendFileLength(file->fil_length); - dsqlScratch->appendUChar(isc_dyn_end); - start += file->fil_length; - break; - case nod_dfl_charset: - name = (dsql_str*) element->nod_arg[0]; - dsqlScratch->appendNullString(isc_dyn_fld_character_set_name, name->str_data); - break; - case nod_dfl_collate: - name = (dsql_str*) element->nod_arg[0]; - dsqlScratch->appendNullString(isc_dyn_fld_collation, name->str_data); - break; - - default: - break; - } - } - } - - dsqlScratch->appendUChar(isc_dyn_end); -} - - static SSHORT getBlobFilterSubType(DsqlCompilerScratch* dsqlScratch, const dsql_nod* node) { /******************************************* @@ -924,61 +815,6 @@ } -// -// create a shadow for the database -// -static void define_shadow(DsqlCompilerScratch* dsqlScratch) -{ - DsqlCompiledStatement* statement = dsqlScratch->getStatement(); - const dsql_nod* shadow_node = statement->getDdlNode(); - const dsql_nod* const* ptr = shadow_node->nod_arg; - - if (!ptr[e_shadow_number]) - { - post_607(Arg::Gds(isc_dsql_shadow_number_err)); - } - - dsqlScratch->appendNumber(isc_dyn_def_shadow, (SSHORT)(IPTR) (ptr[e_shadow_number])); - dsqlScratch->appendNullString(isc_dyn_def_file, ((dsql_str*) (ptr[e_shadow_name]))->str_data); - dsqlScratch->appendNumber(isc_dyn_shadow_man_auto, - (SSHORT) ExprNode::as<LiteralNode>(ptr[e_shadow_man_auto])->getSlong()); - dsqlScratch->appendNumber(isc_dyn_shadow_conditional, - (SSHORT) ExprNode::as<LiteralNode>(ptr[e_shadow_conditional])->getSlong()); - - dsqlScratch->appendFileStart(0); - - SLONG length = (IPTR) ptr[e_shadow_length]; - dsqlScratch->appendFileLength(length); - - dsqlScratch->appendUChar(isc_dyn_end); - const dsql_nod* elements = ptr[e_shadow_sec_files]; - if (elements) - { - ptr = elements->nod_arg; - for (const dsql_nod* const* const end = ptr + elements->nod_count; ptr < end; ++ptr) - { - const dsql_nod* element = *ptr; - const dsql_fil* file = (dsql_fil*) element->nod_arg[0]; - dsqlScratch->appendNullString(isc_dyn_def_file, file->fil_name->str_data); - - if (!length && !file->fil_start) - { - // Preceding file did not specify length, so %s must include starting page number - post_607(Arg::Gds(isc_dsql_file_length_err) << Arg::Str(file->fil_name->str_data)); - } - - const SLONG start = file->fil_start; - dsqlScratch->appendFileStart(start); - length = file->fil_length; - dsqlScratch->appendFileLength(length); - dsqlScratch->appendUChar(isc_dyn_end); - } - } - - dsqlScratch->appendUChar(isc_dyn_end); -} - - static void generate_dyn(DsqlCompilerScratch* dsqlScratch, dsql_nod* node) { /************************************** @@ -1009,40 +845,6 @@ define_filter(dsqlScratch); break; - case nod_del_udf: - string = (dsql_str*) node->nod_arg[0]; - dsqlScratch->appendNullString(isc_dyn_delete_function, string->str_data); - dsqlScratch->appendUChar(isc_dyn_end); - break; - - case nod_def_shadow: - define_shadow(dsqlScratch); - break; - - case nod_mod_database: - modify_database(dsqlScratch); - break; - - case nod_def_database: - define_database(dsqlScratch); - break; - - case nod_mod_index: - modify_index(dsqlScratch); - break; - - case nod_set_statistics: - set_statistics(dsqlScratch); - break; - - case nod_mod_udf: - modify_udf(dsqlScratch); - break; - - case nod_mod_role: - modify_map(dsqlScratch); - break; - case nod_add_user: define_user(dsqlScratch, isc_dyn_user_add); break; @@ -1143,113 +945,6 @@ } -static void modify_database( DsqlCompilerScratch* dsqlScratch) -{ -/************************************** - * - * m o d i f y _ d a t a b a s e - * - ************************************** - * - * Function - * Modify a database. - * - **************************************/ - DsqlCompiledStatement* statement = dsqlScratch->getStatement(); - const dsql_nod* ddl_node = statement->getDdlNode(); - - dsqlScratch->appendUChar(isc_dyn_mod_database); - // dsqlScratch->appendNumber(isc_dyn_rel_sql_protection, 1); - bool drop_difference = false; - - const dsql_nod* elements = ddl_node->nod_arg[e_adb_all]; - const dsql_nod* const* end = elements->nod_arg + elements->nod_count; - const dsql_nod* const* ptr; - - for (ptr = elements->nod_arg; ptr < end; ptr++) - { - const dsql_nod* element = *ptr; - if (element->nod_type == nod_drop_difference) - drop_difference = true; - } - - if (drop_difference) - dsqlScratch->appendUChar(isc_dyn_drop_difference); - - SLONG start = 0; - - elements = ddl_node->nod_arg[e_adb_all]; - end = elements->nod_arg + elements->nod_count; - for (ptr = elements->nod_arg; ptr < end; ptr++) - { - const dsql_fil* file; - const dsql_nod* element = *ptr; - - switch (element->nod_type) - { - case nod_file_desc: - file = (dsql_fil*) element->nod_arg[0]; - dsqlScratch->appendNullString(isc_dyn_def_file, file->fil_name->str_data); - - start = MAX(start, file->fil_start); - dsqlScratch->appendFileStart(start); - - dsqlScratch->appendFileLength(file->fil_length); - dsqlScratch->appendUChar(isc_dyn_end); - start += file->fil_length; - break; - case nod_difference_file: - dsqlScratch->appendNullString(isc_dyn_def_difference, - ((dsql_str*) element->nod_arg[0])->str_data); - break; - case nod_begin_backup: - dsqlScratch->appendUChar(isc_dyn_begin_backup); - break; - case nod_end_backup: - dsqlScratch->appendUChar(isc_dyn_end_backup); - break; - case nod_dfl_charset: - dsqlScratch->appendNullString(isc_dyn_fld_character_set_name, - ((dsql_str*) element->nod_arg[0])->str_data); - break; - default: - break; - } - } - - dsqlScratch->appendUChar(isc_dyn_end); -} - - -static void modify_index( DsqlCompilerScratch* dsqlScratch) -{ -/************************************** - * - * m o d i f y _ i n d e x - * - ************************************** - * - * Function - * Alter an index (only active or inactive for now) - * - **************************************/ - DsqlCompiledStatement* statement = dsqlScratch->getStatement(); - dsql_nod* ddl_node = statement->getDdlNode(); - - dsql_nod* index_node = ddl_node->nod_arg[e_alt_index]; - const dsql_str* index_name = (dsql_str*) index_node->nod_arg[e_alt_idx_name]; - - dsqlScratch->appendNullString(isc_dyn_mod_idx, index_name->str_data); - - if (index_node->nod_type == nod_idx_active) - dsqlScratch->appendNumber(isc_dyn_idx_inactive, 0); - else if (index_node->nod_type == nod_idx_inactive) - dsqlScratch->appendNumber(isc_dyn_idx_inactive, 1); - - dsqlScratch->appendUChar(isc_dyn_end); -} - - static void put_user_grant(DsqlCompilerScratch* dsqlScratch, const dsql_nod* user) { /************************************** @@ -1477,68 +1172,6 @@ } -// ******************* -// m o d i f y _ u d f -// ******************* -// Allow the user to change the entry point or module name. -// Useful when there are dependencies on the udf, so it cannot be dropped. -static void modify_udf(DsqlCompilerScratch* dsqlScratch) -{ - DsqlCompiledStatement* statement = dsqlScratch->getStatement(); - - const dsql_nod* node = statement->getDdlNode(); - fb_assert(node->nod_type == nod_mod_udf); - const dsql_str* obj_name = (dsql_str*) node->nod_arg[e_mod_udf_name]; - - if (!node->nod_arg[e_mod_udf_entry_pt] && !node->nod_arg[e_mod_udf_module]) - { - ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-104) << - // Unexpected end of command - Arg::Gds(isc_command_end_err2) << Arg::Num(node->nod_line) << - Arg::Num(node->nod_column + obj_name->str_length)); - // + strlen("FUNCTION") - } - - dsqlScratch->appendNullString(isc_dyn_mod_function, obj_name->str_data); - - const dsql_str* entry_point_name = (dsql_str*) node->nod_arg[e_mod_udf_entry_pt]; - if (entry_point_name) - dsqlScratch->appendNullString(isc_dyn_func_entry_point, entry_point_name->str_data); - - const dsql_str* module_name = (dsql_str*) node->nod_arg[e_mod_udf_module]; - if (module_name) - dsqlScratch->appendNullString(isc_dyn_func_module_name, module_name->str_data); - - dsqlScratch->appendUChar(isc_dyn_end); -} - - -// ******************* -// m o d i f y _ m a p -// ******************* -// Allow the user to establish/drop the mapping between OS security object and the role -static void modify_map(DsqlCompilerScratch* dsqlScratch) -{ - DsqlCompiledStatement* statement = dsqlScratch->getStatement(); - - const dsql_nod* node = statement->getDdlNode(); - fb_assert(node->nod_type == nod_mod_role); - - const dsql_str* ds = (dsql_str*) node->nod_arg[e_mod_role_os_name]; - fb_assert(ds || - ExprNode::as<LiteralNode>(node->nod_arg[e_mod_role_action])->getSlong() == isc_dyn_automap_role || - ExprNode::as<LiteralNode>(node->nod_arg[e_mod_role_action])->getSlong() == isc_dyn_autounmap_role); - dsqlScratch->appendNullString(isc_dyn_mapping, ds ? ds->str_data : ""); - - ds = (dsql_str*) node->nod_arg[e_mod_role_db_name]; - fb_assert(ds); - dsqlScratch->appendNullString( - ExprNode::as<LiteralNode>(node->nod_arg[e_mod_role_action])->getSlong(), ds->str_data); - - dsqlScratch->appendUChar(isc_dyn_end); -} - - // ********************* // d e f i n e _ u s e r // ********************* @@ -1692,27 +1325,6 @@ } -static void set_statistics(DsqlCompilerScratch* dsqlScratch) -{ -/************************************** - * - * s e t _ s t a t i s t i c s - * - ************************************** - * - * Function - * Alter an index/.. statistics - * - **************************************/ - DsqlCompiledStatement* statement = dsqlScratch->getStatement(); - const dsql_nod* ddl_node = statement->getDdlNode(); - const dsql_str* index_name = (dsql_str*) ddl_node->nod_arg[e_stat_name]; - dsqlScratch->appendNullString(isc_dyn_mod_idx, index_name->str_data); - dsqlScratch->appendUChar(isc_dyn_idx_statistic); - dsqlScratch->appendUChar(isc_dyn_end); -} - - // post very often used error - avoid code duplication static void post_607(const Arg::StatusVector& v) { Modified: firebird/trunk/src/dsql/dsql.h =================================================================== --- firebird/trunk/src/dsql/dsql.h 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/dsql/dsql.h 2011-11-22 16:33:25 UTC (rev 53641) @@ -280,20 +280,6 @@ FLD_system = 8 }; -//! database/log/cache file block -class dsql_fil : public pool_alloc<dsql_type_fil> -{ -public: - SLONG fil_length; // File length in pages - SLONG fil_start; // Starting page - dsql_str* fil_name; // File name - //dsql_fil* fil_next; // next file - //SSHORT fil_shadow_number; // shadow number if part of shadow - //SSHORT fil_manual; // flag to indicate manual shadow - //SSHORT fil_partitions; // number of log file partitions - //USHORT fil_flags; -}; - //! Stored Procedure block class dsql_prc : public pool_alloc<dsql_type_prc> { Modified: firebird/trunk/src/dsql/node.h =================================================================== --- firebird/trunk/src/dsql/node.h 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/dsql/node.h 2011-11-22 16:33:25 UTC (rev 53641) @@ -60,17 +60,13 @@ nod_trans, nod_def_default, nod_del_default, - nod_def_database, nod_def_domain, - nod_mod_database, nod_def_field, nod_mod_field, nod_del_field, nod_def_index, nod_def_constraint, nod_def_filter, - nod_def_shadow, - nod_del_udf, nod_grant, nod_revoke, nod_rel_constraint, @@ -110,25 +106,16 @@ nod_lock_mode, nod_reserve, nod_retain, - nod_page_size, - nod_file_length, - nod_file_desc, - nod_dfl_charset, - nod_password, - nod_lc_ctype, // SET NAMES - nod_udf_return_value, nod_def_computed, nod_plan_expr, nod_plan_item, nod_natural, nod_index, nod_index_order, - nod_mod_index, // alter index nod_idx_active, nod_idx_inactive, nod_restrict, // drop behaviour nod_cascade, - nod_set_statistics, // set statistics nod_ref_upd_del, // referential integrity actions nod_ref_trig_action, nod_role_name, @@ -136,22 +123,14 @@ nod_mod_field_name, nod_mod_field_type, nod_mod_field_pos, - nod_udf_param, // there should be a way to signal a param by descriptor! nod_for_update, // FOR UPDATE clause nod_label, // label support - nod_difference_file, - nod_drop_difference, - nod_begin_backup, - nod_end_backup, nod_rows, // ROWS support - nod_mod_udf, nod_tra_misc, nod_lock_timeout, nod_with, - nod_mod_role, nod_add_user, nod_mod_user, - nod_dfl_collate, nod_trg_act, nod_trg_ext, nod_class_stmtnode, @@ -287,20 +266,12 @@ e_lock_tables = 0, // e_lock_mode, - e_database_name = 0, // - e_database_initial_desc, - e_database_rem_desc, - e_cdb_count, - e_commit_retain = 0, // e_commit_count, e_rollback_retain = 0, // e_rollback_count, - e_adb_all = 0, // - e_adb_count, - e_filter_name = 0, // e_filter_in_type, e_filter_out_type, @@ -308,37 +279,11 @@ e_filter_module, e_filter_count, - e_udf_name = 0, // - e_udf_count, - // computed field e_cmp_expr = 0, e_cmp_text, - // create shadow - - e_shadow_number = 0, - e_shadow_man_auto, - e_shadow_conditional, - e_shadow_name, - e_shadow_length, - e_shadow_sec_files, - e_shadow_count, - - // alter index - - e_alt_index = 0, - e_mod_idx_count, - - e_alt_idx_name = 0, - e_alt_idx_name_count, - - // set statistics - - e_stat_name = 0, - e_stat_count, - e_mod_fld_name_orig_name = 0, // nod_mod_field_name e_mod_fld_name_new_name, e_mod_fld_name_count, @@ -353,24 +298,10 @@ e_mod_fld_pos_new_position, e_mod_fld_pos_count, - e_udf_param_field = 0, - e_udf_param_type, // Basically, by_reference or by_descriptor - e_udf_param_count, - e_label_name = 0, e_label_number, e_label_count, - e_mod_udf_name = 0, // nod_mod_udf - e_mod_udf_entry_pt, - e_mod_udf_module, - e_mod_udf_count, - - e_mod_role_os_name = 0, // nod_mod_role - e_mod_role_db_name, - e_mod_role_action, // 0 - drop, 1 - add - e_mod_role_count, - e_user_name = 0, // nod_add(mod)_user e_user_passwd, e_user_first, Modified: firebird/trunk/src/dsql/parse.y =================================================================== --- firebird/trunk/src/dsql/parse.y 2011-11-20 09:45:00 UTC (rev 53640) +++ firebird/trunk/src/dsql/parse.y 2011-11-22 16:33:25 UTC (rev 53641) @@ -137,12 +137,12 @@ static bool long_int(dsql_nod*, SLONG*); #endif static dsql_fld* make_field (dsql_nod*); -static dsql_fil* make_file(); #ifdef NOT_USED_OR_REPLACED static bool short_int(dsql_nod*, SLONG*, SSHORT); #endif static void stack_nodes (dsql_nod*, DsqlNodStack&); static Firebird::MetaName toName(dsql_nod* node); +static Firebird::PathName toPathName(dsql_str* node); static Firebird::string toString(dsql_str* node); static void yyabandon (SLONG, ISC_STATUS); @@ -633,8 +633,11 @@ Jrd::ReturningClause* returningClause; Firebird::PathName* pathNamePtr; TEXT* textPtr; + Jrd::DbFileClause* dbFileClause; + Firebird::Array<Jrd::DbFileClause*>* dbFilesClause; Jrd::ExternalClause* externalClause; Firebird::Array<Jrd::ParameterClause>* parametersClause; + Jrd::Node* node; Jrd::ExprNode* exprNode; Jrd::BoolExprNode* boolExprNode; Jrd::StmtNode* stmtNode; @@ -647,12 +650,14 @@ Jrd::CreateAlterTriggerNode* createAlterTriggerNode; Jrd::CreateAlterPackageNode* createAlterPackageNode; Jrd::CreateSequenceNode* createSequenceNode; + Jrd::CreateShadowNode* createShadowNode; Firebird::Array<Jrd::CreateAlterPackageNode::Item>* packageItems; Jrd::ExceptionArray* exceptionArray; Jrd::CreateAlterPackageNode::Item packageItem; Jrd::CreatePackageBodyNode* createPackageBodyNode; Jrd::CreateRelationNode* createRelationNode; Jrd::CreateAlterViewNode* createAlterViewNode; + Jrd::AlterDatabaseNode* alterDatabaseNode; Jrd::ExecBlockNode* execBlockNode; Jrd::AggNode* aggNode; Jrd::SysFuncCallNode* sysFuncCallNode; @@ -668,11 +673,15 @@ %type <legacyNode> access_mode access_type alias_list %type <legacyNode> alter alter_clause alter_column_name -%type <legacyNode> alter_data_type_or_domain alter_db -%type <legacyNode> alter_exception_clause alter_index_clause alter_op alter_ops -%type <legacyNode> alter_role_clause alter_role_enable alter_sequence_clause -%type <legacyNode> alter_udf_clause alter_user_clause alter_view_clause +%type <legacyNode> alter_data_type_or_domain +%type <legacyNode> alter_op alter_ops +%type <stmtNode> alter_sequence_clause +%type <legacyNode> alter_user_clause %type <legacyNode> array_element array_range +%type <ddlNode> alter_exception_clause alter_index_clause alter_role_clause alter_udf_clause +%type <ddlNode> alter_view_clause +%type <boolVal> alter_role_enable +%type alter_db(<alterDatabaseNode>) %type arg_desc_list1(<parametersClause>) arg_desc_list(<parametersClause>) %type arg_desc(<parametersClause>) @@ -699,7 +708,8 @@ %type <legacyNode> column_list column_name column_parens column_parens_opt column_select %type <legacyNode> column_singleton commit %type <stmtNode> complex_proc_statement -%type <legacyNode> computed_by computed_clause conditional constant constraint_index_opt +%type <legacyNode> computed_by computed_clause constant constraint_index_opt +%type <boolVal> conditional %type <legacyNode> constraint_name_opt correlation_name create %type <legacyNode> create_clause create_user_clause cross_join %type <legacyNode> cursor_clause cursor_def @@ -707,8 +717,13 @@ %type <stmtNode> cursor_declaration_item continue cursor_statement %type <legacyNode> data_type data_type_or_domain -%type <legacyNode> db_alter_clause db_clause db_file db_file_list db_initial_desc db_initial_desc1 -%type <legacyNode> db_initial_option db_rem_desc db_rem_desc1 db_rem_option ddl_subname +%type db_initial_desc(<alterDatabaseNode>) db_initial_desc1(<alterDatabaseNode>) +%type db_initial_option(<alterDatabaseNode>) db_rem_desc(<alterDatabaseNode>) +%type db_rem_desc1(<alterDatabaseNode>) db_rem_option(<alterDatabaseNode>) +%type <alterDatabaseNode> db_clause +%type <dbFileClause> db_file +%type db_file_list(<dbFilesClause>) +%type <legacyNode> ddl_subname %type <legacyNode> decimal_keyword declare declare_clause %type <legacyNode> decode_pairs def_computed default_par_opt default_value %type <stmtNode> delete delete_positioned delete_searched @@ -718,6 +733,7 @@ %type <legacyNode> domain_or_non_array_type_name domain_type drop_behaviour %type <ddlNode> drop drop_clause %type <legacyStr> db_name ddl_desc +%type db_alter_clause(<alt... [truncated message content] |
From: <fir...@us...> - 2011-11-23 03:20:49
|
Revision: 53642 http://firebird.svn.sourceforge.net/firebird/?rev=53642&view=rev Author: firebirds Date: 2011-11-23 03:20:41 +0000 (Wed, 23 Nov 2011) 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 2011-11-22 16:33:25 UTC (rev 53641) +++ firebird/trunk/ChangeLog 2011-11-23 03:20:41 UTC (rev 53642) @@ -1,3 +1,40 @@ + 2011-11-22 16:33 asfernandes + M builds/win32/msvc10/engine.vcxproj + M builds/win32/msvc10/engine.vcxproj.filters + M builds/win32/msvc8/engine.vcproj + M builds/win32/msvc9/engine.vcproj + M builds/win32/preprocess.bat + M lang_helpers/gds_codes.ftn + M lang_helpers/gds_codes.pas + M src/common/classes/MetaName.h + M src/dsql/BlrWriter.cpp + M src/dsql/BlrWriter.h + M src/dsql/DdlNodes.epp + M src/dsql/DdlNodes.h + M src/dsql/Nodes.h + M src/dsql/Parser.h + M src/dsql/ddl.cpp + M src/dsql/dsql.h + M src/dsql/node.h + M src/dsql/parse.y + M src/dsql/pass1.cpp + M src/include/gen/codetext.h + M src/include/gen/iberror.h + M src/include/gen/msgs.h + M src/include/gen/sql_code.h + M src/include/gen/sql_state.h + M src/jrd/drq.h + M src/jrd/dyn.epp + M src/jrd/dyn_def.epp + M src/jrd/dyn_df_proto.h + D src/jrd/dyn_md_proto.h + D src/jrd/dyn_mod.epp + M src/jrd/dyn_util.epp + M src/msgs/facilities2.sql + M src/msgs/messages2.sql + M src/msgs/system_errors2.sql +DDL refactor: ALTER EXTERNAL FUNCTION, ALTER INDEX, SET STATISTICS, CREATE SHADOW, ALTER ROLE, CREATE/ALTER DATABASE. + 2011-11-18 01:07 asfernandes M src/burp/backup.epp M src/burp/canonical.cpp Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-11-22 16:33:25 UTC (rev 53641) +++ firebird/trunk/src/jrd/build_no.h 2011-11-23 03:20:41 UTC (rev 53642) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29618 + FORMAL BUILD NUMBER:29619 */ -#define PRODUCT_VER_STRING "3.0.0.29618" -#define FILE_VER_STRING "WI-T3.0.0.29618" -#define LICENSE_VER_STRING "WI-T3.0.0.29618" -#define FILE_VER_NUMBER 3, 0, 0, 29618 +#define PRODUCT_VER_STRING "3.0.0.29619" +#define FILE_VER_STRING "WI-T3.0.0.29619" +#define LICENSE_VER_STRING "WI-T3.0.0.29619" +#define FILE_VER_NUMBER 3, 0, 0, 29619 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29618" +#define FB_BUILD_NO "29619" #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 2011-11-22 16:33:25 UTC (rev 53641) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-11-23 03:20:41 UTC (rev 53642) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29618 +BuildNum=29619 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-11-24 03:20:25
|
Revision: 53644 http://firebird.svn.sourceforge.net/firebird/?rev=53644&view=rev Author: firebirds Date: 2011-11-24 03:20:18 +0000 (Thu, 24 Nov 2011) 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 2011-11-24 00:17:29 UTC (rev 53643) +++ firebird/trunk/ChangeLog 2011-11-24 03:20:18 UTC (rev 53644) @@ -1,3 +1,10 @@ + 2011-11-24 00:17 asfernandes + M src/dsql/DdlNodes.h + M src/dsql/ddl.cpp + M src/dsql/node.h + M src/dsql/pass1.cpp +Misc. + 2011-11-22 16:33 asfernandes M builds/win32/msvc10/engine.vcxproj M builds/win32/msvc10/engine.vcxproj.filters Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-11-24 00:17:29 UTC (rev 53643) +++ firebird/trunk/src/jrd/build_no.h 2011-11-24 03:20:18 UTC (rev 53644) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29619 + FORMAL BUILD NUMBER:29620 */ -#define PRODUCT_VER_STRING "3.0.0.29619" -#define FILE_VER_STRING "WI-T3.0.0.29619" -#define LICENSE_VER_STRING "WI-T3.0.0.29619" -#define FILE_VER_NUMBER 3, 0, 0, 29619 +#define PRODUCT_VER_STRING "3.0.0.29620" +#define FILE_VER_STRING "WI-T3.0.0.29620" +#define LICENSE_VER_STRING "WI-T3.0.0.29620" +#define FILE_VER_NUMBER 3, 0, 0, 29620 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29619" +#define FB_BUILD_NO "29620" #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 2011-11-24 00:17:29 UTC (rev 53643) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-11-24 03:20:18 UTC (rev 53644) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29619 +BuildNum=29620 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <asf...@us...> - 2011-11-27 19:08:15
|
Revision: 53645 http://firebird.svn.sourceforge.net/firebird/?rev=53645&view=rev Author: asfernandes Date: 2011-11-27 19:08:06 +0000 (Sun, 27 Nov 2011) Log Message: ----------- Refactored CREATE FILTER and CREATE INDEX. Modified Paths: -------------- firebird/trunk/builds/win32/msvc10/engine.vcxproj firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters firebird/trunk/builds/win32/msvc8/engine.vcproj firebird/trunk/builds/win32/msvc9/engine.vcproj firebird/trunk/builds/win32/preprocess.bat 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/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/dyn.epp firebird/trunk/src/jrd/dyn.h firebird/trunk/src/msgs/facilities2.sql firebird/trunk/src/msgs/messages2.sql firebird/trunk/src/msgs/system_errors2.sql Removed Paths: ------------- firebird/trunk/src/jrd/dyn_def.epp firebird/trunk/src/jrd/dyn_df_proto.h Modified: firebird/trunk/builds/win32/msvc10/engine.vcxproj =================================================================== --- firebird/trunk/builds/win32/msvc10/engine.vcxproj 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/builds/win32/msvc10/engine.vcxproj 2011-11-27 19:08:06 UTC (rev 53645) @@ -25,7 +25,6 @@ <ClCompile Include="..\..\..\gen\jrd\dfw.cpp" /> <ClCompile Include="..\..\..\gen\jrd\dpm.cpp" /> <ClCompile Include="..\..\..\gen\jrd\dyn.cpp" /> - <ClCompile Include="..\..\..\gen\jrd\dyn_def.cpp" /> <ClCompile Include="..\..\..\gen\jrd\dyn_util.cpp" /> <ClCompile Include="..\..\..\gen\jrd\fun.cpp" /> <ClCompile Include="..\..\..\gen\jrd\Function.cpp" /> @@ -217,7 +216,6 @@ <ClInclude Include="..\..\..\src\jrd\dpm_proto.h" /> <ClInclude Include="..\..\..\src\jrd\drq.h" /> <ClInclude Include="..\..\..\src\jrd\dyn.h" /> - <ClInclude Include="..\..\..\src\jrd\dyn_df_proto.h" /> <ClInclude Include="..\..\..\src\jrd\dyn_proto.h" /> <ClInclude Include="..\..\..\src\jrd\dyn_ut_proto.h" /> <ClInclude Include="..\..\..\src\jrd\ErrorImpl.h" /> @@ -348,7 +346,6 @@ <None Include="..\..\..\src\jrd\dfw.epp" /> <None Include="..\..\..\src\jrd\dpm.epp" /> <None Include="..\..\..\src\jrd\dyn.epp" /> - <None Include="..\..\..\src\jrd\dyn_def.epp" /> <None Include="..\..\..\src\jrd\dyn_util.epp" /> <None Include="..\..\..\src\jrd\fun.epp" /> <None Include="..\..\..\src\jrd\Function.epp" /> Modified: firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters =================================================================== --- firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/builds/win32/msvc10/engine.vcxproj.filters 2011-11-27 19:08:06 UTC (rev 53645) @@ -414,9 +414,6 @@ <ClCompile Include="..\..\..\gen\jrd\dyn.cpp"> <Filter>JRD files\GPRE cpp</Filter> </ClCompile> - <ClCompile Include="..\..\..\gen\jrd\dyn_def.cpp"> - <Filter>JRD files\GPRE cpp</Filter> - </ClCompile> <ClCompile Include="..\..\..\gen\jrd\dyn_util.cpp"> <Filter>JRD files\GPRE cpp</Filter> </ClCompile> @@ -677,9 +674,6 @@ <ClInclude Include="..\..\..\src\jrd\dyn.h"> <Filter>Header files</Filter> </ClInclude> - <ClInclude Include="..\..\..\src\jrd\dyn_df_proto.h"> - <Filter>Header files</Filter> - </ClInclude> <ClInclude Include="..\..\..\src\jrd\dyn_proto.h"> <Filter>Header files</Filter> </ClInclude> @@ -1012,9 +1006,6 @@ <None Include="..\..\..\src\jrd\dyn.epp"> <Filter>JRD files\GPRE files</Filter> </None> - <None Include="..\..\..\src\jrd\dyn_def.epp"> - <Filter>JRD files\GPRE files</Filter> - </None> <None Include="..\..\..\src\jrd\dyn_util.epp"> <Filter>JRD files\GPRE files</Filter> </None> Modified: firebird/trunk/builds/win32/msvc8/engine.vcproj =================================================================== --- firebird/trunk/builds/win32/msvc8/engine.vcproj 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/builds/win32/msvc8/engine.vcproj 2011-11-27 19:08:06 UTC (rev 53645) @@ -727,10 +727,6 @@ > </File> <File - RelativePath="..\..\..\gen\jrd\dyn_def.cpp" - > - </File> - <File RelativePath="..\..\..\gen\jrd\dyn_del.cpp" > </File> @@ -783,10 +779,6 @@ > </File> <File - RelativePath="..\..\..\src\jrd\dyn_def.epp" - > - </File> - <File RelativePath="..\..\..\src\jrd\dyn_del.epp" > </File> @@ -1032,10 +1024,6 @@ > </File> <File - RelativePath="..\..\..\src\jrd\dyn_df_proto.h" - > - </File> - <File RelativePath="..\..\..\src\jrd\dyn_dl_proto.h" > </File> Modified: firebird/trunk/builds/win32/msvc9/engine.vcproj =================================================================== --- firebird/trunk/builds/win32/msvc9/engine.vcproj 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/builds/win32/msvc9/engine.vcproj 2011-11-27 19:08:06 UTC (rev 53645) @@ -727,10 +727,6 @@ > </File> <File - RelativePath="..\..\..\gen\jrd\dyn_def.cpp" - > - </File> - <File RelativePath="..\..\..\gen\jrd\dyn_util.cpp" > </File> @@ -779,10 +775,6 @@ > </File> <File - RelativePath="..\..\..\src\jrd\dyn_def.epp" - > - </File> - <File RelativePath="..\..\..\src\jrd\dyn_util.epp" > </File> @@ -1024,10 +1016,6 @@ > </File> <File - RelativePath="..\..\..\src\jrd\dyn_df_proto.h" - > - </File> - <File RelativePath="..\..\..\src\jrd\dyn_proto.h" > </File> Modified: firebird/trunk/builds/win32/preprocess.bat =================================================================== --- firebird/trunk/builds/win32/preprocess.bat 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/builds/win32/preprocess.bat 2011-11-27 19:08:06 UTC (rev 53645) @@ -67,7 +67,7 @@ @for %%i in (array, blob) do @call :PREPROCESS yvalve %%i @for %%i in (metd, DdlNodes, PackageNodes) do @call :PREPROCESS dsql %%i -gds_cxx @for %%i in (gpre_meta) do @call :PREPROCESS gpre/std %%i -@for %%i in (dfw, dpm, dyn, dyn_def, dyn_util, fun, grant, ini, met, pcmet, scl, Function) do @call :PREPROCESS jrd %%i -gds_cxx +@for %%i in (dfw, dpm, dyn, dyn_util, fun, grant, ini, met, pcmet, scl, Function) do @call :PREPROCESS jrd %%i -gds_cxx @for %%i in (stats) do @call :PREPROCESS utilities %%i @goto :EOF @@ -81,7 +81,7 @@ @for %%i in (metd) do @call :PREPROCESS dsql %%i -gds_cxx @for %%i in (DdlNodes, PackageNodes) do @call :PREPROCESS dsql %%i -gds_cxx @for %%i in (gpre_meta) do @call :PREPROCESS gpre/std %%i -@for %%i in (dfw, dpm, dyn, dyn_def, dyn_util, fun, grant, ini, met, pcmet, scl, Function) do @call :PREPROCESS jrd %%i -gds_cxx +@for %%i in (dfw, dpm, dyn, dyn_util, fun, grant, ini, met, pcmet, scl, Function) do @call :PREPROCESS jrd %%i -gds_cxx @for %%i in (codes) do @call :PREPROCESS misc %%i @for %%i in (build_file) do @call :PREPROCESS msgs %%i @for %%i in (help, meta, proc, show) do @call :PREPROCESS qli %%i Modified: firebird/trunk/lang_helpers/gds_codes.ftn =================================================================== --- firebird/trunk/lang_helpers/gds_codes.ftn 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/lang_helpers/gds_codes.ftn 2011-11-27 19:08:06 UTC (rev 53645) @@ -2138,6 +2138,10 @@ PARAMETER (GDS__dsql_alter_database_failed = 336397313) INTEGER*4 GDS__dsql_create_shadow_failed PARAMETER (GDS__dsql_create_shadow_failed = 336397314) + INTEGER*4 GDS__dsql_create_filter_failed + PARAMETER (GDS__dsql_create_filter_failed = 336397315) + INTEGER*4 GDS__dsql_create_index_failed + PARAMETER (GDS__dsql_create_index_failed = 336397316) 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 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/lang_helpers/gds_codes.pas 2011-11-27 19:08:06 UTC (rev 53645) @@ -1076,6 +1076,8 @@ gds_dsql_alter_index_failed = 336397312; gds_dsql_alter_database_failed = 336397313; gds_dsql_create_shadow_failed = 336397314; + gds_dsql_create_filter_failed = 336397315; + gds_dsql_create_index_failed = 336397316; 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 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/dsql/DdlNodes.epp 2011-11-27 19:08:06 UTC (rev 53645) @@ -34,6 +34,7 @@ #include "../jrd/jrd.h" #include "../jrd/msg_encode.h" #include "../jrd/obj.h" +#include "../jrd/ods.h" #include "../jrd/tra.h" #include "../common/os/path_utils.h" #include "../jrd/IntlManager.h" @@ -92,6 +93,8 @@ 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 defineComputed(DsqlCompilerScratch* dsqlScratch, dsql_nod* relation, dsql_fld* field, + dsql_nod* node, string& source, BlrWriter::BlrData& value); static void deleteKeyConstraint(thread_db* tdbb, jrd_tra* transaction, const MetaName& relationName, const MetaName& constraintName, const MetaName& indexName); static void defineFile(thread_db* tdbb, jrd_tra* transaction, SLONG shadowNumber, bool manualShadow, @@ -286,6 +289,94 @@ } } +// Define a COMPUTED BY clause, for a field or an index. +void defineComputed(DsqlCompilerScratch* dsqlScratch, dsql_nod* relation, dsql_fld* field, + dsql_nod* node, string& source, BlrWriter::BlrData& value) +{ + AutoSetRestore2<dsql_nod*, DsqlCompiledStatement> autoDdlNode(dsqlScratch->getStatement(), + &DsqlCompiledStatement::getDdlNode, &DsqlCompiledStatement::setDdlNode, node); + + // Get the table node and set up correct context. + DDL_reset_context_stack(dsqlScratch); + + // Save the size of the field if it is specified. + dsc saveDesc; + saveDesc.dsc_dtype = 0; + + if (field && field->fld_dtype) + { + fb_assert(field->fld_dtype <= MAX_UCHAR); + saveDesc.dsc_dtype = (UCHAR) field->fld_dtype; + saveDesc.dsc_length = field->fld_length; + fb_assert(field->fld_scale <= MAX_SCHAR); + saveDesc.dsc_scale = (SCHAR) field->fld_scale; + saveDesc.dsc_sub_type = field->fld_sub_type; + + field->fld_dtype = 0; + field->fld_length = 0; + field->fld_scale = 0; + field->fld_sub_type = 0; + } + + PASS1_make_context(dsqlScratch, relation); + + dsql_nod* input = PASS1_node(dsqlScratch, node->nod_arg[Dsql::e_cmp_expr]); + + // Try to calculate size of the computed field. The calculated size + // may be ignored, but it will catch self references. + dsc desc; + MAKE_desc(dsqlScratch, &desc, input); + + // Generate the blr expression. + + dsqlScratch->getBlrData().clear(); + dsqlScratch->getDebugData().clear(); + dsqlScratch->appendUChar(dsqlScratch->isVersion4() ? blr_version4 : blr_version5); + + GEN_expr(dsqlScratch, input); + dsqlScratch->appendUChar(blr_eoc); + + if (saveDesc.dsc_dtype) + { + // Restore the field size/type overrides. + field->fld_dtype = saveDesc.dsc_dtype; + field->fld_length = saveDesc.dsc_length; + field->fld_scale = saveDesc.dsc_scale; + + if (field->fld_dtype <= dtype_any_text) + { + field->fld_character_set_id = DSC_GET_CHARSET(&saveDesc); + field->fld_collation_id= DSC_GET_COLLATE(&saveDesc); + } + else + field->fld_sub_type = saveDesc.dsc_sub_type; + } + else if (field) + { + // Use size calculated. + field->fld_dtype = desc.dsc_dtype; + field->fld_length = desc.dsc_length; + field->fld_scale = desc.dsc_scale; + + if (field->fld_dtype <= dtype_any_text) + { + field->fld_character_set_id = DSC_GET_CHARSET(&desc); + field->fld_collation_id = DSC_GET_COLLATE(&desc); + } + else + field->fld_sub_type = desc.dsc_sub_type; + } + + DDL_reset_context_stack(dsqlScratch); + + // Generate the source text. + const dsql_str* sourceStr = (dsql_str*) node->nod_arg[Dsql::e_cmp_text]; + fb_assert(sourceStr->str_length <= MAX_USHORT); + source = string(sourceStr->str_data, sourceStr->str_length); + + value.assign(dsqlScratch->getBlrData()); +} + // Delete a record from RDB$RELATION_CONSTRAINTS based on a constraint name. // // On deleting from RDB$RELATION_CONSTRAINTS, 2 system triggers fire: @@ -5357,7 +5448,7 @@ { field->fld_flags |= FLD_computed; - defineComputed(tdbb, dsqlScratch, field, element->nod_arg[e_dfl_computed], + defineComputed(dsqlScratch, dsqlNode, field, element->nod_arg[e_dfl_computed], computedSource, computedValue); } @@ -5443,94 +5534,6 @@ clearPermanentField(relation, permanent); } -// Define a COMPUTED BY clause. -void RelationNode::defineComputed(thread_db* /*tdbb*/, DsqlCompilerScratch* dsqlScratch, - dsql_fld* field, dsql_nod* node, string& source, BlrWriter::BlrData& value) -{ - AutoSetRestore2<dsql_nod*, DsqlCompiledStatement> autoDdlNode(dsqlScratch->getStatement(), - &DsqlCompiledStatement::getDdlNode, &DsqlCompiledStatement::setDdlNode, node); - - // Get the table node and set up correct context. - DDL_reset_context_stack(dsqlScratch); - - // Save the size of the field if it is specified. - dsc saveDesc; - saveDesc.dsc_dtype = 0; - - if (field && field->fld_dtype) - { - fb_assert(field->fld_dtype <= MAX_UCHAR); - saveDesc.dsc_dtype = (UCHAR) field->fld_dtype; - saveDesc.dsc_length = field->fld_length; - fb_assert(field->fld_scale <= MAX_SCHAR); - saveDesc.dsc_scale = (SCHAR) field->fld_scale; - saveDesc.dsc_sub_type = field->fld_sub_type; - - field->fld_dtype = 0; - field->fld_length = 0; - field->fld_scale = 0; - field->fld_sub_type = 0; - } - - PASS1_make_context(dsqlScratch, dsqlNode); - - dsql_nod* input = PASS1_node(dsqlScratch, node->nod_arg[Dsql::e_cmp_expr]); - - // Try to calculate size of the computed field. The calculated size - // may be ignored, but it will catch self references. - dsc desc; - MAKE_desc(dsqlScratch, &desc, input); - - // Generate the blr expression. - - dsqlScratch->getBlrData().clear(); - dsqlScratch->getDebugData().clear(); - dsqlScratch->appendUChar(dsqlScratch->isVersion4() ? blr_version4 : blr_version5); - - GEN_expr(dsqlScratch, input); - dsqlScratch->appendUChar(blr_eoc); - - if (saveDesc.dsc_dtype) - { - // Restore the field size/type overrides. - field->fld_dtype = saveDesc.dsc_dtype; - field->fld_length = saveDesc.dsc_length; - field->fld_scale = saveDesc.dsc_scale; - - if (field->fld_dtype <= dtype_any_text) - { - field->fld_character_set_id = DSC_GET_CHARSET(&saveDesc); - field->fld_collation_id= DSC_GET_COLLATE(&saveDesc); - } - else - field->fld_sub_type = saveDesc.dsc_sub_type; - } - else if (field) - { - // Use size calculated. - field->fld_dtype = desc.dsc_dtype; - field->fld_length = desc.dsc_length; - field->fld_scale = desc.dsc_scale; - - if (field->fld_dtype <= dtype_any_text) - { - field->fld_character_set_id = DSC_GET_CHARSET(&desc); - field->fld_collation_id = DSC_GET_COLLATE(&desc); - } - else - field->fld_sub_type = desc.dsc_sub_type; - } - - DDL_reset_context_stack(dsqlScratch); - - // Generate the source text. - const dsql_str* sourceStr = (dsql_str*) node->nod_arg[Dsql::e_cmp_text]; - fb_assert(sourceStr->str_length <= MAX_USHORT); - source = string(sourceStr->str_data, sourceStr->str_length); - - value.assign(dsqlScratch->getBlrData()); -} - // Define a DEFAULT clause. Return true for DEFAULT NULL. bool RelationNode::defineDefault(thread_db* /*tdbb*/, DsqlCompilerScratch* dsqlScratch, dsql_fld* /*field*/, dsql_nod* node, string& source, BlrWriter::BlrData& value) @@ -6985,7 +6988,10 @@ BlrWriter::BlrData computedValue; if (computedNode) - defineComputed(tdbb, dsqlScratch, field, computedNode, computedSource, computedValue); + { + defineComputed(dsqlScratch, dsqlNode, field, computedNode, computedSource, + computedValue); + } if (defaultNode) { @@ -8631,8 +8637,8 @@ if (keyLength) { - keyLength += ((length + STUFF_COUNT - 1) / (unsigned) STUFF_COUNT) * - (STUFF_COUNT + 1); + keyLength += ((length + Ods::STUFF_COUNT - 1) / (unsigned) Ods::STUFF_COUNT) * + (Ods::STUFF_COUNT + 1); } else keyLength = length; @@ -8844,6 +8850,61 @@ } +void CreateIndexNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const +{ + text.printf( + "CreateIndexNode\n" + " name: '%s'\n", + name.c_str()); +} + +// Define an index. +void CreateIndexNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction) +{ + Attachment* attachment = transaction->tra_attachment; + + // run all statements under savepoint control + AutoSavePoint savePoint(tdbb, transaction); + + executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_BEFORE, DDL_TRIGGER_CREATE_INDEX, name); + + CreateIndexNode::Definition definition; + definition.type = isc_dyn_def_idx; + definition.relation = ExprNode::as<RelationSourceNode>(legacyRelation)->dsqlName; + definition.unique = unique; + definition.descending = descending; + + if (legacyDef->nod_type == Dsql::nod_list) + { + const dsql_nod* const* ptr = legacyDef->nod_arg; + const dsql_nod* const* const end = ptr + legacyDef->nod_count; + + for (; ptr != end; ++ptr) + { + MetaName& column = definition.columns.add(); + column = ((dsql_str*) (*ptr)->nod_arg[1])->str_data; + } + } + else if (legacyDef->nod_type == Dsql::nod_def_computed) + { + string computedSource; + BlrWriter::BlrData computedValue; + + defineComputed(dsqlScratch, legacyRelation, NULL, legacyDef, computedSource, computedValue); + + attachment->storeMetaDataBlob(tdbb, transaction, &definition.expressionSource, + computedSource); + attachment->storeBinaryBlob(tdbb, transaction, &definition.expressionBlr, computedValue); + } + + store(tdbb, transaction, name, definition); + + executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_AFTER, DDL_TRIGGER_CREATE_INDEX, name); + + savePoint.release(); // everything is ok +} + + //---------------------- @@ -9009,6 +9070,69 @@ //---------------------- +void CreateFilterNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const +{ + text.printf( + "CreateFilterNode\n" + " name: '%s'\n", + name.c_str()); +} + +// Define a blob filter. +void CreateFilterNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction) +{ + // run all statements under savepoint control + AutoSavePoint savePoint(tdbb, transaction); + + ///executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_BEFORE, DDL_TRIGGER_DECLARE_FILTER, name); + + AutoCacheRequest request(tdbb, drq_s_filters, DYN_REQUESTS); + + STORE(REQUEST_HANDLE request TRANSACTION_HANDLE transaction) + X IN RDB$FILTERS + { + strcpy(X.RDB$FUNCTION_NAME, name.c_str()); + X.RDB$SYSTEM_FLAG = 0; + moduleName.copyTo(X.RDB$MODULE_NAME, sizeof(X.RDB$MODULE_NAME)); + entryPoint.copyTo(X.RDB$ENTRYPOINT, sizeof(X.RDB$ENTRYPOINT)); + + if (inputFilter->name.hasData()) + { + if (!METD_get_type(transaction, inputFilter->name, "RDB$FIELD_SUB_TYPE", &X.RDB$INPUT_SUB_TYPE)) + { + status_exception::raise( + Arg::Gds(isc_sqlerr) << Arg::Num(-204) << + Arg::Gds(isc_dsql_datatype_err) << + Arg::Gds(isc_dsql_blob_type_unknown) << inputFilter->name); + } + } + else + X.RDB$INPUT_SUB_TYPE = inputFilter->number; + + if (outputFilter->name.hasData()) + { + if (!METD_get_type(transaction, outputFilter->name, "RDB$FIELD_SUB_TYPE", &X.RDB$OUTPUT_SUB_TYPE)) + { + status_exception::raise( + Arg::Gds(isc_sqlerr) << Arg::Num(-204) << + Arg::Gds(isc_dsql_datatype_err) << + Arg::Gds(isc_dsql_blob_type_unknown) << outputFilter->name); + } + } + else + X.RDB$OUTPUT_SUB_TYPE = outputFilter->number; + } + END_STORE + + ///executeDdlTrigger(tdbb, dsqlScratch, transaction, DTW_AFTER, DDL_TRIGGER_DECLARE_FILTER, name); + + savePoint.release(); // everything is ok +} + + +//---------------------- + + void DropFilterNode::print(string& text, Array<dsql_nod*>& /*nodes*/) const { text.printf( Modified: firebird/trunk/src/dsql/DdlNodes.h =================================================================== --- firebird/trunk/src/dsql/DdlNodes.h 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/dsql/DdlNodes.h 2011-11-27 19:08:06 UTC (rev 53645) @@ -1084,8 +1084,6 @@ void storePrivileges(thread_db* tdbb, jrd_tra* transaction); void defineField(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction, const dsql_nod* element, SSHORT position, const dsql_nod* pkcols); - void defineComputed(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, dsql_fld* field, - dsql_nod* node, Firebird::string& source, BlrWriter::BlrData& value); bool defineDefault(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, dsql_fld* field, dsql_nod* node, Firebird::string& source, BlrWriter::BlrData& value); void makeConstraint(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction, @@ -1266,7 +1264,7 @@ }; -class CreateIndexNode +class CreateIndexNode : public DdlNode { public: struct Definition @@ -1290,8 +1288,37 @@ Firebird::ObjectsArray<Firebird::MetaName> refColumns; }; +public: + CreateIndexNode(MemoryPool& p, const Firebird::MetaName& aName) + : DdlNode(p), + name(p, aName), + unique(false), + descending(false), + legacyRelation(NULL), + legacyDef(NULL) + { + } + +public: static void store(thread_db* tdbb, jrd_tra* transaction, Firebird::MetaName& name, const Definition& definition, Firebird::MetaName* referredIndexName = NULL); + +public: + virtual void print(Firebird::string& text, Firebird::Array<dsql_nod*>& nodes) const; + virtual void execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction); + +protected: + virtual void putErrorPrefix(Firebird::Arg::StatusVector& statusVector) + { + statusVector << Firebird::Arg::Gds(isc_dsql_create_index_failed) << name; + } + +public: + Firebird::MetaName name; + bool unique; + bool descending; + dsql_nod* legacyRelation; + dsql_nod* legacyDef; }; @@ -1373,6 +1400,57 @@ }; +class CreateFilterNode : public DdlNode +{ +public: + struct NameNumber + { + NameNumber(MemoryPool& p, const Firebird::MetaName& aName) + : name(p, aName), + number(0) + { + } + + NameNumber(MemoryPool& p, SSHORT aNumber) + : name(p), + number(aNumber) + { + } + + Firebird::MetaName name; + SSHORT number; + }; + +public: + CreateFilterNode(MemoryPool& p, const Firebird::MetaName& aName) + : DdlNode(p), + name(p, aName), + inputFilter(NULL), + outputFilter(NULL), + entryPoint(p), + moduleName(p) + { + } + +public: + virtual void print(Firebird::string& text, Firebird::Array<dsql_nod*>& nodes) const; + virtual void execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd_tra* transaction); + +protected: + virtual void putErrorPrefix(Firebird::Arg::StatusVector& statusVector) + { + statusVector << Firebird::Arg::Gds(isc_dsql_create_filter_failed) << name; + } + +public: + Firebird::MetaName name; + NameNumber* inputFilter; + NameNumber* outputFilter; + Firebird::string entryPoint; + Firebird::string moduleName; +}; + + class DropFilterNode : public DdlNode { public: Modified: firebird/trunk/src/dsql/ddl.cpp =================================================================== --- firebird/trunk/src/dsql/ddl.cpp 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/dsql/ddl.cpp 2011-11-27 19:08:06 UTC (rev 53645) @@ -115,10 +115,6 @@ static void assign_field_length(dsql_fld*, USHORT); -static void define_computed(DsqlCompilerScratch*, dsql_nod*, dsql_fld*, dsql_nod*); -static void define_filter(DsqlCompilerScratch*); -static SSHORT getBlobFilterSubType(DsqlCompilerScratch* dsqlScratch, const dsql_nod* node); -static void define_index(DsqlCompilerScratch*); static void generate_dyn(DsqlCompilerScratch*, dsql_nod*); static void grant_revoke(DsqlCompilerScratch*); static void modify_privilege(DsqlCompilerScratch* dsqlScratch, NOD_TYPE type, SSHORT option, @@ -352,7 +348,7 @@ { SSHORT blob_sub_type; if (!METD_get_type(dsqlScratch->getTransaction(), - reinterpret_cast<const dsql_str*>(field->fld_sub_type_name), + reinterpret_cast<const dsql_str*>(field->fld_sub_type_name)->str_data, "RDB$FIELD_SUB_TYPE", &blob_sub_type)) { ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-204) << @@ -587,226 +583,6 @@ } -static void define_computed(DsqlCompilerScratch* dsqlScratch, - dsql_nod* relation_node, - dsql_fld* field, - dsql_nod* node) -{ -/************************************** - * - * d e f i n e _ c o m p u t e d - * - ************************************** - * - * Function - * Create the ddl to define a computed field - * or an expression index. - * - **************************************/ - - DsqlCompiledStatement* statement = dsqlScratch->getStatement(); - dsql_nod* const saved_ddl_node = statement->getDdlNode(); - statement->setDdlNode(node); - - // Get the table node & set up correct context - DDL_reset_context_stack(dsqlScratch); - - dsc save_desc; - // Save the size of the field if it is specified - save_desc.dsc_dtype = 0; - - if (field && field->fld_dtype) - { - fb_assert(field->fld_dtype <= MAX_UCHAR); - save_desc.dsc_dtype = (UCHAR) field->fld_dtype; - save_desc.dsc_length = field->fld_length; - fb_assert(field->fld_scale <= MAX_SCHAR); - save_desc.dsc_scale = (SCHAR) field->fld_scale; - save_desc.dsc_sub_type = field->fld_sub_type; - - field->fld_dtype = 0; - field->fld_length = 0; - field->fld_scale = 0; - field->fld_sub_type = 0; - } - - PASS1_make_context(dsqlScratch, relation_node); - - dsql_nod* input = PASS1_node(dsqlScratch, node->nod_arg[e_cmp_expr]); - - // try to calculate size of the computed field. The calculated size - // may be ignored, but it will catch self references - dsc desc; - MAKE_desc(dsqlScratch, &desc, input); - - // generate the blr expression - - dsqlScratch->beginBlr(isc_dyn_fld_computed_blr); - GEN_expr(dsqlScratch, input); - dsqlScratch->endBlr(); - - if (save_desc.dsc_dtype) - { - // restore the field size/type overrides - field->fld_dtype = save_desc.dsc_dtype; - field->fld_length = save_desc.dsc_length; - field->fld_scale = save_desc.dsc_scale; - if (field->fld_dtype <= dtype_any_text) - { - field->fld_character_set_id = DSC_GET_CHARSET(&save_desc); - field->fld_collation_id= DSC_GET_COLLATE(&save_desc); - } - else - field->fld_sub_type = save_desc.dsc_sub_type; - } - else if (field) - { - // use size calculated - field->fld_dtype = desc.dsc_dtype; - field->fld_length = desc.dsc_length; - field->fld_scale = desc.dsc_scale; - if (field->fld_dtype <= dtype_any_text) - { - field->fld_character_set_id = DSC_GET_CHARSET(&desc); - field->fld_collation_id= DSC_GET_COLLATE(&desc); - } - else - field->fld_sub_type = desc.dsc_sub_type; - } - - statement->setType(DsqlCompiledStatement::TYPE_DDL); - statement->setDdlNode(saved_ddl_node); - DDL_reset_context_stack(dsqlScratch); - - // generate the source text - const dsql_str* source = (dsql_str*) node->nod_arg[e_cmp_text]; - fb_assert(source->str_length <= MAX_USHORT); - dsqlScratch->appendString(isc_dyn_fld_computed_source, source->str_data, - (USHORT) source->str_length); -} - - -static SSHORT getBlobFilterSubType(DsqlCompilerScratch* dsqlScratch, const dsql_nod* node) -{ -/******************************************* - * - * g e t B l o b F i l t e r S u b T y p e - * - ******************************************* - * - * Function - * get sub_type value from LiteralNode. - * - **************************************/ - const LiteralNode* literal = ExprNode::as<LiteralNode>(node); - fb_assert(literal); - - switch (literal->litDesc.dsc_dtype) - { - case dtype_long: - return (SSHORT) literal->getSlong(); - case dtype_text: - break; - default: - fb_assert(false); - return 0; - } - - // fall thru for dtype_text - const dsql_str* type_name = reinterpret_cast<const dsql_str*>(node->nod_arg[0]); - SSHORT blob_sub_type; - if (!METD_get_type(dsqlScratch->getTransaction(), type_name, "RDB$FIELD_SUB_TYPE", &blob_sub_type)) - { - ERRD_post(Arg::Gds(isc_sqlerr) << Arg::Num(-204) << - Arg::Gds(isc_dsql_datatype_err) << - Arg::Gds(isc_dsql_blob_type_unknown) << Arg::Str(type_name->str_data)); - } - return blob_sub_type; -} - -static void define_filter(DsqlCompilerScratch* dsqlScratch) -{ -/************************************** - * - * d e f i n e _ f i l t e r - * - ************************************** - * - * Function - * define a filter to the database. - * - **************************************/ - DsqlCompiledStatement* statement = dsqlScratch->getStatement(); - const dsql_nod* filter_node = statement->getDdlNode(); - const dsql_nod* const* ptr = filter_node->nod_arg; - - dsqlScratch->appendNullString(isc_dyn_def_filter, ((dsql_str*) (ptr[e_filter_name]))->str_data); - dsqlScratch->appendNumber(isc_dyn_filter_in_subtype, - getBlobFilterSubType(dsqlScratch, ptr[e_filter_in_type])); - dsqlScratch->appendNumber(isc_dyn_filter_out_subtype, - getBlobFilterSubType(dsqlScratch, ptr[e_filter_out_type])); - dsqlScratch->appendNullString(isc_dyn_func_entry_point, - ((dsql_str*) (ptr[e_filter_entry_pt]))->str_data); - dsqlScratch->appendNullString(isc_dyn_func_module_name, - ((dsql_str*) (ptr[e_filter_module]))->str_data); - - dsqlScratch->appendUChar(isc_dyn_end); -} - - -static void define_index(DsqlCompilerScratch* dsqlScratch) -{ -/************************************** - * - * d e f i n e _ i n d e x - * - ************************************** - * - * Function - * Generate ddl to create an index. - * - **************************************/ - DsqlCompiledStatement* statement = dsqlScratch->getStatement(); - - dsqlScratch->appendUChar(isc_dyn_begin); - - const dsql_nod* ddl_node = statement->getDdlNode(); - dsql_nod* relation_node = (dsql_nod*) ddl_node->nod_arg[e_idx_table]; - const MetaName& relation_name = ExprNode::as<RelationSourceNode>(relation_node)->dsqlName; - dsql_nod* field_list = ddl_node->nod_arg[e_idx_fields]; - const dsql_str* index_name = (dsql_str*) ddl_node->nod_arg[e_idx_name]; - - dsqlScratch->appendNullString(isc_dyn_def_idx, index_name->str_data); - dsqlScratch->appendNullString(isc_dyn_rel_name, relation_name.c_str()); - - // go through the fields list, making an index segment for each field, - // unless we have a computation, in which case generate an expression index - - if (field_list->nod_type == nod_list) - { - const dsql_nod* const* ptr = field_list->nod_arg; - const dsql_nod* const* const end = ptr + field_list->nod_count; - for (; ptr < end; ptr++) - dsqlScratch->appendNullString(isc_dyn_fld_name, ((dsql_str*) (*ptr)->nod_arg[1])->str_data); - } - else if (field_list->nod_type == nod_def_computed) - define_computed(dsqlScratch, relation_node, NULL, field_list); - - // check for a unique index - - if (ddl_node->nod_arg[e_idx_unique]) { - dsqlScratch->appendNumber(isc_dyn_idx_unique, 1); - } - - if (ddl_node->nod_arg[e_idx_asc_dsc]) { - dsqlScratch->appendNumber(isc_dyn_idx_type, 1); - } - - dsqlScratch->appendUChar(isc_dyn_end); // of define index - dsqlScratch->appendUChar(isc_dyn_end); // of begin -} - - static void generate_dyn(DsqlCompilerScratch* dsqlScratch, dsql_nod* node) { /************************************** @@ -822,19 +598,11 @@ **************************************/ switch (node->nod_type) { - case nod_def_index: - define_index(dsqlScratch); - break; - case nod_grant: case nod_revoke: grant_revoke(dsqlScratch); break; - case nod_def_filter: - define_filter(dsqlScratch); - break; - case nod_add_user: define_user(dsqlScratch, isc_dyn_user_add); break; Modified: firebird/trunk/src/dsql/metd.epp =================================================================== --- firebird/trunk/src/dsql/metd.epp 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/dsql/metd.epp 2011-11-27 19:08:06 UTC (rev 53645) @@ -1524,7 +1524,7 @@ } -bool METD_get_type(jrd_tra* transaction, const dsql_str* name, const char* field, SSHORT* value) +bool METD_get_type(jrd_tra* transaction, const MetaName& name, const char* field, SSHORT* value) { /************************************** * @@ -1546,7 +1546,7 @@ FOR(REQUEST_HANDLE handle TRANSACTION_HANDLE transaction) X IN RDB$TYPES WITH - X.RDB$FIELD_NAME EQ field AND X.RDB$TYPE_NAME EQ name->str_data; + X.RDB$FIELD_NAME EQ field AND X.RDB$TYPE_NAME EQ name.c_str(); { found = true; *value = X.RDB$TYPE; Modified: firebird/trunk/src/dsql/metd_proto.h =================================================================== --- firebird/trunk/src/dsql/metd_proto.h 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/dsql/metd_proto.h 2011-11-27 19:08:06 UTC (rev 53645) @@ -67,7 +67,7 @@ Jrd::dsql_prc* METD_get_procedure(Jrd::jrd_tra*, Jrd::DsqlCompilerScratch*, const Firebird::QualifiedName&); Jrd::dsql_rel* METD_get_relation(Jrd::jrd_tra*, Jrd::DsqlCompilerScratch*, const Firebird::MetaName&); -bool METD_get_type(Jrd::jrd_tra*, const Jrd::dsql_str*, const char*, SSHORT*); +bool METD_get_type(Jrd::jrd_tra*, const Firebird::MetaName&, const char*, SSHORT*); Jrd::dsql_rel* METD_get_view_base(Jrd::jrd_tra*, Jrd::DsqlCompilerScratch*, const char* view_name, Jrd::MetaNamePairMap& fields); Jrd::dsql_rel* METD_get_view_relation(Jrd::jrd_tra*, Jrd::DsqlCompilerScratch*, const char* view_name, Modified: firebird/trunk/src/dsql/node.h =================================================================== --- firebird/trunk/src/dsql/node.h 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/dsql/node.h 2011-11-27 19:08:06 UTC (rev 53645) @@ -66,7 +66,6 @@ nod_del_field, nod_def_index, nod_def_constraint, - nod_def_filter, nod_grant, nod_revoke, nod_rel_constraint, @@ -268,13 +267,6 @@ e_rollback_retain = 0, // e_rollback_count, - e_filter_name = 0, // - e_filter_in_type, - e_filter_out_type, - e_filter_entry_pt, - e_filter_module, - e_filter_count, - // computed field e_cmp_expr = 0, Modified: firebird/trunk/src/dsql/parse.y =================================================================== --- firebird/trunk/src/dsql/parse.y 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/dsql/parse.y 2011-11-27 19:08:06 UTC (rev 53645) @@ -649,6 +649,7 @@ Jrd::CreateAlterProcedureNode* createAlterProcedureNode; Jrd::CreateAlterTriggerNode* createAlterTriggerNode; Jrd::CreateAlterPackageNode* createAlterPackageNode; + Jrd::CreateFilterNode::NameNumber* filterNameNumber; Jrd::CreateSequenceNode* createSequenceNode; Jrd::CreateShadowNode* createShadowNode; Firebird::Array<Jrd::CreateAlterPackageNode::Item>* packageItems; @@ -690,7 +691,8 @@ %type <compoundStmtNode> assignments %type <legacyStr> admin_opt -%type <legacyNode> blob_filter_subtype blob_io blob_segsize blob_subtype blob_subtype_io +%type <legacyNode> blob_io blob_segsize blob_subtype blob_subtype_io +%type <filterNameNumber> blob_filter_subtype %type <legacyNode> blob_subtype_value_io blob_type %type <stmtNode> breakleave @@ -724,18 +726,19 @@ %type <dbFileClause> db_file %type db_file_list(<dbFilesClause>) %type <legacyNode> ddl_subname -%type <legacyNode> decimal_keyword declare declare_clause +%type <legacyNode> decimal_keyword %type <legacyNode> decode_pairs def_computed default_par_opt default_value %type <stmtNode> delete delete_positioned delete_searched %type <legacyNode> delete_rule delimiter_opt derived_column_list derived_table %type <legacyNode> deterministic_opt distinct_clause %type <legacyNode> domain_default domain_default_opt domain_or_non_array_type %type <legacyNode> domain_or_non_array_type_name domain_type drop_behaviour -%type <ddlNode> drop drop_clause +%type <ddlNode> declare declare_clause drop drop_clause %type <legacyStr> db_name ddl_desc %type db_alter_clause(<alterDatabaseNode>) -%type <legacyNode> event_argument_opt exception_clause +%type <legacyNode> event_argument_opt +%type <ddlNode> exception_clause %type err(<exceptionArray>) errors(<exceptionArray>) %type <stmtNode> excp_hndl_statement exec_procedure exec_function %type <compoundStmtNode> excp_hndl_statements @@ -749,9 +752,10 @@ %type <stmtNode> fetch_cursor %type <legacyNode> file1 -%type <legacyNode> filter_clause_io filter_decl_clause first_clause +%type <legacyNode> filter_clause_io first_clause %type <legacyNode> float_type for_update_clause for_update_list from_clause %type <legacyNode> from_list +%type <ddlNode> filter_decl_clause %type <stmtNode> for_select full_proc_block full_proc_block_body %type <legacyStr> firstname_opt %type file_clause(<dbFileClause>) file_desc(<dbFileClause>) file_desc1(<dbFileClause>) @@ -807,7 +811,8 @@ %type <stmtNode> open_cursor %type <legacyNode> optional_retain %type optional_savepoint opt_snapshot optional_work -%type <legacyNode> order_clause order_direction order_item order_list +%type <legacyNode> order_clause order_item order_list +%type <boolVal> order_direction %type output_parameters(<parametersClause>) output_proc_parameter(<parametersClause>) %type output_proc_parameters(<parametersClause>) @@ -833,9 +838,9 @@ %type return_value1(<createAlterFunctionNode>) return_value(<createAlterFunctionNode>) %type <returningClause> returning_clause %type <ddlNode> rexception_clause -%type <legacyNode> role_admin_option role_clause role_grantee role_grantee_list +%type <legacyNode> role_admin_option role_grantee role_grantee_list %type <legacyNode> role_name role_name_list rollback rows_clause -%type <ddlNode> rtable_clause +%type <ddlNode> role_clause rtable_clause %type <ddlNode> rview_clause %type <legacyStr> revoke_admin @@ -877,7 +882,8 @@ %type <legacyNode> u_constant u_numeric_constant udf_data_type undo_savepoint %type <createAlterFunctionNode> udf_decl_clause -%type <legacyNode> unique_constraint unique_opt update_column_name +%type <legacyNode> unique_constraint update_column_name +%type <boolVal> unique_opt %type <stmtNode> update update_or_insert update_positioned update_searched %type <legacyNode> update_or_insert_matching_opt update_rule %type <legacyNode> user_grantee user_grantee_list @@ -989,6 +995,7 @@ | create_or_alter { $$ = makeClassNode($1); } | declare + { $$ = makeClassNode($1); } | delete { $$ = makeClassNode($1); } | drop @@ -1209,7 +1216,7 @@ declare_clause : FILTER filter_decl_clause { $$ = $2; } - | EXTERNAL FUNCTION udf_decl_clause { $$ = makeClassNode($3); } + | EXTERNAL FUNCTION udf_decl_clause { $$ = $3; } ; udf_decl_clause @@ -1289,16 +1296,25 @@ filter_decl_clause - : symbol_filter_name INPUT_TYPE blob_filter_subtype OUTPUT_TYPE blob_filter_subtype - ENTRY_POINT sql_string MODULE_NAME sql_string - { $$ = make_node (nod_def_filter, (int) e_filter_count, $1, $3, $5, $7, $9); } + : symbol_filter_name + INPUT_TYPE blob_filter_subtype + OUTPUT_TYPE blob_filter_subtype + ENTRY_POINT sql_string MODULE_NAME sql_string + { + CreateFilterNode* node = newNode<CreateFilterNode>(toName($1)); + node->inputFilter = $3; + node->outputFilter = $5; + node->entryPoint = toString($7); + node->moduleName = toString($9); + $$ = node; + } ; blob_filter_subtype : symbol_blob_subtype_name - { $$ = MAKE_constant((dsql_str*) $1, CONSTANT_STRING); } + { $$ = newNode<CreateFilterNode::NameNumber>(toName($1)); } | signed_short_integer - { $$ = MAKE_const_slong($1); } + { $$ = newNode<CreateFilterNode::NameNumber>($1); } ; // CREATE metadata operations @@ -1309,9 +1325,16 @@ create_clause : EXCEPTION exception_clause - { $$ = $2; } + { $$ = makeClassNode($2); } | unique_opt order_direction INDEX symbol_index_name ON simple_table_name index_definition - { $$ = make_node (nod_def_index, (int) e_idx_count, $1, $2, $4, $6, $7); } + { + CreateIndexNode* node = newNode<CreateIndexNode>(toName($4)); + node->unique = $1; + node->descending = $2; + node->legacyRelation = $6; + node->legacyDef = $7; + $$ = makeClassNode(node); + } | FUNCTION function_clause { $$ = makeClassNode($2); } | PROCEDURE procedure_clause @@ -1335,7 +1358,7 @@ | SHADOW shadow_clause { $$ = makeClassNode($2); } | ROLE role_clause - { $$ = $2; } + { $$ = makeClassNode($2); } | COLLATION collation_clause { $$ = makeClassNode($2); } | USER create_user_clause @@ -1394,7 +1417,7 @@ exception_clause : symbol_exception_name sql_string - { $$ = makeClassNode(newNode<CreateAlterExceptionNode>(toName($1), toString($2))); } + { $$ = newNode<CreateAlterExceptionNode>(toName($1), toString($2)); } ; rexception_clause @@ -1431,8 +1454,8 @@ // CREATE INDEX unique_opt - : /* nothing */ { $$ = NULL; } - | UNIQUE { $$ = make_node (nod_unique, 0, NULL); } + : /* nothing */ { $$ = false; } + | UNIQUE { $$ = true; } ; index_definition @@ -1558,7 +1581,7 @@ // CREATE ROLE role_clause - : symbol_role_name { $$ = makeClassNode(newNode<CreateRoleNode>(toName($1))); } + : symbol_role_name { $$ = newNode<CreateRoleNode>(toName($1)); } ; @@ -1973,15 +1996,19 @@ { $$ = make_node (nod_foreign, (int) e_for_count, $3, $5, $6, $7, $8); } ; -constraint_index_opt : USING order_direction INDEX symbol_index_name - { $$ = make_node (nod_def_index, (int) e_idx_count, NULL, $2, $4, NULL, NULL); } +constraint_index_opt + : USING order_direction INDEX symbol_index_name + { + $$ = make_node (nod_def_index, (int) e_idx_count, + NULL, ($2 ? make_node(nod_flag, 0, NULL) : NULL), $4, NULL, NULL); + } /* - | NO INDEX - { $$ = NULL; } + | NO INDEX + { $$ = NULL; } */ - | - { $$ = make_node (nod_def_index, (int) e_idx_count, NULL, NULL, NULL, NULL, NULL); } - ; + | + { $$ = make_node (nod_def_index, (int) e_idx_count, NULL, NULL, NULL, NULL, NULL); } + ; referential_trigger_action: update_rule @@ -4742,13 +4769,16 @@ order_item : value order_direction nulls_clause - { $$ = make_node (nod_order, (int) e_order_count, $1, $2, $3); } + { + $$ = make_node (nod_order, (int) e_order_count, + $1, ($2 ? make_node(nod_flag, 0, NULL) : NULL), $3); + } ; order_direction - : /* nothing */ { $$ = NULL; } - | ASC { $$ = NULL; } - | DESC { $$ = make_node(nod_flag, 0, NULL); } + : /* nothing */ { $$ = false; } + | ASC { $$ = false; } + | DESC { $$ = true; } ; nulls_clause Modified: firebird/trunk/src/dsql/pass1.cpp =================================================================== --- firebird/trunk/src/dsql/pass1.cpp 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/dsql/pass1.cpp 2011-11-27 19:08:06 UTC (rev 53645) @@ -895,7 +895,6 @@ case nod_def_constraint: case nod_grant: case nod_revoke: - case nod_def_filter: case nod_def_domain: case nod_add_user: case nod_mod_user: @@ -4741,9 +4740,6 @@ case nod_def_field: verb = "define field"; break; - case nod_def_filter: - verb = "define filter"; - break; case nod_def_index: verb = "define index"; break; Modified: firebird/trunk/src/include/gen/codetext.h =================================================================== --- firebird/trunk/src/include/gen/codetext.h 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/include/gen/codetext.h 2011-11-27 19:08:06 UTC (rev 53645) @@ -1065,6 +1065,8 @@ {"dsql_alter_index_failed", 336397312}, {"dsql_alter_database_failed", 336397313}, {"dsql_create_shadow_failed", 336397314}, + {"dsql_create_filter_failed", 336397315}, + {"dsql_create_index_failed", 336397316}, {"gsec_cant_open_db", 336723983}, {"gsec_switches_error", 336723984}, {"gsec_no_op_spec", 336723985}, Modified: firebird/trunk/src/include/gen/iberror.h =================================================================== --- firebird/trunk/src/include/gen/iberror.h 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/include/gen/iberror.h 2011-11-27 19:08:06 UTC (rev 53645) @@ -1099,6 +1099,8 @@ const ISC_STATUS isc_dsql_alter_index_failed = 336397312L; const ISC_STATUS isc_dsql_alter_database_failed = 336397313L; const ISC_STATUS isc_dsql_create_shadow_failed = 336397314L; +const ISC_STATUS isc_dsql_create_filter_failed = 336397315L; +const ISC_STATUS isc_dsql_create_index_failed = 336397316L; const ISC_STATUS isc_gsec_cant_open_db = 336723983L; const ISC_STATUS isc_gsec_switches_error = 336723984L; const ISC_STATUS isc_gsec_no_op_spec = 336723985L; @@ -1200,7 +1202,7 @@ const ISC_STATUS isc_trace_switch_param_miss = 337182758L; const ISC_STATUS isc_trace_param_act_notcompat = 337182759L; const ISC_STATUS isc_trace_mandatory_switch_miss = 337182760L; -const ISC_STATUS isc_err_max = 1144; +const ISC_STATUS isc_err_max = 1146; #else /* c definitions */ @@ -2269,6 +2271,8 @@ #define isc_dsql_alter_index_failed 336397312L #define isc_dsql_alter_database_failed 336397313L #define isc_dsql_create_shadow_failed 336397314L +#define isc_dsql_create_filter_failed 336397315L +#define isc_dsql_create_index_failed 336397316L #define isc_gsec_cant_open_db 336723983L #define isc_gsec_switches_error 336723984L #define isc_gsec_no_op_spec 336723985L @@ -2370,7 +2374,7 @@ #define isc_trace_switch_param_miss 337182758L #define isc_trace_param_act_notcompat 337182759L #define isc_trace_mandatory_switch_miss 337182760L -#define isc_err_max 1144 +#define isc_err_max 1146 #endif Modified: firebird/trunk/src/include/gen/msgs.h =================================================================== --- firebird/trunk/src/include/gen/msgs.h 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/include/gen/msgs.h 2011-11-27 19:08:06 UTC (rev 53645) @@ -1068,6 +1068,8 @@ {336397312, "ALTER INDEX @1 failed"}, /* dsql_alter_index_failed */ {336397313, "ALTER DATABASE failed"}, /* dsql_alter_database_failed */ {336397314, "CREATE SHADOW @1 failed"}, /* dsql_create_shadow_failed */ + {336397315, "DECLARE FILTER @1 failed"}, /* dsql_create_filter_failed */ + {336397316, "CREATE INDEX @1 failed"}, /* dsql_create_index_failed */ {336723983, "unable to open database"}, /* gsec_cant_open_db */ {336723984, "error in switch specifications"}, /* gsec_switches_error */ {336723985, "no operation specified"}, /* gsec_no_op_spec */ Modified: firebird/trunk/src/include/gen/sql_code.h =================================================================== --- firebird/trunk/src/include/gen/sql_code.h 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/include/gen/sql_code.h 2011-11-27 19:08:06 UTC (rev 53645) @@ -1064,6 +1064,8 @@ {336397312, -901}, /* 1024 dsql_alter_index_failed */ {336397313, -901}, /* 1025 dsql_alter_database_failed */ {336397314, -901}, /* 1026 dsql_create_shadow_failed */ + {336397315, -901}, /* 1027 dsql_create_filter_failed */ + {336397316, -901}, /* 1028 dsql_create_index_failed */ {336723983, -901}, /* 15 gsec_cant_open_db */ {336723984, -901}, /* 16 gsec_switches_error */ {336723985, -901}, /* 17 gsec_no_op_spec */ Modified: firebird/trunk/src/include/gen/sql_state.h =================================================================== --- firebird/trunk/src/include/gen/sql_state.h 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/include/gen/sql_state.h 2011-11-27 19:08:06 UTC (rev 53645) @@ -1064,6 +1064,8 @@ {336397312, "42000"}, // 1024 dsql_alter_index_failed {336397313, "42000"}, // 1025 dsql_alter_database_failed {336397314, "42000"}, // 1026 dsql_create_shadow_failed + {336397315, "42000"}, // 1027 dsql_create_filter_failed + {336397316, "42000"}, // 1028 dsql_create_index_failed {336723983, "00000"}, // 15 gsec_cant_open_db {336723984, "00000"}, // 16 gsec_switches_error {336723985, "00000"}, // 17 gsec_no_op_spec Modified: firebird/trunk/src/jrd/dyn.epp =================================================================== --- firebird/trunk/src/jrd/dyn.epp 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/jrd/dyn.epp 2011-11-27 19:08:06 UTC (rev 53645) @@ -63,7 +63,6 @@ #include "../jrd/cmp_proto.h" #include "../jrd/dpm_proto.h" #include "../jrd/dyn_proto.h" -#include "../jrd/dyn_df_proto.h" #include "../jrd/err_proto.h" #include "../jrd/exe_proto.h" #include "../yvalve/gds_proto.h" @@ -374,14 +373,6 @@ break; ***/ - case isc_dyn_def_filter: - DYN_define_filter(gbl, ptr); - break; - - case isc_dyn_def_idx: - DYN_define_index(gbl, ptr, relation_name); - break; - case isc_dyn_user: dyn_user(gbl, ptr); break; @@ -561,123 +552,6 @@ } -USHORT DYN_put_blr_blob(Global* gbl, const UCHAR** ptr, bid* blob_id) -{ -/************************************** - * - * D Y N _ p u t _ b l r _ b l o b - * - ************************************** - * - * Functional description - * Write out a blr blob. - * - **************************************/ - thread_db* tdbb = JRD_get_thread_data(); - - const UCHAR *p = *ptr; - USHORT length = *p++; - length |= (*p++) << 8; - - if (!length) - { - *ptr = p; - return length; - } - - try { - blb* blob = BLB_create(tdbb, gbl->gbl_transaction, blob_id); - BLB_put_segment(tdbb, blob, p, length); - BLB_close(tdbb, blob); - } - catch (const Exception& ex) - { - stuff_exception(tdbb->tdbb_status_vector, ex); - DYN_error_punt(true, 106); - // msg 106: "Create metadata blob failed" - } - - *ptr = p + length; - - return length; -} - -USHORT DYN_put_text_blob(Global* gbl, const UCHAR** ptr, bid* blob_id) -{ -/************************************** - * - * D Y N _ p u t _ t e x t _ b l o b - * - ************************************** - * - * Functional description - * Write out a text blob. - * - **************************************/ - thread_db* tdbb = JRD_get_thread_data(); - - const UCHAR* p = *ptr; - USHORT length = *p++; - length |= (*p++) << 8; - - if (!length) - { - *ptr = p; - return length; - } - - const UCHAR* const end = p + length; - - try { - UCharBuffer bpb; - const size_t convSize = 15; - bpb.resize(convSize); - - UCHAR* bpbPtr = bpb.begin(); - *bpbPtr++ = isc_bpb_version1; - - *bpbPtr++ = isc_bpb_source_type; - *bpbPtr++ = 2; - put_vax_short(bpbPtr, isc_blob_text); - bpbPtr += 2; - *bpbPtr++ = isc_bpb_source_interp; - *bpbPtr++ = 1; - *bpbPtr++ = tdbb->getCharSet(); - - *bpbPtr++ = isc_bpb_target_type; - *bpbPtr++ = 2; - put_vax_short(bpbPtr, isc_blob_text); - bpbPtr += 2; - *bpbPtr++ = isc_bpb_target_interp; - *bpbPtr++ = 1; - *bpbPtr++ = CS_METADATA; - fb_assert(size_t(bpbPtr - bpb.begin()) <= convSize); - - // set the array count to the number of bytes we used - bpb.shrink(bpbPtr - bpb.begin()); - - blb* blob = BLB_create2(tdbb, gbl->gbl_transaction, blob_id, bpb.getCount(), bpb.begin()); - - for (; p < end; p += TEXT_BLOB_LENGTH) - { - length = (p + TEXT_BLOB_LENGTH <= end) ? TEXT_BLOB_LENGTH : end - p; - BLB_put_segment(tdbb, blob, p, length); - } - BLB_close(tdbb, blob); - } - catch (const Exception& ex) - { - stuff_exception(tdbb->tdbb_status_vector, ex); - DYN_error_punt(true, 106); - // msg 106: "Create metadata blob failed" - } - - *ptr = end; - - return length; -} - - static void grant( Global* gbl, const UCHAR** ptr) { /************************************** Modified: firebird/trunk/src/jrd/dyn.h =================================================================== --- firebird/trunk/src/jrd/dyn.h 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/jrd/dyn.h 2011-11-27 19:08:06 UTC (rev 53645) @@ -33,30 +33,25 @@ const char* const ALL_PRIVILEGES = "SIUDR"; // all applicable grant/revoke privileges const char* const ALL_PROC_PRIVILEGES = "X"; // all applicable grant/revoke privileges for a procedure const int DYN_MSG_FAC = 8; -const int STUFF_COUNT = 4; // Is this the same value defined in ods.h??? -const int TEXT_BLOB_LENGTH = 512; +///const int STUFF_COUNT = 4; // Is this the same value defined in ods.h??? #define GET_STRING(from, to) DYN_get_string(from, to, sizeof(to)) -#define GET_BYTES(from, to) DYN_get_string(from, to, sizeof(to)) namespace Jrd { -struct bid; class jrd_tra; class thread_db; class Global { public: - Global(jrd_tra* t, const Firebird::string& aSqlText) //, const UCHAR* dyn, size_t length) - : gbl_transaction(t),// gbl_length(length), gbl_end(dyn + length) + Global(jrd_tra* t, const Firebird::string& aSqlText) + : gbl_transaction(t), sqlText(aSqlText) { } jrd_tra* const gbl_transaction; - //size_t gbl_length; // length of BLR stream - //const UCHAR* const gbl_end; // end of BLR sream Firebird::string sqlText; }; @@ -114,8 +109,6 @@ USHORT DYN_get_string(const UCHAR**, TEXT*, size_t); bool DYN_is_it_sql_role(Jrd::jrd_tra*, const Firebird::MetaName&, Firebird::MetaName&, Jrd::thread_db*); -USHORT DYN_put_blr_blob(Jrd::Global*, const UCHAR**, Jrd::bid*); -USHORT DYN_put_text_blob(Jrd::Global*, const UCHAR**, Jrd::bid*); void DYN_unsupported_verb(); Deleted: firebird/trunk/src/jrd/dyn_def.epp =================================================================== --- firebird/trunk/src/jrd/dyn_def.epp 2011-11-24 03:20:18 UTC (rev 53644) +++ firebird/trunk/src/jrd/dyn_def.epp 2011-11-27 19:08:06 UTC (rev 53645) @@ -1,266 +0,0 @@ -/* - * PROGRAM: JRD Data Definition Utility - * MODULE: dyn_define.epp - * DESCRIPTION: Dynamic data definition DYN_define_<x> - * - * 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): ______________________________________. - * - * 23-May-2001 Claudio Valderrama - Forbid zero length identifiers, - * they are not ANSI SQL compliant. - * 2001.10.08 Claudio Valderrama: Add case isc_dyn_system_flag to - * DYN_define_trigger() in order to receive values for special triggers - * as defined in constants.h. - * 2001.10.08 Ann Harrison: Changed dyn_create_index so it doesn't consider - * simple unique indexes when finding a "referred index", but only - * indexes that support unique constraints or primary keys. - * 26-Sep-2001 Paul Beach - External File Directory Config. Parameter - * 2002-02-24 Sean Leyne - Code Cleanup of old Win 3.1 port (WINDOWS_ONLY) - * 2002.08.10 Dmitry Yemanov: ALTER VIEW - * - * 2002.10.29 Sean Leyne - Removed obsolete "Netware" port - * - * 2004.01.16 Vlad Horsun: added support for default parameters - */ - -#include "firebird.h" -#include "dyn_consts.h" -#include "../common/classes/fb_string.h" -#include <stdio.h> -#include <string.h> -#include <stdlib.h> - -#include "../common/common.h" -#include "../jrd/jrd.h" -#include "../jrd/ods.h" -#include "../jrd/tra.h" -#include "../jrd/scl.h" -#include "../jrd/drq.h" -#include "../jrd/req.h" -#include "../jrd/flags.h" -#include "../jrd/ibase.h" -#include "../jrd/lls.h" -#include "../jrd/met.h" -#include "../jrd/btr.h" -#include "../jrd/ini.h" -#include "../jrd/intl.h" -#include "../jrd/dyn.h" -#include "../common/gdsassert.h" -#include "../jrd/blb_proto.h" -#include "../jrd/cmp_proto.h" -#include "../jrd/dyn_proto.h" -#include "../jrd/dyn_df_proto.h" -#include "../jrd/dyn_ut_proto.h" -#include "../jrd/err_proto.h" -#include "../jrd/exe_proto.h" -#include "../yvalve/gds_proto.h" -#include "../jrd/inf_proto.h" -#include "../jrd/intl_proto.h" -#include "../common/isc_f_proto.h" -#include "../jrd/met_proto.h" -#include "../jrd/vio_proto.h" -#include "../jrd/scl_proto.h" -#include "../common/gdsassert.h" -#include "../common/os/path_utils.h" -#include "../common/utils_proto.h" -#include "../jrd/IntlManager.h" -#include "../common/IntlUtil.h" -#include "../dsql/DdlNodes.h" - -using MsgFormat::SafeArg; - -using namespace Jrd; -using namespace Firebird; - - -DATABASE DB = STATIC "ODS.RDB"; - - -void DYN_define_filter( Global* gbl, const UCHAR** ptr) -{ -/************************************** - * - * D Y N _ d e f i n e _ f i l t e r - * - ************************************** - * - * Functional description - * Define a blob filter. - * - **************************************/ - - thread_db* tdbb = JRD_get_thread_data(); - - Firebird::MetaName filter_name; - GET_STRING(ptr, filter_name); - - AutoCacheRequest request(tdbb, drq_s_filters, DYN_REQUESTS); - - bool b_ending_store = false; - - try { - - STORE(REQUEST_HANDLE request TRANSACTION_HANDLE gbl->gbl_transaction) - X IN RDB$FILTERS USING - strcpy(X.RDB$FUNCTION_NAME, filter_name.c_str()); - X.RDB$OUTPUT_SUB_TYPE.NULL = TRUE; - X.RDB$INPUT_SUB_TYPE.NULL = TRUE; - X.RDB$MODULE_NAME.NULL = TRUE; - X.RDB$ENTRYPOINT.NULL = TRUE; - X.RDB$SYSTEM_FLAG = 0; - X.RDB$SYSTEM_FLAG.NULL = FALSE; - { - UCHAR verb; - while ((verb = *(*ptr)++) != isc_dyn_end) - { - switch (verb) - { - case isc_dyn_filter_in_subtype: - X.RDB$INPUT_SUB_TYPE = (SSHORT)DYN_get_number(ptr); - X.RDB$INPUT_SUB_TYPE.NULL = FALSE; - break; - - case isc_dyn_filter_out_subtype: - X.RDB$OUTPUT_SUB_TYPE = (SSHORT)DYN_get_number(ptr); - X.RDB$OUTPUT_SUB_TYPE.NULL = FALSE; - break; - - case isc_dyn_func_module_name: - GET_STRING(ptr, X.RDB$MODULE_NAME); - X.RDB$MODULE_NAME.NULL = FALSE; - break; - - case isc_dyn_func_entry_point: - GET_STRING(ptr, X.RDB$ENTRYPOINT); - X.RDB$ENTRYPOINT.NULL = FALSE; - break; - - default: - DYN_unsupported_verb(); - } - } - } - END_STORE - } - catch (const Firebird::Exception& ex) - { - Firebird::stuff_exception(tdbb->tdbb_status_vector, ex); - if (b_ending_store) - { - DYN_error_punt(true, 7); - // msg 7: "DEFINE BLOB FILTER failed" - } - throw; - } -} - - -void DYN_define_index(Global* gbl, const UCHAR** ptr, const Firebird::MetaName* relation_name) -{ -/************************************** - * - * D Y N _ d e f i n e _ i n d e x - * - ************************************** - * - * Functional description - * Execute a dynamic ddl statement that creates an index. - * - **************************************/ - thread_db* tdbb = JRD_get_thread_data(); - const UCHAR index_type = isc_dyn_def_idx; - Firebird::MetaName index_name; - UCHAR verb; - Firebird::MetaName trigger_name; - - GET_STRING(ptr, index_name); - - if (index_name.isEmpty()) - DYN_UTIL_generate_index_name(tdbb, gbl->gbl_transaction, index_name, index_type); - - DdlNode::executeDdlTrigger(tdbb, gbl->gbl_transaction, DdlNode::DTW_BEFORE, - DDL_TRIGGER_CREATE_INDEX, index_name, gbl->sqlText); - - try - { - DYN_UTIL_check_unique_name(tdbb, gbl->gbl_transaction, index_name, obj_index); - } - catch (const Exception& ex) - { - stuff_exception(tdbb->tdbb_status_vector, ex); - DYN_error_punt(true, 21); // msg 21: "STORE RDB$INDICES failed" - } - - try - { - CreateIndexNode::Definition definition; - definition.type = index_type; - - if (rel... [truncated message content] |
From: <fir...@us...> - 2011-11-28 03:20:17
|
Revision: 53647 http://firebird.svn.sourceforge.net/firebird/?rev=53647&view=rev Author: firebirds Date: 2011-11-28 03:20:10 +0000 (Mon, 28 Nov 2011) 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 2011-11-28 00:57:11 UTC (rev 53646) +++ firebird/trunk/ChangeLog 2011-11-28 03:20:10 UTC (rev 53647) @@ -1,3 +1,39 @@ + 2011-11-28 00:57 asfernandes + M src/dsql/DdlNodes.epp + M src/dsql/parse.y + M src/jrd/dyn.h +Misc. + + 2011-11-27 19:08 asfernandes + M builds/win32/msvc10/engine.vcxproj + M builds/win32/msvc10/engine.vcxproj.filters + M builds/win32/msvc8/engine.vcproj + M builds/win32/msvc9/engine.vcproj + M builds/win32/preprocess.bat + M lang_helpers/gds_codes.ftn + M lang_helpers/gds_codes.pas + M src/dsql/DdlNodes.epp + M src/dsql/DdlNodes.h + M src/dsql/ddl.cpp + M src/dsql/metd.epp + M src/dsql/metd_proto.h + M src/dsql/node.h + M src/dsql/parse.y + M src/dsql/pass1.cpp + M src/include/gen/codetext.h + M src/include/gen/iberror.h + M src/include/gen/msgs.h + M src/include/gen/sql_code.h + M src/include/gen/sql_state.h + M src/jrd/dyn.epp + M src/jrd/dyn.h + D src/jrd/dyn_def.epp + D src/jrd/dyn_df_proto.h + M src/msgs/facilities2.sql + M src/msgs/messages2.sql + M src/msgs/system_errors2.sql +Refactored CREATE FILTER and CREATE INDEX. + 2011-11-24 00:17 asfernandes M src/dsql/DdlNodes.h M src/dsql/ddl.cpp Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-11-28 00:57:11 UTC (rev 53646) +++ firebird/trunk/src/jrd/build_no.h 2011-11-28 03:20:10 UTC (rev 53647) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29620 + FORMAL BUILD NUMBER:29622 */ -#define PRODUCT_VER_STRING "3.0.0.29620" -#define FILE_VER_STRING "WI-T3.0.0.29620" -#define LICENSE_VER_STRING "WI-T3.0.0.29620" -#define FILE_VER_NUMBER 3, 0, 0, 29620 +#define PRODUCT_VER_STRING "3.0.0.29622" +#define FILE_VER_STRING "WI-T3.0.0.29622" +#define LICENSE_VER_STRING "WI-T3.0.0.29622" +#define FILE_VER_NUMBER 3, 0, 0, 29622 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29620" +#define FB_BUILD_NO "29622" #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 2011-11-28 00:57:11 UTC (rev 53646) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-11-28 03:20:10 UTC (rev 53647) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29620 +BuildNum=29622 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-11-30 03:23:11
|
Revision: 53650 http://firebird.svn.sourceforge.net/firebird/?rev=53650&view=rev Author: firebirds Date: 2011-11-30 03:23:05 +0000 (Wed, 30 Nov 2011) 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 2011-11-29 08:37:55 UTC (rev 53649) +++ firebird/trunk/ChangeLog 2011-11-30 03:23:05 UTC (rev 53650) @@ -1,3 +1,13 @@ + 2011-11-29 08:37 dimitr + M builds/win32/msvc8/engine.vcproj +Fixed the build. + + 2011-11-29 08:14 dimitr + M src/lock/lock.cpp + M src/lock/lock_proto.h + M src/lock/print.cpp +Raised the lock table version. Some cleanup. + 2011-11-28 00:57 asfernandes M src/dsql/DdlNodes.epp M src/dsql/parse.y Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-11-29 08:37:55 UTC (rev 53649) +++ firebird/trunk/src/jrd/build_no.h 2011-11-30 03:23:05 UTC (rev 53650) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29622 + FORMAL BUILD NUMBER:29624 */ -#define PRODUCT_VER_STRING "3.0.0.29622" -#define FILE_VER_STRING "WI-T3.0.0.29622" -#define LICENSE_VER_STRING "WI-T3.0.0.29622" -#define FILE_VER_NUMBER 3, 0, 0, 29622 +#define PRODUCT_VER_STRING "3.0.0.29624" +#define FILE_VER_STRING "WI-T3.0.0.29624" +#define LICENSE_VER_STRING "WI-T3.0.0.29624" +#define FILE_VER_NUMBER 3, 0, 0, 29624 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29622" +#define FB_BUILD_NO "29624" #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 2011-11-29 08:37:55 UTC (rev 53649) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-11-30 03:23:05 UTC (rev 53650) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29622 +BuildNum=29624 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-01 03:19:45
|
Revision: 53652 http://firebird.svn.sourceforge.net/firebird/?rev=53652&view=rev Author: firebirds Date: 2011-12-01 03:19:39 +0000 (Thu, 01 Dec 2011) 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 2011-12-01 00:47:58 UTC (rev 53651) +++ firebird/trunk/ChangeLog 2011-12-01 03:19:39 UTC (rev 53652) @@ -1,3 +1,7 @@ + 2011-12-01 00:47 asfernandes + M src/jrd/recsrc/AggregatedStream.cpp +Fixed window function with empty streams. + 2011-11-29 08:37 dimitr M builds/win32/msvc8/engine.vcproj Fixed the build. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-01 00:47:58 UTC (rev 53651) +++ firebird/trunk/src/jrd/build_no.h 2011-12-01 03:19:39 UTC (rev 53652) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29624 + FORMAL BUILD NUMBER:29625 */ -#define PRODUCT_VER_STRING "3.0.0.29624" -#define FILE_VER_STRING "WI-T3.0.0.29624" -#define LICENSE_VER_STRING "WI-T3.0.0.29624" -#define FILE_VER_NUMBER 3, 0, 0, 29624 +#define PRODUCT_VER_STRING "3.0.0.29625" +#define FILE_VER_STRING "WI-T3.0.0.29625" +#define LICENSE_VER_STRING "WI-T3.0.0.29625" +#define FILE_VER_NUMBER 3, 0, 0, 29625 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29624" +#define FB_BUILD_NO "29625" #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 2011-12-01 00:47:58 UTC (rev 53651) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-01 03:19:39 UTC (rev 53652) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29624 +BuildNum=29625 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-02 03:23:54
|
Revision: 53658 http://firebird.svn.sourceforge.net/firebird/?rev=53658&view=rev Author: firebirds Date: 2011-12-02 03:23:47 +0000 (Fri, 02 Dec 2011) 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 2011-12-01 09:54:36 UTC (rev 53657) +++ firebird/trunk/ChangeLog 2011-12-02 03:23:47 UTC (rev 53658) @@ -1,3 +1,15 @@ + 2011-12-01 09:54 dimitr + M src/jrd/exe.cpp +For a number of reasons, it seems being a good thing to unwind the trigger requests ASAP. + + 2011-12-01 09:37 dimitr + M src/jrd/vio.cpp +Correction. + + 2011-12-01 09:24 dimitr + M src/jrd/vio.cpp +Attempted to fix CORE-3490: Concurrency problem when using named cursors. The solution may look sub-optimal but it doesn't seem to affect the performance. + 2011-12-01 00:47 asfernandes M src/jrd/recsrc/AggregatedStream.cpp Fixed window function with empty streams. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-01 09:54:36 UTC (rev 53657) +++ firebird/trunk/src/jrd/build_no.h 2011-12-02 03:23:47 UTC (rev 53658) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29625 + FORMAL BUILD NUMBER:29628 */ -#define PRODUCT_VER_STRING "3.0.0.29625" -#define FILE_VER_STRING "WI-T3.0.0.29625" -#define LICENSE_VER_STRING "WI-T3.0.0.29625" -#define FILE_VER_NUMBER 3, 0, 0, 29625 +#define PRODUCT_VER_STRING "3.0.0.29628" +#define FILE_VER_STRING "WI-T3.0.0.29628" +#define LICENSE_VER_STRING "WI-T3.0.0.29628" +#define FILE_VER_NUMBER 3, 0, 0, 29628 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29625" +#define FB_BUILD_NO "29628" #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 2011-12-01 09:54:36 UTC (rev 53657) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-02 03:23:47 UTC (rev 53658) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29625 +BuildNum=29628 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-04 03:20:13
|
Revision: 53662 http://firebird.svn.sourceforge.net/firebird/?rev=53662&view=rev Author: firebirds Date: 2011-12-04 03:20:06 +0000 (Sun, 04 Dec 2011) 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 2011-12-03 20:22:14 UTC (rev 53661) +++ firebird/trunk/ChangeLog 2011-12-04 03:20:06 UTC (rev 53662) @@ -1,3 +1,12 @@ + 2011-12-03 20:22 asfernandes + M src/jrd/recsrc/AggregatedStream.cpp + M src/jrd/recsrc/RecursiveStream.cpp +Fixed CORE-3683 - Recursive query with GROUP BY in root part: wrong results if no index exists for fields that are grouped. + + 2011-12-03 12:48 dimitr + M src/burp/restore.epp +Fixed the authentication during restore via the Services API. + 2011-12-01 09:54 dimitr M src/jrd/exe.cpp For a number of reasons, it seems being a good thing to unwind the trigger requests ASAP. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-03 20:22:14 UTC (rev 53661) +++ firebird/trunk/src/jrd/build_no.h 2011-12-04 03:20:06 UTC (rev 53662) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29628 + FORMAL BUILD NUMBER:29630 */ -#define PRODUCT_VER_STRING "3.0.0.29628" -#define FILE_VER_STRING "WI-T3.0.0.29628" -#define LICENSE_VER_STRING "WI-T3.0.0.29628" -#define FILE_VER_NUMBER 3, 0, 0, 29628 +#define PRODUCT_VER_STRING "3.0.0.29630" +#define FILE_VER_STRING "WI-T3.0.0.29630" +#define LICENSE_VER_STRING "WI-T3.0.0.29630" +#define FILE_VER_NUMBER 3, 0, 0, 29630 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29628" +#define FB_BUILD_NO "29630" #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 2011-12-03 20:22:14 UTC (rev 53661) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-04 03:20:06 UTC (rev 53662) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29628 +BuildNum=29630 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-05 03:21:00
|
Revision: 53664 http://firebird.svn.sourceforge.net/firebird/?rev=53664&view=rev Author: firebirds Date: 2011-12-05 03:20:53 +0000 (Mon, 05 Dec 2011) 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 2011-12-04 18:36:26 UTC (rev 53663) +++ firebird/trunk/ChangeLog 2011-12-05 03:20:53 UTC (rev 53664) @@ -1,3 +1,15 @@ + 2011-12-04 18:36 asfernandes + M src/dsql/AggNodes.cpp + M src/dsql/AggNodes.h + M src/dsql/Nodes.h + M src/jrd/RecordSourceNodes.cpp + M src/jrd/RecordSourceNodes.h + M src/jrd/recsrc/AggregatedStream.cpp + M src/jrd/recsrc/RecordSource.h + M src/jrd/recsrc/WindowedStream.cpp +Fixed the problem with windowed functions in recursive CTEs, reported by Frank Ingermann in fb-devel. +This fix is complementary to the one done in CORE-3683. + 2011-12-03 20:22 asfernandes M src/jrd/recsrc/AggregatedStream.cpp M src/jrd/recsrc/RecursiveStream.cpp Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-04 18:36:26 UTC (rev 53663) +++ firebird/trunk/src/jrd/build_no.h 2011-12-05 03:20:53 UTC (rev 53664) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29630 + FORMAL BUILD NUMBER:29631 */ -#define PRODUCT_VER_STRING "3.0.0.29630" -#define FILE_VER_STRING "WI-T3.0.0.29630" -#define LICENSE_VER_STRING "WI-T3.0.0.29630" -#define FILE_VER_NUMBER 3, 0, 0, 29630 +#define PRODUCT_VER_STRING "3.0.0.29631" +#define FILE_VER_STRING "WI-T3.0.0.29631" +#define LICENSE_VER_STRING "WI-T3.0.0.29631" +#define FILE_VER_NUMBER 3, 0, 0, 29631 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29630" +#define FB_BUILD_NO "29631" #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 2011-12-04 18:36:26 UTC (rev 53663) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-05 03:20:53 UTC (rev 53664) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29630 +BuildNum=29631 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-06 03:21:30
|
Revision: 53670 http://firebird.svn.sourceforge.net/firebird/?rev=53670&view=rev Author: firebirds Date: 2011-12-06 03:21:23 +0000 (Tue, 06 Dec 2011) 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 2011-12-05 20:05:51 UTC (rev 53669) +++ firebird/trunk/ChangeLog 2011-12-06 03:21:23 UTC (rev 53670) @@ -1,3 +1,7 @@ + 2011-12-05 13:06 hvlad + M src/dsql/pass1.cpp +Fixed bug CORE-3690 : Wrong warning message for ambiguous query + 2011-12-04 18:36 asfernandes M src/dsql/AggNodes.cpp M src/dsql/AggNodes.h Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-05 20:05:51 UTC (rev 53669) +++ firebird/trunk/src/jrd/build_no.h 2011-12-06 03:21:23 UTC (rev 53670) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29631 + FORMAL BUILD NUMBER:29632 */ -#define PRODUCT_VER_STRING "3.0.0.29631" -#define FILE_VER_STRING "WI-T3.0.0.29631" -#define LICENSE_VER_STRING "WI-T3.0.0.29631" -#define FILE_VER_NUMBER 3, 0, 0, 29631 +#define PRODUCT_VER_STRING "3.0.0.29632" +#define FILE_VER_STRING "WI-T3.0.0.29632" +#define LICENSE_VER_STRING "WI-T3.0.0.29632" +#define FILE_VER_NUMBER 3, 0, 0, 29632 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29631" +#define FB_BUILD_NO "29632" #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 2011-12-05 20:05:51 UTC (rev 53669) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-06 03:21:23 UTC (rev 53670) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29631 +BuildNum=29632 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-07 03:21:05
|
Revision: 53682 http://firebird.svn.sourceforge.net/firebird/?rev=53682&view=rev Author: firebirds Date: 2011-12-07 03:20:58 +0000 (Wed, 07 Dec 2011) 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 2011-12-06 18:09:15 UTC (rev 53681) +++ firebird/trunk/ChangeLog 2011-12-07 03:20:58 UTC (rev 53682) @@ -1,3 +1,31 @@ + 2011-12-06 18:09 dimitr + M src/dsql/ExprNodes.cpp +Correction related to CORE-927. + + 2011-12-06 15:08 hvlad + M src/dsql/parse.y +Cleanup + + 2011-12-06 14:38 asfernandes + M doc/sql.extensions/README.builtin_functions.txt +Fixed CORE-3382 - Incomplete description of POSITION() function. + + 2011-12-06 14:24 asfernandes + M src/dsql/ExprNodes.cpp +Fixed CORE-3545 - Inconsistent domain's constraint validation in PSQL. + + 2011-12-06 13:12 dimitr + M src/jrd/trig.h +Fixed CORE-3692: Cannot drop a NOT NULL constraint on a field participating in the UNIQUE constraint. + + 2011-12-06 13:09 dimitr + M src/dsql/ExprNodes.cpp +Fixed CORE-927: Grants don't work for procedures used inside views. + + 2011-12-06 10:02 dimitr + M src/jrd/cmp.cpp +Fixed CORE-927: Grants don't work for procedures used inside views. + 2011-12-05 13:06 hvlad M src/dsql/pass1.cpp Fixed bug CORE-3690 : Wrong warning message for ambiguous query Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-06 18:09:15 UTC (rev 53681) +++ firebird/trunk/src/jrd/build_no.h 2011-12-07 03:20:58 UTC (rev 53682) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29632 + FORMAL BUILD NUMBER:29639 */ -#define PRODUCT_VER_STRING "3.0.0.29632" -#define FILE_VER_STRING "WI-T3.0.0.29632" -#define LICENSE_VER_STRING "WI-T3.0.0.29632" -#define FILE_VER_NUMBER 3, 0, 0, 29632 +#define PRODUCT_VER_STRING "3.0.0.29639" +#define FILE_VER_STRING "WI-T3.0.0.29639" +#define LICENSE_VER_STRING "WI-T3.0.0.29639" +#define FILE_VER_NUMBER 3, 0, 0, 29639 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29632" +#define FB_BUILD_NO "29639" #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 2011-12-06 18:09:15 UTC (rev 53681) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-07 03:20:58 UTC (rev 53682) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29632 +BuildNum=29639 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-09 03:23:06
|
Revision: 53685 http://firebird.svn.sourceforge.net/firebird/?rev=53685&view=rev Author: firebirds Date: 2011-12-09 03:22:59 +0000 (Fri, 09 Dec 2011) 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 2011-12-08 15:13:28 UTC (rev 53684) +++ firebird/trunk/ChangeLog 2011-12-09 03:22:59 UTC (rev 53685) @@ -1,3 +1,7 @@ + 2011-12-08 15:13 asfernandes + M src/jrd/RecordSourceNodes.cpp +Fixed CORE-3694 - internal Firebird consistency check in query with grouping by subquery+stored procedure+aggregate. + 2011-12-06 18:09 dimitr M src/dsql/ExprNodes.cpp Correction related to CORE-927. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-08 15:13:28 UTC (rev 53684) +++ firebird/trunk/src/jrd/build_no.h 2011-12-09 03:22:59 UTC (rev 53685) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29639 + FORMAL BUILD NUMBER:29640 */ -#define PRODUCT_VER_STRING "3.0.0.29639" -#define FILE_VER_STRING "WI-T3.0.0.29639" -#define LICENSE_VER_STRING "WI-T3.0.0.29639" -#define FILE_VER_NUMBER 3, 0, 0, 29639 +#define PRODUCT_VER_STRING "3.0.0.29640" +#define FILE_VER_STRING "WI-T3.0.0.29640" +#define LICENSE_VER_STRING "WI-T3.0.0.29640" +#define FILE_VER_NUMBER 3, 0, 0, 29640 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29639" +#define FB_BUILD_NO "29640" #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 2011-12-08 15:13:28 UTC (rev 53684) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-09 03:22:59 UTC (rev 53685) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29639 +BuildNum=29640 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-10 03:22:23
|
Revision: 53687 http://firebird.svn.sourceforge.net/firebird/?rev=53687&view=rev Author: firebirds Date: 2011-12-10 03:22:16 +0000 (Sat, 10 Dec 2011) 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 2011-12-10 01:18:58 UTC (rev 53686) +++ firebird/trunk/ChangeLog 2011-12-10 03:22:16 UTC (rev 53687) @@ -1,3 +1,8 @@ + 2011-12-10 01:18 asfernandes + M src/dsql/ExprNodes.cpp + M src/jrd/cmp.cpp +Misc. + 2011-12-08 15:13 asfernandes M src/jrd/RecordSourceNodes.cpp Fixed CORE-3694 - internal Firebird consistency check in query with grouping by subquery+stored procedure+aggregate. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-10 01:18:58 UTC (rev 53686) +++ firebird/trunk/src/jrd/build_no.h 2011-12-10 03:22:16 UTC (rev 53687) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29640 + FORMAL BUILD NUMBER:29641 */ -#define PRODUCT_VER_STRING "3.0.0.29640" -#define FILE_VER_STRING "WI-T3.0.0.29640" -#define LICENSE_VER_STRING "WI-T3.0.0.29640" -#define FILE_VER_NUMBER 3, 0, 0, 29640 +#define PRODUCT_VER_STRING "3.0.0.29641" +#define FILE_VER_STRING "WI-T3.0.0.29641" +#define LICENSE_VER_STRING "WI-T3.0.0.29641" +#define FILE_VER_NUMBER 3, 0, 0, 29641 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29640" +#define FB_BUILD_NO "29641" #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 2011-12-10 01:18:58 UTC (rev 53686) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-10 03:22:16 UTC (rev 53687) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29640 +BuildNum=29641 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-15 03:21:17
|
Revision: 53697 http://firebird.svn.sourceforge.net/firebird/?rev=53697&view=rev Author: firebirds Date: 2011-12-15 03:21:11 +0000 (Thu, 15 Dec 2011) 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 2011-12-14 16:08:05 UTC (rev 53696) +++ firebird/trunk/ChangeLog 2011-12-15 03:21:11 UTC (rev 53697) @@ -1,3 +1,28 @@ + 2011-12-14 14:51 paulbeach + M builds/install/arch-specific/darwin/preupgrade-script +CORE-3862 - Multiple update installs can cause problems. + + 2011-12-14 06:45 dimitr + M src/jrd/recsrc/AggregatedStream.cpp + M src/jrd/recsrc/BufferedStream.cpp + M src/jrd/recsrc/ConditionalStream.cpp + M src/jrd/recsrc/FilteredStream.cpp + M src/jrd/recsrc/FirstRowsStream.cpp + M src/jrd/recsrc/FullOuterJoin.cpp + M src/jrd/recsrc/HashJoin.cpp + M src/jrd/recsrc/LockedStream.cpp + M src/jrd/recsrc/MergeJoin.cpp + M src/jrd/recsrc/NestedLoopJoin.cpp + M src/jrd/recsrc/RecordSource.cpp + M src/jrd/recsrc/RecordSource.h + M src/jrd/recsrc/RecursiveStream.cpp + M src/jrd/recsrc/SingularStream.cpp + M src/jrd/recsrc/SkipRowsStream.cpp + M src/jrd/recsrc/SortedStream.cpp + M src/jrd/recsrc/Union.cpp + M src/jrd/recsrc/WindowedStream.cpp +Reworked the fix for CORE-3683: Recursive query with GROUP BY in root part: wrong results if no index exists for fields that are grouped. It resolves some optimization regressions appeared after the original fix. + 2011-12-10 01:18 asfernandes M src/dsql/ExprNodes.cpp M src/jrd/cmp.cpp Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-14 16:08:05 UTC (rev 53696) +++ firebird/trunk/src/jrd/build_no.h 2011-12-15 03:21:11 UTC (rev 53697) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29641 + FORMAL BUILD NUMBER:29643 */ -#define PRODUCT_VER_STRING "3.0.0.29641" -#define FILE_VER_STRING "WI-T3.0.0.29641" -#define LICENSE_VER_STRING "WI-T3.0.0.29641" -#define FILE_VER_NUMBER 3, 0, 0, 29641 +#define PRODUCT_VER_STRING "3.0.0.29643" +#define FILE_VER_STRING "WI-T3.0.0.29643" +#define LICENSE_VER_STRING "WI-T3.0.0.29643" +#define FILE_VER_NUMBER 3, 0, 0, 29643 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29641" +#define FB_BUILD_NO "29643" #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 2011-12-14 16:08:05 UTC (rev 53696) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-15 03:21:11 UTC (rev 53697) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29641 +BuildNum=29643 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-17 03:21:40
|
Revision: 53704 http://firebird.svn.sourceforge.net/firebird/?rev=53704&view=rev Author: firebirds Date: 2011-12-17 03:21:33 +0000 (Sat, 17 Dec 2011) 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 2011-12-17 01:34:39 UTC (rev 53703) +++ firebird/trunk/ChangeLog 2011-12-17 03:21:33 UTC (rev 53704) @@ -1,3 +1,12 @@ + 2011-12-17 01:34 asfernandes + M src/jrd/recsrc/RecursiveStream.cpp + M src/jrd/trace/TraceObjects.cpp +Misc. + + 2011-12-16 14:48 hvlad + M src/jrd/trace/TraceObjects.cpp +Second try to work with null's correctly + 2011-12-14 14:51 paulbeach M builds/install/arch-specific/darwin/preupgrade-script CORE-3862 - Multiple update installs can cause problems. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-17 01:34:39 UTC (rev 53703) +++ firebird/trunk/src/jrd/build_no.h 2011-12-17 03:21:33 UTC (rev 53704) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29643 + FORMAL BUILD NUMBER:29645 */ -#define PRODUCT_VER_STRING "3.0.0.29643" -#define FILE_VER_STRING "WI-T3.0.0.29643" -#define LICENSE_VER_STRING "WI-T3.0.0.29643" -#define FILE_VER_NUMBER 3, 0, 0, 29643 +#define PRODUCT_VER_STRING "3.0.0.29645" +#define FILE_VER_STRING "WI-T3.0.0.29645" +#define LICENSE_VER_STRING "WI-T3.0.0.29645" +#define FILE_VER_NUMBER 3, 0, 0, 29645 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29643" +#define FB_BUILD_NO "29645" #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 2011-12-17 01:34:39 UTC (rev 53703) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-17 03:21:33 UTC (rev 53704) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29643 +BuildNum=29645 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-20 03:21:50
|
Revision: 53711 http://firebird.svn.sourceforge.net/firebird/?rev=53711&view=rev Author: firebirds Date: 2011-12-20 03:21:44 +0000 (Tue, 20 Dec 2011) 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 2011-12-19 16:01:11 UTC (rev 53710) +++ firebird/trunk/ChangeLog 2011-12-20 03:21:44 UTC (rev 53711) @@ -1,3 +1,8 @@ + 2011-12-19 10:01 hvlad + M src/dsql/dsql.cpp +Fixed AV in trace when statement free event is traced and it is first traced event for a given statement (i.e. prepare\execution was not traced before). +Adriano, please review. + 2011-12-17 01:34 asfernandes M src/jrd/recsrc/RecursiveStream.cpp M src/jrd/trace/TraceObjects.cpp Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-19 16:01:11 UTC (rev 53710) +++ firebird/trunk/src/jrd/build_no.h 2011-12-20 03:21:44 UTC (rev 53711) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29645 + FORMAL BUILD NUMBER:29646 */ -#define PRODUCT_VER_STRING "3.0.0.29645" -#define FILE_VER_STRING "WI-T3.0.0.29645" -#define LICENSE_VER_STRING "WI-T3.0.0.29645" -#define FILE_VER_NUMBER 3, 0, 0, 29645 +#define PRODUCT_VER_STRING "3.0.0.29646" +#define FILE_VER_STRING "WI-T3.0.0.29646" +#define LICENSE_VER_STRING "WI-T3.0.0.29646" +#define FILE_VER_NUMBER 3, 0, 0, 29646 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29645" +#define FB_BUILD_NO "29646" #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 2011-12-19 16:01:11 UTC (rev 53710) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-20 03:21:44 UTC (rev 53711) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29645 +BuildNum=29646 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <asf...@us...> - 2011-12-20 14:30:48
|
Revision: 53717 http://firebird.svn.sourceforge.net/firebird/?rev=53717&view=rev Author: asfernandes Date: 2011-12-20 14:30:41 +0000 (Tue, 20 Dec 2011) Log Message: ----------- Fixed CORE-3238 - Makes GEN_UUID return a compliant RFC-4122 binary UUID and introduce CHAR_TO_UUID2 and UUID_TO_CHAR2 to convert UUIDs from/to string also complying with the RFC. Modified Paths: -------------- firebird/trunk/doc/sql.extensions/README.builtin_functions.txt firebird/trunk/src/common/os/guid.h firebird/trunk/src/common/os/posix/guid.cpp firebird/trunk/src/common/os/win32/guid.cpp firebird/trunk/src/common/sha.cpp firebird/trunk/src/dsql/parse.y firebird/trunk/src/jrd/RandomGenerator.cpp firebird/trunk/src/jrd/SysFunction.cpp firebird/trunk/src/jrd/nbak.cpp firebird/trunk/src/jrd/trace/TraceService.cpp firebird/trunk/src/utilities/gstat/ppg.cpp firebird/trunk/src/utilities/nbackup/nbackup.cpp firebird/trunk/src/yvalve/keywords.cpp Modified: firebird/trunk/doc/sql.extensions/README.builtin_functions.txt =================================================================== --- firebird/trunk/doc/sql.extensions/README.builtin_functions.txt 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/doc/sql.extensions/README.builtin_functions.txt 2011-12-20 14:30:41 UTC (rev 53717) @@ -246,12 +246,38 @@ Format: CHAR_TO_UUID( <string> ) +Notes: + If you have not used this function before, its usage is discouraged. CHAR_TO_UUID2 superseds it. + Example: select char_to_uuid('93519227-8D50-4E47-81AA-8F6678C096A1') from rdb$database; -See also: GEN_UUID and UUID_TO_CHAR +See also: GEN_UUID, CHAR_TO_UUID2, UUID_TO_CHAR and UUID_TO_CHAR2 +------------- +CHAR_TO_UUID2 +------------- + +Function: + Converts the CHAR(32) ASCII representation of an UUID + (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) to the CHAR(16) OCTETS + representation (optimized for storage). + +Format: + CHAR_TO_UUID2( <string> ) + +Notes: + This function superseds CHAR_TO_UUID. The difference between them is that CHAR_TO_UUID does a + byte-by-byte conversion of the ASCII string to the OCTETS one, while CHAR_TO_UUID2 converts + a RFC-4122 compliant ASCII UUID to a compliant OCTETS string. + +Example: + select char_to_uuid2('93519227-8D50-4E47-81AA-8F6678C096A1') from rdb$database; + +See also: GEN_UUID, UUID_TO_CHAR2 + + --- COS --- @@ -405,10 +431,17 @@ Format: GEN_UUID() +Notes: + In Firebird 2.5.0 and 2.5.1, GEN_UUID was returning completely random strings. This is not + compliant with the RFC-4122 (UUID specification). + In Firebird 2.5.2 and 3.0 this was fixed. Now GEN_UUID returns a compliant UUID version 4 + string, where some bits are reserved and the others are random. The string format of a compliant + UUID is XXXXXXXX-XXXX-4XXX-YXXX-XXXXXXXXXXXX, where 4 is fixed (version) and Y is 8, 9, A or B. + Example: insert into records (id) value (gen_uuid()); -See also: CHAR_TO_UUID and UUID_TO_CHAR +See also: CHAR_TO_UUID, UUID_TO_CHAR, CHAR_TO_UUID2, UUID_TO_CHAR2 ---- @@ -840,7 +873,32 @@ Format: UUID_TO_CHAR( <string> ) +Notes: + If you have not used this function before, its usage is discouraged. UUID_TO_CHAR2 superseds it. + Example: select uuid_to_char(gen_uuid()) from rdb$database; -See also: GEN_UUID and CHAR_TO_UUID +See also: GEN_UUID, UUID_TO_CHAR2, CHAR_TO_UUID and CHAR_TO_UUID2 + + +------------- +UUID_TO_CHAR2 +------------- + +Function: + Converts a CHAR(16) OCTETS UUID (that's returned by GEN_UUID) to the + CHAR(32) ASCII representation (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX). + +Format: + UUID_TO_CHAR2( <string> ) + +Notes: + This function superseds UUID_TO_CHAR. The difference between them is that UUID_TO_CHAR does a + byte-by-byte conversion of the OCTETS string to the ASCII one, while UUID_TO_CHAR2 converts + a RFC-4122 compliant OCTETS UUID to a compliant ASCII string. + +Example: + select uuid_to_char2(gen_uuid()) from rdb$database; + +See also: GEN_UUID, CHAR_TO_UUID2 Modified: firebird/trunk/src/common/os/guid.h =================================================================== --- firebird/trunk/src/common/os/guid.h 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/common/os/guid.h 2011-12-20 14:30:41 UTC (rev 53717) @@ -22,18 +22,19 @@ * * All Rights Reserved. * Contributor(s): ______________________________________. + * Adriano dos Santos Fernandes * - * - * */ -#ifndef GUID_H -#define GUID_H +#ifndef FB_GUID_H +#define FB_GUID_H #include <stdlib.h> #include <stdio.h> #include "fb_types.h" +namespace Firebird { + const int GUID_BUFF_SIZE = 39; const int GUID_BODY_SIZE = 36; @@ -42,41 +43,73 @@ const char* const GUID_NEW_FORMAT = "{%02hX%02hX%02hX%02hX-%02hX%02hX-%02hX%02hX-%02hX%02hX-%02hX%02hX%02hX%02hX%02hX%02hX}"; -struct FB_GUID +struct Guid { - USHORT data[8]; + enum Style + { + STYLE_NBACKUP, // Format introduced with nbackup + STYLE_BROKEN, // Format introduced in FB 2.5.0 + STYLE_UUID // Format as defined in the RFC-4122. + }; + + union + { + USHORT data[8]; + + struct // Compatible with Win32 GUID struct layout. + { + ULONG data1; + USHORT data2; + USHORT data3; + UCHAR data4[8]; + }; + }; }; void GenerateRandomBytes(void* buffer, size_t size); -void GenerateGuid(FB_GUID* guid); +void GenerateGuid(Guid* guid); // These functions receive buffers of at least GUID_BUFF_SIZE length -inline void GuidToString(char* buffer, const FB_GUID* guid, bool legacy) +inline void GuidToString(char* buffer, const Guid* guid, Guid::Style style) { - if (legacy) // nbackup guid + switch (style) { - sprintf(buffer, GUID_LEGACY_FORMAT, - guid->data[0], guid->data[1], guid->data[2], guid->data[3], - guid->data[4], guid->data[5], guid->data[6], guid->data[7]); + case Guid::STYLE_NBACKUP: + sprintf(buffer, GUID_LEGACY_FORMAT, + guid->data[0], guid->data[1], guid->data[2], guid->data[3], + guid->data[4], guid->data[5], guid->data[6], guid->data[7]); + break; + + case Guid::STYLE_BROKEN: + sprintf(buffer, GUID_NEW_FORMAT, + USHORT(guid->data[0] & 0xFF), USHORT(guid->data[0] >> 8), + USHORT(guid->data[1] & 0xFF), USHORT(guid->data[1] >> 8), + USHORT(guid->data[2] & 0xFF), USHORT(guid->data[2] >> 8), + USHORT(guid->data[3] & 0xFF), USHORT(guid->data[3] >> 8), + USHORT(guid->data[4] & 0xFF), USHORT(guid->data[4] >> 8), + USHORT(guid->data[5] & 0xFF), USHORT(guid->data[5] >> 8), + USHORT(guid->data[6] & 0xFF), USHORT(guid->data[6] >> 8), + USHORT(guid->data[7] & 0xFF), USHORT(guid->data[7] >> 8)); + break; + + case Guid::STYLE_UUID: + sprintf(buffer, GUID_NEW_FORMAT, + USHORT((guid->data1 >> 24) & 0xFF), USHORT((guid->data1 >> 16) & 0xFF), + USHORT((guid->data1 >> 8) & 0xFF), USHORT(guid->data1 & 0xFF), + USHORT((guid->data2 >> 8) & 0xFF), USHORT(guid->data2 & 0xFF), + USHORT((guid->data3 >> 8) & 0xFF), USHORT(guid->data3 & 0xFF), + USHORT(guid->data4[0]), USHORT(guid->data4[1]), + USHORT(guid->data4[2]), USHORT(guid->data4[3]), + USHORT(guid->data4[4]), USHORT(guid->data4[5]), + USHORT(guid->data4[6]), USHORT(guid->data4[7])); + break; } - else - { - sprintf(buffer, GUID_NEW_FORMAT, - USHORT(guid->data[0] & 0xFF), USHORT(guid->data[0] >> 8), - USHORT(guid->data[1] & 0xFF), USHORT(guid->data[1] >> 8), - USHORT(guid->data[2] & 0xFF), USHORT(guid->data[2] >> 8), - USHORT(guid->data[3] & 0xFF), USHORT(guid->data[3] >> 8), - USHORT(guid->data[4] & 0xFF), USHORT(guid->data[4] >> 8), - USHORT(guid->data[5] & 0xFF), USHORT(guid->data[5] >> 8), - USHORT(guid->data[6] & 0xFF), USHORT(guid->data[6] >> 8), - USHORT(guid->data[7] & 0xFF), USHORT(guid->data[7] >> 8)); - } } -inline void StringToGuid(FB_GUID* guid, const char* buffer, bool legacy) +inline void StringToGuid(Guid* guid, const char* buffer, Guid::Style style) { - if (legacy) // nbackup guid + if (style == Guid::STYLE_NBACKUP) { sscanf(buffer, GUID_LEGACY_FORMAT, &guid->data[0], &guid->data[1], &guid->data[2], &guid->data[3], @@ -91,15 +124,34 @@ &bytes[8], &bytes[9], &bytes[10], &bytes[11], &bytes[12], &bytes[13], &bytes[14], &bytes[15]); - guid->data[0] = bytes[0] | (bytes[1] << 8); - guid->data[1] = bytes[2] | (bytes[3] << 8); - guid->data[2] = bytes[4] | (bytes[5] << 8); - guid->data[3] = bytes[6] | (bytes[7] << 8); - guid->data[4] = bytes[8] | (bytes[9] << 8); - guid->data[5] = bytes[10] | (bytes[11] << 8); - guid->data[6] = bytes[12] | (bytes[13] << 8); - guid->data[7] = bytes[14] | (bytes[15] << 8); + if (style == Guid::STYLE_BROKEN) + { + guid->data[0] = bytes[0] | (bytes[1] << 8); + guid->data[1] = bytes[2] | (bytes[3] << 8); + guid->data[2] = bytes[4] | (bytes[5] << 8); + guid->data[3] = bytes[6] | (bytes[7] << 8); + guid->data[4] = bytes[8] | (bytes[9] << 8); + guid->data[5] = bytes[10] | (bytes[11] << 8); + guid->data[6] = bytes[12] | (bytes[13] << 8); + guid->data[7] = bytes[14] | (bytes[15] << 8); + } + else if (style == Guid::STYLE_UUID) + { + guid->data1 = (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3]; + guid->data2 = (bytes[4] << 8) | bytes[5]; + guid->data3 = (bytes[6] << 8) | bytes[7]; + guid->data4[0] = bytes[8]; + guid->data4[1] = bytes[9]; + guid->data4[2] = bytes[10]; + guid->data4[3] = bytes[11]; + guid->data4[4] = bytes[12]; + guid->data4[5] = bytes[13]; + guid->data4[6] = bytes[14]; + guid->data4[7] = bytes[15]; + } } } -#endif +} // namespace + +#endif // FB_GUID_H Modified: firebird/trunk/src/common/os/posix/guid.cpp =================================================================== --- firebird/trunk/src/common/os/posix/guid.cpp 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/common/os/posix/guid.cpp 2011-12-20 14:30:41 UTC (rev 53717) @@ -37,6 +37,9 @@ #include <stdio.h> #include <errno.h> +namespace Firebird { + + void GenerateRandomBytes(void* buffer, size_t size) { // do not use /dev/random because it may return lesser data than we need. @@ -71,7 +74,12 @@ } } -void GenerateGuid(FB_GUID* guid) +void GenerateGuid(Guid* guid) { - GenerateRandomBytes(guid, sizeof(FB_GUID)); + GenerateRandomBytes(guid, sizeof(Guid)); + guid->data3 = (4 << 12) | (guid->data3 & 0xFFF); // version 4 + guid->data4[0] = 0x80 | (guid->data4[0] & 0x3F); // variant } + + +} // namespace Modified: firebird/trunk/src/common/os/win32/guid.cpp =================================================================== --- firebird/trunk/src/common/os/win32/guid.cpp 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/common/os/win32/guid.cpp 2011-12-20 14:30:41 UTC (rev 53717) @@ -38,7 +38,9 @@ #include "../common/os/guid.h" #include "fb_exception.h" +namespace Firebird { + void GenerateRandomBytes(void* buffer, size_t size) { HCRYPTPROV hProv; @@ -70,9 +72,12 @@ CryptReleaseContext(hProv, 0); } -void GenerateGuid(FB_GUID* guid) +void GenerateGuid(Guid* guid) { const HRESULT error = CoCreateGuid((GUID*) guid); if (!SUCCEEDED(error)) Firebird::system_call_failed::raise("CoCreateGuid", error); } + + +} // namespace Modified: firebird/trunk/src/common/sha.cpp =================================================================== --- firebird/trunk/src/common/sha.cpp 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/common/sha.cpp 2011-12-20 14:30:41 UTC (rev 53717) @@ -398,7 +398,7 @@ void Jrd::CryptSupport::random(Firebird::string& randomValue, size_t length) { BinHash binRand; - GenerateRandomBytes(binRand.getBuffer(length), length); + Firebird::GenerateRandomBytes(binRand.getBuffer(length), length); base64(randomValue, binRand); randomValue.resize(length, '$'); } Modified: firebird/trunk/src/dsql/parse.y =================================================================== --- firebird/trunk/src/dsql/parse.y 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/dsql/parse.y 2011-12-20 14:30:41 UTC (rev 53717) @@ -535,6 +535,7 @@ %token <legacyNode> AUTONOMOUS %token <legacyNode> CHAR_TO_UUID +%token <legacyNode> CHAR_TO_UUID2 %token <legacyNode> FIRSTNAME %token <legacyNode> GRANTED %token <legacyNode> LASTNAME @@ -543,6 +544,7 @@ %token <legacyNode> OS_NAME %token <legacyNode> SIMILAR %token <legacyNode> UUID_TO_CHAR +%token <legacyNode> UUID_TO_CHAR2 // new execute statement %token <legacyNode> CALLER %token <legacyNode> COMMON @@ -5931,6 +5933,7 @@ | BIN_XOR | CEIL | CHAR_TO_UUID + | CHAR_TO_UUID2 | COS | COSH | COT @@ -5964,6 +5967,7 @@ | TANH | TRUNC | UUID_TO_CHAR + | UUID_TO_CHAR2 ; system_function_special_syntax @@ -6499,12 +6503,14 @@ | WEEK | AUTONOMOUS // added in FB 2.5 | CHAR_TO_UUID + | CHAR_TO_UUID2 | FIRSTNAME | MIDDLENAME | LASTNAME | MAPPING | OS_NAME | UUID_TO_CHAR + | UUID_TO_CHAR2 | GRANTED | CALLER // new execute statement | COMMON Modified: firebird/trunk/src/jrd/RandomGenerator.cpp =================================================================== --- firebird/trunk/src/jrd/RandomGenerator.cpp 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/jrd/RandomGenerator.cpp 2011-12-20 14:30:41 UTC (rev 53717) @@ -25,15 +25,15 @@ #include "../jrd/RandomGenerator.h" #include "../common/os/guid.h" +using namespace Firebird; +using namespace Jrd; -namespace Jrd { RandomGenerator::RandomGenerator() : bufferPos(BUFFER_SIZE) { } - void RandomGenerator::getBytes(void* p, size_t size) { while (size > 0) @@ -54,6 +54,3 @@ size -= size2; } } - -} // namespace - Modified: firebird/trunk/src/jrd/SysFunction.cpp =================================================================== --- firebird/trunk/src/jrd/SysFunction.cpp 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/jrd/SysFunction.cpp 2011-12-20 14:30:41 UTC (rev 53717) @@ -1511,8 +1511,8 @@ buffer[38] = '\0'; memcpy(buffer + 1, data, GUID_BODY_SIZE); - FB_GUID guid; - StringToGuid(&guid, buffer, false); + Guid guid; + StringToGuid(&guid, buffer, (Guid::Style)(IPTR) function->misc); dsc result; result.makeText(16, ttype_binary, reinterpret_cast<UCHAR*>(guid.data)); @@ -2043,7 +2043,7 @@ { fb_assert(args.getCount() == 0); - FB_GUID guid; + Guid guid; fb_assert(sizeof(guid.data) == 16); GenerateGuid(&guid); @@ -3611,16 +3611,16 @@ UCHAR* data; const USHORT len = MOV_get_string(value, &data, NULL, 0); - if (len != sizeof(FB_GUID)) + if (len != sizeof(Guid)) { status_exception::raise(Arg::Gds(isc_expression_eval_err) << Arg::Gds(isc_sysf_binuuid_wrongsize) << - Arg::Num(sizeof(FB_GUID)) << + Arg::Num(sizeof(Guid)) << Arg::Str(function->name)); } char buffer[GUID_BUFF_SIZE]; - GuidToString(buffer, reinterpret_cast<const FB_GUID*>(data), false); + GuidToString(buffer, reinterpret_cast<const Guid*>(data), (Guid::Style)(IPTR) function->misc); dsc result; result.makeText(GUID_BODY_SIZE, ttype_ascii, reinterpret_cast<UCHAR*>(buffer) + 1); @@ -3655,7 +3655,8 @@ {"BIN_XOR", 2, -1, setParamsInteger, makeBin, evlBin, (void*) funBinXor}, {"CEIL", 1, 1, setParamsDouble, makeCeilFloor, evlCeil, NULL}, {"CEILING", 1, 1, setParamsDouble, makeCeilFloor, evlCeil, NULL}, - {"CHAR_TO_UUID", 1, 1, setParamsCharToUuid, makeUuid, evlCharToUuid, NULL}, + {"CHAR_TO_UUID", 1, 1, setParamsCharToUuid, makeUuid, evlCharToUuid, (void*)(IPTR) Guid::STYLE_BROKEN}, + {"CHAR_TO_UUID2", 1, 1, setParamsCharToUuid, makeUuid, evlCharToUuid, (void*)(IPTR) Guid::STYLE_UUID}, {"COS", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCos}, {"COSH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCosh}, {"COT", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfCot}, @@ -3692,7 +3693,8 @@ {"TAN", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfTan}, {"TANH", 1, 1, setParamsDouble, makeDoubleResult, evlStdMath, (void*) trfTanh}, {"TRUNC", 1, 2, setParamsRoundTrunc, makeTrunc, evlTrunc, NULL}, - {"UUID_TO_CHAR", 1, 1, setParamsUuidToChar, makeUuidToChar, evlUuidToChar, NULL}, + {"UUID_TO_CHAR", 1, 1, setParamsUuidToChar, makeUuidToChar, evlUuidToChar, (void*)(IPTR) Guid::STYLE_BROKEN}, + {"UUID_TO_CHAR2", 1, 1, setParamsUuidToChar, makeUuidToChar, evlUuidToChar, (void*)(IPTR) Guid::STYLE_UUID}, {"", 0, 0, NULL, NULL, NULL, NULL} }; Modified: firebird/trunk/src/jrd/nbak.cpp =================================================================== --- firebird/trunk/src/jrd/nbak.cpp 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/jrd/nbak.cpp 2011-12-20 14:30:41 UTC (rev 53717) @@ -298,7 +298,7 @@ if (!PIO_write(diff_file, &temp_bdb, temp_bdb.bdb_buffer, tdbb->tdbb_status_vector)) ERR_punt(); NBAK_TRACE(("Set backup state in header")); - FB_GUID guid; + Guid guid; GenerateGuid(&guid); // Set state in database header page. All changes are written to main database file yet. CCH_MARK_MUST_WRITE(tdbb, &window); Modified: firebird/trunk/src/jrd/trace/TraceService.cpp =================================================================== --- firebird/trunk/src/jrd/trace/TraceService.cpp 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/jrd/trace/TraceService.cpp 2011-12-20 14:30:41 UTC (rev 53717) @@ -103,11 +103,11 @@ if (interactive) { - FB_GUID guid; + Guid guid; GenerateGuid(&guid); char* buff = session.ses_logfile.getBuffer(GUID_BUFF_SIZE); - GuidToString(buff, &guid, false); + GuidToString(buff, &guid, Guid::STYLE_BROKEN); session.ses_logfile.insert(0, "fb_trace."); } Modified: firebird/trunk/src/utilities/gstat/ppg.cpp =================================================================== --- firebird/trunk/src/utilities/gstat/ppg.cpp 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/utilities/gstat/ppg.cpp 2011-12-20 14:30:41 UTC (rev 53717) @@ -40,6 +40,7 @@ // gstat directly reads database files, therefore using namespace Ods; +using Firebird::Guid; void PPG_print_header(const header_page* header, ULONG page, bool nocreation, Firebird::UtilSvc* uSvc) @@ -255,8 +256,8 @@ case HDR_backup_guid: { - char buff[GUID_BUFF_SIZE]; - GuidToString(buff, reinterpret_cast<const FB_GUID*>(p + 2), true); + char buff[Firebird::GUID_BUFF_SIZE]; + Firebird::GuidToString(buff, reinterpret_cast<const Guid*>(p + 2), Guid::STYLE_NBACKUP); uSvc->printf(false, "\tDatabase backup GUID:\t%s\n", buff); break; } Modified: firebird/trunk/src/utilities/nbackup/nbackup.cpp =================================================================== --- firebird/trunk/src/utilities/nbackup/nbackup.cpp 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/utilities/nbackup/nbackup.cpp 2011-12-20 14:30:41 UTC (rev 53717) @@ -253,8 +253,8 @@ SSHORT version; // Incremental backup format version. SSHORT level; // Backup level. // \\\\\ ---- this is 8 bytes. should not cause alignment problems - FB_GUID backup_guid; // GUID of this backup - FB_GUID prev_guid; // GUID of previous level backup + Guid backup_guid; // GUID of this backup + Guid prev_guid; // GUID of previous level backup ULONG page_size; // Size of pages in the database and backup file // These fields are currently filled, but not used. May be used in future versions ULONG backup_scn; // SCN of this backup @@ -925,7 +925,7 @@ --db_size; page_reads++; - FB_GUID backup_guid; + Guid backup_guid; bool guid_found = false; const UCHAR* p = reinterpret_cast<Ods::header_page*>(page_buff)->hdr_data; while (true) @@ -933,9 +933,9 @@ switch (*p) { case Ods::HDR_backup_guid: - if (p[1] != sizeof(FB_GUID)) + if (p[1] != sizeof(Guid)) break; - memcpy(&backup_guid, p + 2, sizeof(FB_GUID)); + memcpy(&backup_guid, p + 2, sizeof(Guid)); guid_found = true; break; case Ods::HDR_difference_file: @@ -957,7 +957,7 @@ bh.version = 1; bh.level = level; bh.backup_guid = backup_guid; - StringToGuid(&bh.prev_guid, prev_guid, true); + StringToGuid(&bh.prev_guid, prev_guid, Guid::STYLE_NBACKUP); bh.page_size = header->hdr_page_size; bh.backup_scn = backup_scn; bh.prev_scn = prev_scn; @@ -1115,7 +1115,7 @@ in_sqlda->sqlvar[0].sqldata = (char*) &level; in_sqlda->sqlvar[0].sqlind = &null_flag; char temp[GUID_BUFF_SIZE]; - GuidToString(temp, &backup_guid, true); + GuidToString(temp, &backup_guid, Guid::STYLE_NBACKUP); in_sqlda->sqlvar[1].sqldata = temp; in_sqlda->sqlvar[1].sqlind = &null_flag; in_sqlda->sqlvar[2].sqldata = (char*) &backup_scn; @@ -1184,7 +1184,7 @@ UCHAR *page_buffer = NULL; try { int curLevel = 0; - FB_GUID prev_guid; + Guid prev_guid; while (true) { if (!filecount) @@ -1266,7 +1266,7 @@ Arg::Num(bakheader.level) << bakname.c_str() << Arg::Num(curLevel)); } // We may also add SCN check, but GUID check covers this case too - if (memcmp(&bakheader.prev_guid, &prev_guid, sizeof(FB_GUID)) != 0) + if (memcmp(&bakheader.prev_guid, &prev_guid, sizeof(Guid)) != 0) status_exception::raise(Arg::Gds(isc_nbackup_wrong_orderbk) << bakname.c_str()); delete_database = true; @@ -1330,9 +1330,9 @@ switch (*p) { case Ods::HDR_backup_guid: - if (p[1] != sizeof(FB_GUID)) + if (p[1] != sizeof(Guid)) break; - memcpy(&prev_guid, p + 2, sizeof(FB_GUID)); + memcpy(&prev_guid, p + 2, sizeof(Guid)); guid_found = true; break; case Ods::HDR_difference_file: Modified: firebird/trunk/src/yvalve/keywords.cpp =================================================================== --- firebird/trunk/src/yvalve/keywords.cpp 2011-12-20 13:03:12 UTC (rev 53716) +++ firebird/trunk/src/yvalve/keywords.cpp 2011-12-20 14:30:41 UTC (rev 53717) @@ -111,6 +111,7 @@ {KW_CHAR, "CHAR", 1, false}, {CHAR_LENGTH, "CHAR_LENGTH", 2, false}, {CHAR_TO_UUID, "CHAR_TO_UUID", 2, false}, + {CHAR_TO_UUID2, "CHAR_TO_UUID2", 2, false}, {CHARACTER, "CHARACTER", 1, false}, {CHARACTER_LENGTH, "CHARACTER_LENGTH", 2, false}, {CHECK, "CHECK", 1, false}, @@ -413,6 +414,7 @@ {USER, "USER", 1, false}, {USING, "USING", 2, false}, {UUID_TO_CHAR, "UUID_TO_CHAR", 2, false}, + {UUID_TO_CHAR2, "UUID_TO_CHAR2", 2, false}, {KW_VALUE, "VALUE", 1, false}, {VALUES, "VALUES", 1, false}, {VARCHAR, "VARCHAR", 1, false}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-21 03:22:06
|
Revision: 53719 http://firebird.svn.sourceforge.net/firebird/?rev=53719&view=rev Author: firebirds Date: 2011-12-21 03:21:59 +0000 (Wed, 21 Dec 2011) 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 2011-12-21 00:51:28 UTC (rev 53718) +++ firebird/trunk/ChangeLog 2011-12-21 03:21:59 UTC (rev 53719) @@ -1,3 +1,23 @@ + 2011-12-21 00:51 asfernandes + M src/dsql/dsql.cpp +Misc. + + 2011-12-20 14:30 asfernandes + M doc/sql.extensions/README.builtin_functions.txt + M src/common/os/guid.h + M src/common/os/posix/guid.cpp + M src/common/os/win32/guid.cpp + M src/common/sha.cpp + M src/dsql/parse.y + M src/jrd/RandomGenerator.cpp + M src/jrd/SysFunction.cpp + M src/jrd/nbak.cpp + M src/jrd/trace/TraceService.cpp + M src/utilities/gstat/ppg.cpp + M src/utilities/nbackup/nbackup.cpp + M src/yvalve/keywords.cpp +Fixed CORE-3238 - Makes GEN_UUID return a compliant RFC-4122 binary UUID and introduce CHAR_TO_UUID2 and UUID_TO_CHAR2 to convert UUIDs from/to string also complying with the RFC. + 2011-12-19 10:01 hvlad M src/dsql/dsql.cpp Fixed AV in trace when statement free event is traced and it is first traced event for a given statement (i.e. prepare\execution was not traced before). Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-21 00:51:28 UTC (rev 53718) +++ firebird/trunk/src/jrd/build_no.h 2011-12-21 03:21:59 UTC (rev 53719) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29646 + FORMAL BUILD NUMBER:29648 */ -#define PRODUCT_VER_STRING "3.0.0.29646" -#define FILE_VER_STRING "WI-T3.0.0.29646" -#define LICENSE_VER_STRING "WI-T3.0.0.29646" -#define FILE_VER_NUMBER 3, 0, 0, 29646 +#define PRODUCT_VER_STRING "3.0.0.29648" +#define FILE_VER_STRING "WI-T3.0.0.29648" +#define LICENSE_VER_STRING "WI-T3.0.0.29648" +#define FILE_VER_NUMBER 3, 0, 0, 29648 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29646" +#define FB_BUILD_NO "29648" #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 2011-12-21 00:51:28 UTC (rev 53718) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-21 03:21:59 UTC (rev 53719) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29646 +BuildNum=29648 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fir...@us...> - 2011-12-23 03:21:44
|
Revision: 53738 http://firebird.svn.sourceforge.net/firebird/?rev=53738&view=rev Author: firebirds Date: 2011-12-23 03:21:38 +0000 (Fri, 23 Dec 2011) 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 2011-12-22 15:32:06 UTC (rev 53737) +++ firebird/trunk/ChangeLog 2011-12-23 03:21:38 UTC (rev 53738) @@ -1,3 +1,28 @@ + 2011-12-22 15:32 dimitr + M src/include/consts_pub.h + M src/jrd/jrd.cpp + M src/jrd/jrd_proto.h + M src/jrd/svc.cpp + M src/remote/server/os/win32/property.cpp + M src/remote/server/os/win32/window.cpp + M src/remote/server/serve_proto.h + M src/remote/server/server.cpp +Re-implemented the disabled code in the remote server. Cleaned up the legacy logic that doesn't look actual these days. +Some code refactoring. + + 2011-12-22 14:18 asfernandes + M src/dsql/WinNodes.cpp +Misc. + + 2011-12-22 08:07 dimitr + M src/dsql/BoolNodes.cpp + M src/dsql/ExprNodes.h + M src/dsql/StmtNodes.cpp + M src/dsql/parse.y + M src/gpre/cme.cpp + M src/jrd/constants.h +Let's avoid duplication of shared constants. + 2011-12-21 00:51 asfernandes M src/dsql/dsql.cpp Misc. Modified: firebird/trunk/src/jrd/build_no.h =================================================================== --- firebird/trunk/src/jrd/build_no.h 2011-12-22 15:32:06 UTC (rev 53737) +++ firebird/trunk/src/jrd/build_no.h 2011-12-23 03:21:38 UTC (rev 53738) @@ -3,16 +3,16 @@ *** DO NOT EDIT *** TO CHANGE ANY INFORMATION IN HERE PLEASE EDIT src/misc/writeBuildNum.sh - FORMAL BUILD NUMBER:29648 + FORMAL BUILD NUMBER:29651 */ -#define PRODUCT_VER_STRING "3.0.0.29648" -#define FILE_VER_STRING "WI-T3.0.0.29648" -#define LICENSE_VER_STRING "WI-T3.0.0.29648" -#define FILE_VER_NUMBER 3, 0, 0, 29648 +#define PRODUCT_VER_STRING "3.0.0.29651" +#define FILE_VER_STRING "WI-T3.0.0.29651" +#define LICENSE_VER_STRING "WI-T3.0.0.29651" +#define FILE_VER_NUMBER 3, 0, 0, 29651 #define FB_MAJOR_VER "3" #define FB_MINOR_VER "0" #define FB_REV_NO "0" -#define FB_BUILD_NO "29648" +#define FB_BUILD_NO "29651" #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 2011-12-22 15:32:06 UTC (rev 53737) +++ firebird/trunk/src/misc/writeBuildNum.sh 2011-12-23 03:21:38 UTC (rev 53738) @@ -9,7 +9,7 @@ MajorVer=3 MinorVer=0 RevNo=0 -BuildNum=29648 +BuildNum=29651 NowAt=`pwd` cd `dirname $0` This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2011-12-23 12:44:08
|
Revision: 53739 http://firebird.svn.sourceforge.net/firebird/?rev=53739&view=rev Author: alexpeshkoff Date: 2011-12-23 12:43:58 +0000 (Fri, 23 Dec 2011) Log Message: ----------- Fixed CORE-1898: Increase the password length from 8 characters, CORE-3372: Simplify process of non-default security database creation Modified Paths: -------------- firebird/trunk/builds/install/arch-specific/linux/misc/linuxLibrary.sh.in firebird/trunk/builds/install/arch-specific/linux/misc/postinstall.sh.in firebird/trunk/builds/install/misc/posixLibrary.sh.in firebird/trunk/builds/posix/Makefile.in firebird/trunk/builds/posix/make.defaults firebird/trunk/builds/posix/make.shared.variables firebird/trunk/configure.in firebird/trunk/lang_helpers/gds_codes.ftn firebird/trunk/lang_helpers/gds_codes.pas firebird/trunk/src/auth/AuthDbg.cpp firebird/trunk/src/auth/AuthDbg.h firebird/trunk/src/auth/SecurityDatabase/LegacyClient.cpp firebird/trunk/src/auth/SecurityDatabase/LegacyClient.h firebird/trunk/src/auth/SecurityDatabase/LegacyHash.h firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.epp firebird/trunk/src/auth/SecurityDatabase/LegacyManagement.h firebird/trunk/src/auth/SecurityDatabase/LegacyServer.cpp firebird/trunk/src/auth/SecurityDatabase/LegacyServer.h firebird/trunk/src/auth/trusted/AuthSspi.cpp firebird/trunk/src/auth/trusted/AuthSspi.h firebird/trunk/src/common/Auth.cpp firebird/trunk/src/common/Auth.h firebird/trunk/src/common/classes/ClumpletReader.cpp firebird/trunk/src/common/classes/ClumpletReader.h firebird/trunk/src/common/classes/ClumpletWriter.cpp firebird/trunk/src/common/classes/ClumpletWriter.h firebird/trunk/src/common/classes/GetPlugins.h firebird/trunk/src/common/classes/array.h firebird/trunk/src/common/common.h firebird/trunk/src/common/config/config.cpp firebird/trunk/src/common/security.h firebird/trunk/src/common/sha.cpp firebird/trunk/src/common/sha.h firebird/trunk/src/common/thd.cpp firebird/trunk/src/common/utils.cpp firebird/trunk/src/common/utils_proto.h firebird/trunk/src/include/consts_pub.h firebird/trunk/src/include/firebird/Plugin.h firebird/trunk/src/include/firebird/Provider.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/SysFunction.cpp firebird/trunk/src/jrd/UserManagement.h firebird/trunk/src/jrd/jrd.cpp firebird/trunk/src/jrd/svc.cpp firebird/trunk/src/jrd/tra.cpp firebird/trunk/src/jrd/trace/TraceCmdLine.cpp firebird/trunk/src/jrd/trace/TraceManager.h firebird/trunk/src/msgs/facilities2.sql firebird/trunk/src/msgs/messages2.sql firebird/trunk/src/msgs/system_errors2.sql firebird/trunk/src/remote/client/interface.cpp firebird/trunk/src/remote/inet.cpp firebird/trunk/src/remote/inet_proto.h firebird/trunk/src/remote/os/win32/wnet.cpp firebird/trunk/src/remote/protocol.cpp firebird/trunk/src/remote/protocol.h firebird/trunk/src/remote/remot_proto.h firebird/trunk/src/remote/remote.cpp firebird/trunk/src/remote/remote.h firebird/trunk/src/remote/server/os/posix/inet_server.cpp firebird/trunk/src/remote/server/server.cpp firebird/trunk/src/utilities/gsec/gsec.cpp firebird/trunk/src/utilities/gsec/gsec_proto.h firebird/trunk/src/utilities/gstat/dba.epp firebird/trunk/src/yvalve/DistributedTransaction.cpp firebird/trunk/src/yvalve/PluginManager.cpp firebird/trunk/src/yvalve/PluginManager.h firebird/trunk/src/yvalve/why.cpp Added Paths: ----------- firebird/trunk/src/auth/SecureRemotePassword/ firebird/trunk/src/auth/SecureRemotePassword/BigInteger.cpp firebird/trunk/src/auth/SecureRemotePassword/BigInteger.h firebird/trunk/src/auth/SecureRemotePassword/Message.h firebird/trunk/src/auth/SecureRemotePassword/client/ firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.h firebird/trunk/src/auth/SecureRemotePassword/manage/ firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp firebird/trunk/src/auth/SecureRemotePassword/misc/ firebird/trunk/src/auth/SecureRemotePassword/misc/prime.cpp firebird/trunk/src/auth/SecureRemotePassword/misc/test.sh firebird/trunk/src/auth/SecureRemotePassword/misc/test_srp.cpp firebird/trunk/src/auth/SecureRemotePassword/server/ firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.cpp firebird/trunk/src/auth/SecureRemotePassword/server/SrpServer.h firebird/trunk/src/auth/SecureRemotePassword/srp.cpp firebird/trunk/src/auth/SecureRemotePassword/srp.h firebird/trunk/src/include/firebird/Auth.h firebird/trunk/src/plugins/crypt/ firebird/trunk/src/plugins/crypt/arc4/ Removed Paths: ------------- firebird/trunk/src/auth/AuthInterface.h Modified: firebird/trunk/builds/install/arch-specific/linux/misc/linuxLibrary.sh.in =================================================================== --- firebird/trunk/builds/install/arch-specific/linux/misc/linuxLibrary.sh.in 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/builds/install/arch-specific/linux/misc/linuxLibrary.sh.in 2011-12-23 12:43:58 UTC (rev 53739) @@ -178,35 +178,40 @@ } #------------------------------------------------------------------------ -# Generate new sysdba password - this routine is used only in the -# rpm file not in the install script. +# Create new password string - this routine is used only in +# silent mode of the install script. -generateNewDBAPassword() { +createNewPassword() { # openssl generates random data. openssl </dev/null >/dev/null 2&>/dev/null if [ $? -eq 0 ] then - # We generate 20 random chars, strip any '/''s and get the first 8 - NewPasswd=`openssl rand -base64 20 | tr -d '/' | cut -c1-8` + # We generate 40 random chars, strip any '/''s and get the first 20 + NewPasswd=`openssl rand -base64 40 | tr -d '/' | cut -c1-20` fi - # mkpasswd is a bit of a hassle, but check to see if it's there - if [ -z "$NewPasswd" ] - then - if [ -f /usr/bin/mkpasswd ] - then - NewPasswd=`/usr/bin/mkpasswd -l 8` - fi - fi + # If openssl is missing... + if [ -z "$NewPasswd" ] + then + NewPasswd=`dd if=/dev/urandom bs=10 count=1 2>/dev/null | od -x | head -n 1 | tr -d ' ' | cut -c8-27` + fi - # On some systems the mkpasswd program doesn't appear and on others - # there is another mkpasswd which does a different operation. So if + # On some systems even this routines may be missing. So if # the specific one isn't available then keep the original password. if [ -z "$NewPasswd" ] then NewPasswd="masterkey" fi + echo "$NewPasswd" +} + +#------------------------------------------------------------------------ +# Generate new sysdba password - this routine is used only in +# silent mode of the install script. + +generateNewDBAPassword() { + NewPasswd=`createNewPassword` writeNewPassword $NewPasswd } Modified: firebird/trunk/builds/install/arch-specific/linux/misc/postinstall.sh.in =================================================================== --- firebird/trunk/builds/install/arch-specific/linux/misc/postinstall.sh.in 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/builds/install/arch-specific/linux/misc/postinstall.sh.in 2011-12-23 12:43:58 UTC (rev 53739) @@ -40,16 +40,6 @@ addFirebirdUser fi -# Create the fbmgr shell script. -if [ -x @FB_SBINDIR@/fbmgr.bin ]; then - cat > @FB_SBINDIR@/fbmgr <<EOF -#!/bin/sh -FIREBIRD=@FB_CONFDIR@ -export FIREBIRD -exec @FB_SBINDIR@/fbmgr.bin \$@ -EOF -fi - # Update ownership and SUID bits for files. fixFilePermissions @@ -65,11 +55,11 @@ # Update the /etc/inetd.conf or xinetd entry updateInetdServiceEntry +# Change sysdba password (use embedded access) +setDBAPassword + # Get inetd to reread new init files. resetInetdServer -# start the db server so we can change the password +# start the RDBMS server startService @FIREBIRD_ARCH_TYPE@ - -# Change sysdba password -changeDBAPassword Modified: firebird/trunk/builds/install/misc/posixLibrary.sh.in =================================================================== --- firebird/trunk/builds/install/misc/posixLibrary.sh.in 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/builds/install/misc/posixLibrary.sh.in 2011-12-23 12:43:58 UTC (rev 53739) @@ -297,6 +297,17 @@ #------------------------------------------------------------------------ +# Ask user to enter new DBA password string +# !! This routine is interactive !! + +getNewDBAPasswordFromUser() +{ + AskQuestion "Please enter new password for SYSDBA user: " + echo $Answer +} + + +#------------------------------------------------------------------------ # Modify DBA password to value, asked from user. # $1 may be set to original DBA password # !! This routine is interactive !! @@ -313,8 +324,7 @@ NewPasswd="" while [ -z "$NewPasswd" ] do - AskQuestion "Please enter new password for SYSDBA user: " - NewPasswd=$Answer + NewPasswd=`getNewDBAPasswordFromUser` if [ ! -z "$NewPasswd" ] then if ! runSilent "@FB_BINDIR@/gsec -user sysdba -password $OrigPasswd -modify sysdba -pw $NewPasswd" @@ -438,6 +448,26 @@ #------------------------------------------------------------------------ +# Set sysdba password. + +setDBAPassword() { + if [ -z "$InteractiveInstall" ] + then + passwd=`createNewPassword` + else + passwd=`getNewDBAPasswordFromUser` + fi + + if [ ! -z "$passwd" ] + then + passwd=masterkey + fi + + runSilent "@FB_BINDIR@/gsec -add sysdba -pw $passwd" +} + + +#------------------------------------------------------------------------ # buildUninstallFile # This will work only for the .tar.gz install and it builds an # uninstall shell script. The RPM system, if present, takes care of it's own. Modified: firebird/trunk/builds/posix/Makefile.in =================================================================== --- firebird/trunk/builds/posix/Makefile.in 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/builds/posix/Makefile.in 2011-12-23 12:43:58 UTC (rev 53739) @@ -359,10 +359,11 @@ # plugins - some of them are required to build examples, use separate entry for them # -.PHONY: udr legacy_user_management trace auth_debug +.PHONY: udr legacy_user_management trace auth_debug makePluginName= $(PLUGINS)/$(LIB_PREFIX)$(1).$(SHRLIB_EXT) UDR_PLUGIN = $(call makePluginName,udr_engine) LEGACY_USER_MANAGER = $(call makePluginName,Legacy_UserManager) +SRP_USER_MANAGER = $(call makePluginName,Srp) AUTH_DEBUGGER = $(call makePluginName,Auth_Debug) BUILD_DEBUG:= @@ -370,7 +371,7 @@ BUILD_DEBUG:=auth_debug endif -plugins: udr legacy_user_management trace $(BUILD_DEBUG) +plugins: udr legacy_user_management srp_user_management trace $(BUILD_DEBUG) udr: $(UDR_PLUGIN) $(PLUGINS)/udr_engine.conf @@ -395,7 +396,11 @@ $(AUTH_DEBUGGER): $(AUTH_DEBUGGER_Objects) $(COMMON_LIB) $(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK) +srp_user_management: $(SRP_USER_MANAGER) +$(SRP_USER_MANAGER): $(SRP_USERS_MANAGE_Objects) $(COMMON_LIB) + $(LINK_PLUGIN) $(call LIB_LINK_SONAME,$(notdir $@).0) -o $@ $^ $(LINK_PLUG_LIBS) $(FIREBIRD_LIBRARY_LINK) $(MATHLIB) + #___________________________________________________________________________ # codes - developers change them sometimes # Modified: firebird/trunk/builds/posix/make.defaults =================================================================== --- firebird/trunk/builds/posix/make.defaults 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/builds/posix/make.defaults 2011-12-23 12:43:58 UTC (rev 53739) @@ -128,6 +128,9 @@ # needed at least for solaris inline assembly routines CAS_OPTIONS=@CAS_OPTIONS@ +# multiple-precision integer library +MATHLIB=@MATHLIB@ + # Default programs and tools to be used in the build process SH= sh -c @@ -307,7 +310,7 @@ LINK_FIREBIRD = $(LIB_LINK) $(LINK_FIREBIRD_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_FIREBIRD_OPTIONS) $(UNDEF_FLAGS)\ $(call LIB_LINK_SONAME,$(LibrarySoName)) $(call LIB_LINK_RPATH,lib) -LINK_FIREBIRD_LIBS = -L$(LIB) $(LIB_GUI) $(SO_LINK_LIBS) +LINK_FIREBIRD_LIBS = -L$(LIB) $(LIB_GUI) $(SO_LINK_LIBS) $(MATHLIB) LINK_ENGINE = $(LIB_LINK) $(LINK_PLUGIN_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_FIREBIRD_OPTIONS) $(UNDEF_FLAGS)\ $(call LIB_LINK_SONAME,$(EngineSoName)) $(call LIB_LINK_RPATH,lib) Modified: firebird/trunk/builds/posix/make.shared.variables =================================================================== --- firebird/trunk/builds/posix/make.shared.variables 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/builds/posix/make.shared.variables 2011-12-23 12:43:58 UTC (rev 53739) @@ -49,10 +49,12 @@ # Remote -Remote_Common:= $(call dirObjects,remote) -Remote_Server:= $(call dirObjects,remote/server) $(call makeObjects,auth/SecurityDatabase,LegacyServer.cpp) - # legacy security database LegacyServer.cpp should become SA plugin -Remote_Client:= $(call dirObjects,remote/client) $(call makeObjects,auth/SecurityDatabase,LegacyClient.cpp) +Remote_Common:= $(call dirObjects,remote) $(call dirObjects,auth/SecureRemotePassword) +Remote_Server:= $(call dirObjects,remote/server) $(call dirObjects,auth/SecureRemotePassword/server) \ + $(call makeObjects,auth/SecurityDatabase,LegacyServer.cpp) + # legacy security database LegacyServer.cpp should become plugin soon +Remote_Client:= $(call dirObjects,remote/client) $(call dirObjects,auth/SecureRemotePassword/client) \ + $(call makeObjects,auth/SecurityDatabase,LegacyClient.cpp) Remote_Server_Objects:= $(Remote_Common) $(Remote_Server) Remote_Client_Objects:= $(Remote_Common) $(Remote_Client) @@ -165,6 +167,13 @@ AllObjects += $(LEGACY_USERS_MANAGE_Objects) +# SRP-based users management in security database +SRP_USERS_MANAGE_Objects:= $(call dirObjects,auth/SecureRemotePassword/manage) \ + $(call dirObjects,auth/SecureRemotePassword) + +AllObjects += $(SRP_USERS_MANAGE_Objects) + + # Multihop authentication debugger AUTH_DEBUGGER_Objects:= $(call makeObjects,auth,AuthDbg.cpp) Modified: firebird/trunk/configure.in =================================================================== --- firebird/trunk/configure.in 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/configure.in 2011-12-23 12:43:58 UTC (rev 53739) @@ -43,6 +43,18 @@ AC_SUBST([$3]) ]) +define([XE_SAVE_ENV], [ +pre_save_restore_cflags=$CFLAGS +pre_save_restore_cxxflags=$CXXFLAGS +pre_save_restore_libs=$LIBS +]) + +define([XE_RESTORE_ENV], [ +CFLAGS=$pre_save_restore_cflags +CXXFLAGS=$pre_save_restore_cxxflags +LIBS=$pre_save_restore_libs +]) + sinclude(acx_pthread.m4) sinclude(binreloc.m4) @@ -458,14 +470,11 @@ fi dnl Find out how to use threads on this platform -pre_acx_pthread_cflags=$CFLAGS -pre_acx_pthread_cxxflags=$CXXFLAGS -pre_acx_pthread_libs=$LIBS +XE_SAVE_ENV() ACX_PTHREAD([ AC_DEFINE(HAVE_MULTI_THREAD, 1, [Define this if multi-threading should be supported])]) -CFLAGS=$pre_acx_pthread_cflags -LIBS=$pre_acx_pthread_libs +XE_RESTORE_ENV() AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) @@ -507,7 +516,7 @@ # not need editline in default libs, but need to test for its presence READLINE=edit # builtin default -saveLIBS=$LIBS +XE_SAVE_ENV() if test "$STD_EDITLINE" = "true"; then AC_CHECK_LIB(edit, readline, [READLINE=edit EDITLINE_FLG=Y], AC_CHECK_LIB(editline, readline, [READLINE=editline EDITLINE_FLG=Y], @@ -517,7 +526,7 @@ AC_MSG_WARN([[[--with-system-editline specified, not found. Using bundled editline]]])]))) fi fi -LIBS=$saveLIBS +XE_RESTORE_ENV() AC_SUBST(READLINE) AC_SUBST(STD_EDITLINE) @@ -671,6 +680,14 @@ dnl setting ICU_OK here is done to only avoid default action AC_CHECK_LIB(icuuc, main, ICU_OK=yes, AC_MSG_ERROR(ICU support not found - please install development ICU package)) +dnl check for tommath presence +XE_SAVE_ENV() +LIBS= +AC_CHECK_HEADER(tommath.h,,AC_MSG_ERROR(Include file for tommath not found - please install development tommath package)) +AC_CHECK_LIB(tommath, mp_init, MATHLIB=-ltommath, AC_MSG_ERROR(Library tommath not found - please install development tommath package)) +XE_RESTORE_ENV() +AC_SUBST(MATHLIB) + dnl Check for libraries AC_SEARCH_LIBS(dlopen, dl) AC_CHECK_LIB(m, main) @@ -990,12 +1007,12 @@ esac dnl Detect support for ISO syntax for thread-locals -pre_tls_cxxflags=$CXXFLAGS +XE_SAVE_ENV() CXXFLAGS=$TLS_OPTIONS AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[__thread int a = 42;]],[[a = a + 1;]])], AC_DEFINE(HAVE___THREAD, 1, [Define it if compiler supports ISO syntax for thread-local storage]),) -CXXFLAGS=$pre_tls_cxxflags +XE_RESTORE_ENV() AC_SUBST(TLS_OPTIONS) AC_SUBST(ATOMIC_OPTIONS) AC_SUBST(CAS_OPTIONS) Modified: firebird/trunk/lang_helpers/gds_codes.ftn =================================================================== --- firebird/trunk/lang_helpers/gds_codes.ftn 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/lang_helpers/gds_codes.ftn 2011-12-23 12:43:58 UTC (rev 53739) @@ -1468,6 +1468,8 @@ PARAMETER (GDS__ee_blr_mismatch_length = 335545027) INTEGER*4 GDS__ss_out_of_bounds PARAMETER (GDS__ss_out_of_bounds = 335545028) + INTEGER*4 GDS__missing_data_structures + PARAMETER (GDS__missing_data_structures = 335545029) INTEGER*4 GDS__gfix_db_name PARAMETER (GDS__gfix_db_name = 335740929) INTEGER*4 GDS__gfix_invalid_sw Modified: firebird/trunk/lang_helpers/gds_codes.pas =================================================================== --- firebird/trunk/lang_helpers/gds_codes.pas 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/lang_helpers/gds_codes.pas 2011-12-23 12:43:58 UTC (rev 53739) @@ -741,6 +741,7 @@ gds_ee_blr_mismatch_null = 335545026; gds_ee_blr_mismatch_length = 335545027; gds_ss_out_of_bounds = 335545028; + gds_missing_data_structures = 335545029; gds_gfix_db_name = 335740929; gds_gfix_invalid_sw = 335740930; gds_gfix_incmp_sw = 335740932; Modified: firebird/trunk/src/auth/AuthDbg.cpp =================================================================== --- firebird/trunk/src/auth/AuthDbg.cpp 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/src/auth/AuthDbg.cpp 2011-12-23 12:43:58 UTC (rev 53739) @@ -56,10 +56,10 @@ : str(getPool()) { } -Result FB_CARG DebugServer::startAuthentication(Firebird::IStatus* status, const AuthTags* tags, - IClumplets* dpb, IWriter* writerInterface) +Result FB_CARG DebugServer::authenticate(Firebird::IStatus* status, IServerBlock* sBlock, + IWriter* writerInterface) { - try +/* try { Firebird::MasterInterfacePtr()->upgradeInterface(dpb, FB_AUTH_CLUMPLETS_VERSION, upInfo); str.erase(); @@ -86,10 +86,10 @@ catch (const Firebird::Exception& ex) { ex.stuffException(status); - return AUTH_FAILED; - } + } */ + return AUTH_FAILED; } - +/* Result FB_CARG DebugServer::contAuthentication(Firebird::IStatus* status, const unsigned char* data, unsigned int size, IWriter* writerInterface) { @@ -108,16 +108,8 @@ return AUTH_FAILED; } } + */ -void FB_CARG DebugServer::getData(const unsigned char** data, unsigned short* dataSize) -{ - *data = reinterpret_cast<const unsigned char*>(str.c_str()); - *dataSize = str.length(); -#ifdef AUTH_VERBOSE - fprintf(stderr, "DebugServer::getData: %.*s\n", *dataSize, *data); -#endif -} - int FB_CARG DebugServer::release() { if (--refCounter == 0) @@ -133,8 +125,9 @@ : str(getPool()) { } -Result FB_CARG DebugClient::startAuthentication(Firebird::IStatus* status, const AuthTags* tags, IClumplets* dpb) +Result FB_CARG DebugClient::authenticate(Firebird::IStatus* status, IClientBlock* cBlock) { +/* try { str = "HAND"; @@ -155,10 +148,11 @@ catch (const Firebird::Exception& ex) { ex.stuffException(status); - return AUTH_FAILED; } + */ + return AUTH_FAILED; } - +/* Result FB_CARG DebugClient::contAuthentication(Firebird::IStatus* status, const unsigned char* data, unsigned int size) { try @@ -180,16 +174,8 @@ return AUTH_FAILED; } } +*/ -void FB_CARG DebugClient::getData(const unsigned char** data, unsigned short* dataSize) -{ - *data = reinterpret_cast<const unsigned char*>(str.c_str()); - *dataSize = str.length(); -#ifdef AUTH_VERBOSE - fprintf(stderr, "DebugClient::getData: %.*s\n", *dataSize, *data); -#endif -} - int FB_CARG DebugClient::release() { if (--refCounter == 0) @@ -201,6 +187,22 @@ return 1; } +Result DebugServer::getSessionKey(Firebird::IStatus*, + const unsigned char** key, unsigned int* keyLen) +{ + *key = NULL; + *keyLen = 0; + return AUTH_CONTINUE; +} + +Result DebugClient::getSessionKey(Firebird::IStatus*, + const unsigned char** key, unsigned int* keyLen) +{ + *key = NULL; + *keyLen = 0; + return AUTH_CONTINUE; +} + } // namespace Auth #endif // AUTH_DEBUG Modified: firebird/trunk/src/auth/AuthDbg.h =================================================================== --- firebird/trunk/src/auth/AuthDbg.h 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/src/auth/AuthDbg.h 2011-12-23 12:43:58 UTC (rev 53739) @@ -34,7 +34,7 @@ #ifdef AUTH_DEBUG -#include "../auth/AuthInterface.h" +#include "firebird/Auth.h" #include "../common/classes/ImplementHelper.h" #include "../common/classes/ClumpletWriter.h" #include "../common/classes/init.h" @@ -51,11 +51,10 @@ public: DebugServer(Firebird::IPluginConfig*); - Result startAuthentication(Firebird::IStatus* status, const AuthTags* tags, IClumplets* dpb, + Result authenticate(Firebird::IStatus* status, IServerBlock* sBlock, IWriter* writerInterface); - Result contAuthentication(Firebird::IStatus* status, const unsigned char* data, - unsigned int size, IWriter* writerInterface); - void getData(const unsigned char** data, unsigned short* dataSize); + Result getSessionKey(Firebird::IStatus* status, + const unsigned char** key, unsigned int* keyLen); int release(); private: @@ -67,9 +66,9 @@ public: DebugClient(Firebird::IPluginConfig*); - Result startAuthentication(Firebird::IStatus* status, const AuthTags* tags, IClumplets* dpb); - Result contAuthentication(Firebird::IStatus* status, const unsigned char* data, unsigned int size); - void getData(const unsigned char** data, unsigned short* dataSize); + Result authenticate(Firebird::IStatus* status, IClientBlock* sBlock); + Result getSessionKey(Firebird::IStatus* status, + const unsigned char** key, unsigned int* keyLen); int release(); private: Deleted: firebird/trunk/src/auth/AuthInterface.h =================================================================== --- firebird/trunk/src/auth/AuthInterface.h 2011-12-23 03:21:38 UTC (rev 53738) +++ firebird/trunk/src/auth/AuthInterface.h 2011-12-23 12:43:58 UTC (rev 53739) @@ -1,166 +0,0 @@ -/* - * PROGRAM: Firebird authentication - * MODULE: AuthInterface.h - * DESCRIPTION: Interfaces, used by authentication plugins - * - * 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_AUTH_INTERFACE -#define FB_AUTH_INTERFACE - -#include "firebird/Plugin.h" - -namespace Firebird { -class IStatus; -} - -namespace Auth { - -enum Result {AUTH_SUCCESS, AUTH_CONTINUE, AUTH_FAILED, AUTH_MORE_DATA}; - -class IWriter : public Firebird::IVersioned -{ -public: - virtual void FB_CARG reset() = 0; - virtual void FB_CARG add(const char* name) = 0; - virtual void FB_CARG setAttribute(unsigned char tag, const char* value) = 0; -}; -#define FB_AUTH_WRITER_VERSION (FB_VERSIONED_VERSION + 3) - -class IClumplets : public Firebird::IVersioned -{ -public: - virtual int FB_CARG find(UCHAR tag) = 0; - virtual void FB_CARG add(UCHAR tag, const void* bytes, unsigned int count) = 0; - virtual void FB_CARG drop() = 0; - virtual const unsigned char* FB_CARG get(unsigned int* cntPtr) = 0; -}; -#define FB_AUTH_CLUMPLETS_VERSION (FB_VERSIONED_VERSION + 4) - -// This struct defines auth-related tags (including legacy ones) in parameter blocks -struct AuthTags -{ - UCHAR authBlock, trustedAuth, trustedRole; - UCHAR service; // non-zero if we work with service connection -}; - -class IServer : public Firebird::IPluginBase -{ -public: - virtual Result FB_CARG startAuthentication(Firebird::IStatus* status, const AuthTags* tags, IClumplets* dpb, - IWriter* writerInterface) = 0; - virtual Result FB_CARG contAuthentication(Firebird::IStatus* status, const unsigned char* data, - unsigned int size, IWriter* writerInterface) = 0; - virtual void FB_CARG getData(const unsigned char** data, unsigned short* dataSize) = 0; -}; -#define FB_AUTH_SERVER_VERSION (FB_PLUGIN_VERSION + 3) - -class IClient : public Firebird::IPluginBase -{ -public: - virtual Result FB_CARG startAuthentication(Firebird::IStatus* status, const AuthTags* tags, IClumplets* dpb) = 0; - virtual Result FB_CARG contAuthentication(Firebird::IStatus* status, const unsigned char* data, unsigned int size) = 0; - virtual void FB_CARG getData(const unsigned char** data, unsigned short* dataSize) = 0; -}; -#define FB_AUTH_CLIENT_VERSION (FB_PLUGIN_VERSION + 3) - -class IUserField : public Firebird::IVersioned -{ -public: - virtual int FB_CARG entered() = 0; - virtual int FB_CARG specified() = 0; - virtual void FB_CARG setEntered(int newValue) = 0; -}; -#define FB_AUTH_FIELD_VERSION (FB_VERSIONED_VERSION + 3) - -class ICharUserField : public IUserField -{ -public: - virtual const char* FB_CARG get() = 0; - virtual void FB_CARG set(const char* newValue) = 0; -}; -#define FB_AUTH_CHAR_FIELD_VERSION (FB_AUTH_FIELD_VERSION + 2) - -class IIntUserField : public IUserField -{ -public: - virtual int FB_CARG get() = 0; - virtual void FB_CARG set(int newValue) = 0; -}; -#define FB_AUTH_INT_FIELD_VERSION (FB_AUTH_FIELD_VERSION + 2) - -class IUser : public Firebird::IVersioned -{ -public: - virtual int FB_CARG operation() = 0; - - virtual ICharUserField* FB_CARG userName() = 0; - virtual ICharUserField* FB_CARG password() = 0; - - virtual ICharUserField* FB_CARG firstName() = 0; - virtual ICharUserField* FB_CARG lastName() = 0; - virtual ICharUserField* FB_CARG middleName() = 0; - virtual ICharUserField* FB_CARG groupName() = 0; - - virtual IIntUserField* FB_CARG uid() = 0; - virtual IIntUserField* FB_CARG gid() = 0; - virtual IIntUserField* FB_CARG admin() = 0; - - virtual void FB_CARG clear() = 0; -}; -#define FB_AUTH_USER_VERSION (FB_VERSIONED_VERSION + 11) - -class IListUsers : public Firebird::IVersioned -{ -public: - virtual void FB_CARG list(IUser* user) = 0; -}; -#define FB_AUTH_LIST_USERS_VERSION (FB_VERSIONED_VERSION + 1) - -class ILogonInfo : public Firebird::IVersioned -{ -public: - virtual const char* FB_CARG name() = 0; - virtual const char* FB_CARG role() = 0; - virtual int FB_CARG forceAdmin() = 0; - virtual const char* FB_CARG networkProtocol() = 0; - virtual const char* FB_CARG remoteAddress() = 0; - virtual unsigned int FB_CARG authBlock(const unsigned char** bytes) = 0; -}; -#define FB_AUTH_LOGON_INFO_VERSION (FB_VERSIONED_VERSION + 6) - -class IManagement : public Firebird::IPluginBase -{ -public: - virtual void FB_CARG start(Firebird::IStatus* status, ILogonInfo* logonInfo) = 0; - virtual int FB_CARG execute(Firebird::IStatus* status, IUser* user, IListUsers* callback) = 0; - virtual void FB_CARG commit(Firebird::IStatus* status) = 0; - virtual void FB_CARG rollback(Firebird::IStatus* status) = 0; -}; -#define FB_AUTH_MANAGE_VERSION (FB_PLUGIN_VERSION + 4) - -} // namespace Auth - - -#endif // FB_AUTH_INTERFACE Added: firebird/trunk/src/auth/SecureRemotePassword/BigInteger.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/BigInteger.cpp (rev 0) +++ firebird/trunk/src/auth/SecureRemotePassword/BigInteger.cpp 2011-12-23 12:43:58 UTC (rev 53739) @@ -0,0 +1,212 @@ +/* + * PROGRAM: Firebird interface. + * MODULE: BigInteger.cpp + * DESCRIPTION: Integer of unlimited precision. Uses libtommath. + * + * 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) 2011 Alex Peshkov <peshkoff at mail.ru> + * and all contributors signed below. + * + * All Rights Reserved. + * Contributor(s): ______________________________________. + * + * + */ + +#include "firebird.h" +#include "gen/iberror.h" + +#include <stdlib.h> + +#include "../auth/SecureRemotePassword/BigInteger.h" +#include "../common/os/guid.h" + +using namespace Firebird; + +#define CHECK_MP(a) check(a, #a) + +namespace Auth +{ + + static inline void check(int rc, const char* function) + { + switch (rc) + { + case MP_OKAY: + return; + case MP_MEM: + BadAlloc::raise(); + default: + // Want fancy "Libtommath error in @1 code @2" + (Arg::Gds(isc_random) << "Libtommath error").raise(); + } + } + + BigInteger::BigInteger() + { + CHECK_MP(mp_init(&t)); + } + + BigInteger::BigInteger(const char* text, unsigned int radix) + { + CHECK_MP(mp_init(&t)); + CHECK_MP(mp_read_radix(&t, text, radix)); + } + + BigInteger::BigInteger(unsigned int count, const unsigned char* bytes) + { + CHECK_MP(mp_init(&t)); + assign(count, bytes); + } + + BigInteger::BigInteger(const Firebird::UCharBuffer& val) + { + CHECK_MP(mp_init(&t)); + assign(val.getCount(), val.begin()); + } + + BigInteger::BigInteger(const BigInteger& val) + { + CHECK_MP(mp_init_copy(const_cast<mp_int*>(&val.t), &t)); + } + + BigInteger::~BigInteger() + { + mp_clear(&t); + } + + BigInteger& BigInteger::operator= (const BigInteger& val) + { + CHECK_MP(mp_copy(const_cast<mp_int*>(&val.t), &t)); + return *this; + } + + void BigInteger::random(int numBytes) + { + Firebird::UCharBuffer b; + Firebird::GenerateRandomBytes(b.getBuffer(numBytes), numBytes); + assign(numBytes, b.begin()); + } + + void BigInteger::assign(unsigned int count, const unsigned char* bytes) + { + CHECK_MP(mp_read_unsigned_bin(&t, bytes, count)); + } + + BigInteger BigInteger::operator+ (const BigInteger& val) const + { + BigInteger rc; + CHECK_MP(mp_add(const_cast<mp_int*>(&t), const_cast<mp_int*>(&val.t), &rc.t)); + return rc; + } + + BigInteger BigInteger::operator- (const BigInteger& val) const + { + BigInteger rc; + CHECK_MP(mp_sub(const_cast<mp_int*>(&t), const_cast<mp_int*>(&val.t), &rc.t)); + return rc; + } + + BigInteger BigInteger::operator* (const BigInteger& val) const + { + BigInteger rc; + CHECK_MP(mp_mul(const_cast<mp_int*>(&t), const_cast<mp_int*>(&val.t), &rc.t)); + return rc; + } + + BigInteger BigInteger::operator/ (const BigInteger& val) const + { + BigInteger rc; + CHECK_MP(mp_div(const_cast<mp_int*>(&t), const_cast<mp_int*>(&val.t), &rc.t, NULL)); + return rc; + } + + BigInteger BigInteger::operator% (const BigInteger& val) const + { + BigInteger rc; + CHECK_MP(mp_mod(const_cast<mp_int*>(&t), const_cast<mp_int*>(&val.t), &rc.t)); + return rc; + } + + BigInteger& BigInteger::operator+= (const BigInteger& val) + { + CHECK_MP(mp_add(&t, const_cast<mp_int*>(&val.t), &t)); + return *this; + } + + BigInteger& BigInteger::operator-= (const BigInteger& val) + { + CHECK_MP(mp_sub(&t, const_cast<mp_int*>(&val.t), &t)); + return *this; + } + + BigInteger& BigInteger::operator*= (const BigInteger& val) + { + CHECK_MP(mp_mul(&t, const_cast<mp_int*>(&val.t), &t)); + return *this; + } + + BigInteger& BigInteger::operator/= (const BigInteger& val) + { + CHECK_MP(mp_div(&t, const_cast<mp_int*>(&val.t), &t, NULL)); + return *this; + } + + BigInteger& BigInteger::operator%= (const BigInteger& val) + { + CHECK_MP(mp_mod(&t, const_cast<mp_int*>(&val.t), &t)); + return *this; + } + + bool BigInteger::operator== (const BigInteger& val) const + { + return mp_cmp(const_cast<mp_int*>(&t), const_cast<mp_int*>(&val.t)) == 0; + } + + void BigInteger::getBytes(Firebird::UCharBuffer& bytes) const + { + CHECK_MP(mp_to_unsigned_bin(const_cast<mp_int*>(&t), bytes.getBuffer(length()))); + } + + unsigned int BigInteger::length() const + { + int rc = mp_unsigned_bin_size(const_cast<mp_int*>(&t)); + if (rc < 0) + { + check(rc, "mp_unsigned_bin_size(&t)"); + } + return static_cast<unsigned int>(rc); + } + + void BigInteger::getText(string& str, unsigned int radix) const + { + int size; + CHECK_MP(mp_radix_size(const_cast<mp_int*>(&t), radix, &size)); + str.resize(size - 1, ' '); + CHECK_MP(mp_toradix(const_cast<mp_int*>(&t), const_cast<char*>(str.c_str()), radix)); + } + + BigInteger BigInteger::modPow(const BigInteger& pow, const BigInteger& mod) const + { + BigInteger rc; + CHECK_MP(mp_exptmod(const_cast<mp_int*>(&t), const_cast<mp_int*>(&pow.t), + const_cast<mp_int*>(&mod.t), &rc.t)); + return rc; + } + +} + +#undef CHECK_MP Property changes on: firebird/trunk/src/auth/SecureRemotePassword/BigInteger.cpp ___________________________________________________________________ Added: svn:mime-type + text/x-c++src Added: svn:eol-style + native Added: firebird/trunk/src/auth/SecureRemotePassword/BigInteger.h =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/BigInteger.h (rev 0) +++ firebird/trunk/src/auth/SecureRemotePassword/BigInteger.h 2011-12-23 12:43:58 UTC (rev 53739) @@ -0,0 +1,80 @@ +/* + * PROGRAM: Firebird interface. + * MODULE: BigInteger.h + * DESCRIPTION: Integer of unlimited precision. Uses libtommath. + * + * 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_COMMON_CLASSES_BIG_INTEGER +#define FB_COMMON_CLASSES_BIG_INTEGER + +#include <tommath.h> + +#include "../common/classes/fb_string.h" +#include "../common/classes/array.h" + +namespace Auth { + +class BigInteger +{ +public: + BigInteger(); + BigInteger(const char* text, unsigned int radix = 16u); + BigInteger(unsigned int count, const unsigned char* bytes); + BigInteger(const Firebird::UCharBuffer& val); + BigInteger(const BigInteger& val); +// BigInteger(int numBits, Random& r); + ~BigInteger(); + + BigInteger& operator= (const BigInteger& val); + void random(int numBytes); + void assign(unsigned int count, const unsigned char* bytes); + + BigInteger operator+ (const BigInteger& val) const; + BigInteger operator- (const BigInteger& val) const; + BigInteger operator* (const BigInteger& val) const; + BigInteger operator/ (const BigInteger& val) const; + BigInteger operator% (const BigInteger& val) const; + + BigInteger& operator+= (const BigInteger& val); + BigInteger& operator-= (const BigInteger& val); + BigInteger& operator*= (const BigInteger& val); + BigInteger& operator/= (const BigInteger& val); + BigInteger& operator%= (const BigInteger& val); + + bool operator== (const BigInteger& val) const; + + void getBytes(Firebird::UCharBuffer& bytes) const; + unsigned int length() const; + void getText(Firebird::string& str, unsigned int radix = 16u) const; + + BigInteger modPow(const BigInteger& pow, const BigInteger& mod) const; + +private: + mp_int t; +}; + +} // namespace Firebird + +#endif // FB_COMMON_CLASSES_BIG_INTEGER Property changes on: firebird/trunk/src/auth/SecureRemotePassword/BigInteger.h ___________________________________________________________________ Added: svn:mime-type + text/x-chdr Added: svn:eol-style + native Added: firebird/trunk/src/auth/SecureRemotePassword/Message.h =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/Message.h (rev 0) +++ firebird/trunk/src/auth/SecureRemotePassword/Message.h 2011-12-23 12:43:58 UTC (rev 53739) @@ -0,0 +1,157 @@ +#include "../jrd/align.h" +#include "../common/classes/alloc.h" + +// This class helps to fill FbMessage with correct values +class Message : public Firebird::FbMessage, public Firebird::GlobalStorage +{ +public: + Message() + : blrBuf(getPool()), dataBuf(getPool()) + { + blrLength = 0; + blr = NULL; + bufferLength = 0; + buffer = NULL; + + // start message BLR + blrBuf.add(blr_version5); + blrBuf.add(blr_begin); + blrBuf.add(blr_message); + blrBuf.add(0); + countOffset = blrBuf.getCount(); + blrBuf.add(0); + blrBuf.add(0); + + varCount = 0; + } + + template <typename T> + unsigned genBlr() + { + // for special types call type-specific BLR generator + // for generic types use specialization of whole call + return T::genBlr(blrBuf); + } + + template <typename T> + void add(unsigned& pos, unsigned& null) + { + if (blr) + { + (Firebird::Arg::Gds(isc_random) << "This is already constructed message").raise(); + } + + // generate code for variable + unsigned align = genBlr<T>(); + if (align) + { + bufferLength = FB_ALIGN(bufferLength, align); + } + pos = bufferLength; + bufferLength += sizeof(T); + + // generate code for null flag + blrBuf.add(blr_short); + blrBuf.add(0); + align = type_alignments[dtype_short]; + if (align) + { + bufferLength = FB_ALIGN(bufferLength, align); + } + null = bufferLength; + bufferLength += sizeof(short); + + ++varCount; + } + + void ready() + { + if (blr) + return; + + // Adjust number of variables + blrBuf[countOffset] = (varCount * 2) & 0xFF; + blrBuf[countOffset + 1] = ((varCount * 2) >> 8) & 0xFF; + + // Complete blr + blrBuf.add(blr_end); + blrBuf.add(blr_eoc); + blrLength = blrBuf.getCount(); + blr = blrBuf.begin(); + + // Allocate buffer + buffer = dataBuf.getBuffer(bufferLength); + } + + Firebird::UCharBuffer blrBuf, dataBuf; + unsigned countOffset, varCount; +}; + +template <> +unsigned Message::genBlr<SLONG>() +{ + blrBuf.add(blr_long); + blrBuf.add(0); // scale + return type_alignments[dtype_long]; +} + +// With template magic, we make the fields strongly-typed. +template <class T> +class Field +{ +public: + Field(Message& m) + : msg(m), pos(~0), nullPos(~0) + { + msg.add<T>(pos, nullPos); + } + + T& operator()() + { + msg.ready(); + return *(T*) (msg.buffer + pos); + } + + short& null() + { + msg.ready(); + return *(short*) (msg.buffer + nullPos); + } + +private: + Message& msg; + unsigned pos, nullPos; +}; + +template <short N> +class VarChar +{ +public: + short len; + char data[N]; // This guarantees N > 0 + + static unsigned genBlr(Firebird::UCharBuffer& blr) + { + blr.add(blr_varying); + blr.add(N & 0xFF); + blr.add((N >> 8) & 0xFF); + return type_alignments[dtype_varying]; + } + + const VarChar& operator=(const char* str) + { + strncpy(data, str, N); + len = strlen(str); + if (len > N) + len = N; + return *this; + } + + void set(unsigned short l, void* bytes) + { + if (l > (unsigned short) N) + l = N; + memcpy(data, bytes, l); + len = l; + } +}; Property changes on: firebird/trunk/src/auth/SecureRemotePassword/Message.h ___________________________________________________________________ Added: svn:mime-type + text/x-chdr Added: svn:eol-style + native Added: firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp (rev 0) +++ firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp 2011-12-23 12:43:58 UTC (rev 53739) @@ -0,0 +1,173 @@ +/* + * PROGRAM: Firebird authentication. + * MODULE: SrpClient.cpp + * DESCRIPTION: SPR authentication plugin. + * + * 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) 2011 Alex Peshkov <peshkoff at mail.ru> + * and all contributors signed below. + * + * All Rights Reserved. + * Contributor(s): ______________________________________. + */ + +#include "firebird.h" + +#include "../auth/SecureRemotePassword/client/SrpClient.h" +#include "../auth/SecureRemotePassword/srp.h" +#include "../common/classes/ImplementHelper.h" + +using namespace Firebird; + +namespace Auth { + +class SrpClient : public Firebird::StdPlugin<IClient, FB_AUTH_CLIENT_VERSION> +{ +public: + explicit SrpClient(Firebird::IPluginConfig*) + : client(NULL), data(getPool()), + sessionKey(getPool()) + { } + + // IClient implementation + Result FB_CARG authenticate(Firebird::IStatus*, IClientBlock* cb); + Result FB_CARG getSessionKey(Firebird::IStatus* status, + const unsigned char** key, unsigned int* keyLen); + int FB_CARG release(); + +private: + RemotePassword* client; + string data; + UCharBuffer sessionKey; +}; + +Result SrpClient::authenticate(Firebird::IStatus* status, IClientBlock* cb) +{ + try + { + if (sessionKey.hasData()) + { + // Why are we called when auth is completed? + (Firebird::Arg::Gds(isc_random) << "Auth sync failure - SRP's authenticate called more times than supported").raise(); + } + + if (!client) + { + HANDSHAKE_DEBUG(fprintf(stderr, "Cln SRP1: %s %s\n", cb->getLogin(), cb->getPassword())); + if (!(cb->getLogin() && cb->getPassword())) + { + return AUTH_CONTINUE; + } + + client = new RemotePassword; + client->genClientKey(data); + dumpIt("Clnt: clientPubKey", data); + cb->putData(data.length(), data.begin()); + return AUTH_MORE_DATA; + } + + HANDSHAKE_DEBUG(fprintf(stderr, "Cln SRP2\n")); + unsigned int length; + const unsigned char* saltAndKey = cb->getData(&length); + if (length > (RemotePassword::SRP_SALT_SIZE + RemotePassword::SRP_KEY_SIZE + 2) * 2) + { + string msg; + msg.printf("Wrong length (%d) of data from server", length); + (Arg::Gds(isc_random) << msg).raise(); + } + + string salt, key; + unsigned charSize = *saltAndKey++; + charSize += ((unsigned)*saltAndKey++) << 8; + if (charSize > RemotePassword::SRP_SALT_SIZE * 2) + { + string msg; + msg.printf("Wrong length (%d) of salt from server", charSize); + (Arg::Gds(isc_random) << msg).raise(); + } + salt.assign(saltAndKey, charSize); + dumpIt("Clnt: salt", salt); + saltAndKey += charSize; + length -= (charSize + 2); + + charSize = *saltAndKey++; + charSize += ((unsigned)*saltAndKey++) << 8; + if (charSize + 2 != length) + { + string msg; + msg.printf("Wrong length (%d) of key from server", charSize); + (Arg::Gds(isc_random) << msg).raise(); + } + + key.assign(saltAndKey, charSize); + dumpIt("Clnt: key(srvPub)", key); + + dumpIt("Clnt: login", string(cb->getLogin())); + dumpIt("Clnt: pass", string(cb->getPassword())); + client->clientSessionKey(sessionKey, cb->getLogin(), salt.c_str(), cb->getPassword(), key.c_str()); + dumpIt("Clnt: sessionKey", sessionKey); + + BigInteger cProof = client->clientProof(cb->getLogin(), salt.c_str(), sessionKey); + cProof.getText(data); + + cb->putData(data.length(), data.c_str()); + } + catch(const Exception& ex) + { + ex.stuffException(status); + return AUTH_FAILED; + } + + return AUTH_SUCCESS; +} + + +Result SrpClient::getSessionKey(Firebird::IStatus*, + const unsigned char** key, unsigned int* keyLen) +{ + if (!sessionKey.hasData()) + { + return AUTH_MORE_DATA; + } + + *key = sessionKey.begin(); + *keyLen = sessionKey.getCount(); + + return AUTH_SUCCESS; +} + +int SrpClient::release() +{ + if (--refCounter == 0) + { + delete this; + return 0; + } + return 1; +} + +namespace +{ + Firebird::SimpleFactory<SrpClient> factory; +} + +void registerSrpClient(Firebird::IPluginManager* iPlugin) +{ + iPlugin->registerPluginFactory(PluginType::AuthClient, RemotePassword::plugName, &factory); +} + +} // namespace Auth + Property changes on: firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.cpp ___________________________________________________________________ Added: svn:mime-type + text/x-c++src Added: svn:eol-style + native Added: firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.h =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.h (rev 0) +++ firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.h 2011-12-23 12:43:58 UTC (rev 53739) @@ -0,0 +1,38 @@ +/* + * PROGRAM: Firebird authentication. + * MODULE: SrpClient.h + * DESCRIPTION: SPR authentication plugin. + * + * 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) 2011 Alex Peshkov <peshkoff at mail.ru> + * and all contributors signed below. + * + * All Rights Reserved. + * Contributor(s): ______________________________________. + */ + +#ifndef AUTH_SRP_CLIENT_H +#define AUTH_SRP_CLIENT_H + +#include "firebird/Auth.h" + +namespace Auth { + +void registerSrpClient(Firebird::IPluginManager* iPlugin); + +} // namespace Auth + +#endif // AUTH_SRP_CLIENT_H Property changes on: firebird/trunk/src/auth/SecureRemotePassword/client/SrpClient.h ___________________________________________________________________ Added: svn:mime-type + text/x-chdr Added: svn:eol-style + native Added: firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp =================================================================== --- firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp (rev 0) +++ firebird/trunk/src/auth/SecureRemotePassword/manage/SrpManagement.cpp 2011-12-23 12:43:58 UTC (rev 53739) @@ -0,0 +1,633 @@ +/* + * PROGRAM: Firebird authentication + * MODULE: SrpManagement.cpp + * DESCRIPTION: Manages security database with SRP + * + * 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) 2011 Alex Peshkov <peshkoff at mail.ru> + * and all contributors signed below. + * + * All Rights Reserved. + * Contributor(s): ______________________________________. + */ + +#include "firebird.h" + +#include "../common/classes/ImplementHelper.h" +#include "../common/classes/ClumpletWriter.h" +#include "../common/StatusHolder.h" +#include "firebird/Auth.h" +#include "../auth/SecureRemotePassword/srp.h" +#include "../jrd/constants.h" +#include "../utilities/gsec/gsec.h" +#include "../auth/SecureRemotePassword/Message.h" +#include "../common/classes/auto.h" + +namespace { + +Firebird::MakeUpgradeInfo<> upInfo; +const unsigned int INIT_KEY = ((~0) - 1); +unsigned int secDbKey = INIT_KEY; + +const unsigned int SZ_LOGIN = 31; +const unsigned int SZ_NAME = 31; + +template <short N> +void setField(Field<VarChar<N> >& to, Auth::ICharUserField* from) +{ + if (from->entered()) + { + to() = from->get(); + to.null() = 0; + } + else + { + to.null() = -1; + } +} + +// Domains +typedef Field<VarChar<SZ_LOGIN> > Login; +typedef Field<VarChar<Auth::RemotePassword::SRP_VERIFIER_SIZE> > Verifier; +typedef Field<VarChar<Auth::RemotePassword::SRP_SALT_SIZE> > Salt; +typedef Field<VarChar<SZ_NAME> > Name; + +void allocField(Firebird::AutoPtr<Name>& field, Message& up, Auth::ICharUserField* value, Firebird::string& update, const char* name) +{ + if (value->entered() || value->specified()) + { + field = new Name(up); + update += ' '; + update += name; + update += "=?,"; + } +} + +void assignField(Firebird::AutoPtr<Name>& field, Auth::ICharUserField* name) +{ + if (field.hasData()) + { + if (name->entered()) + { + (*field)() = name->get(); + field->null() = 0; + } + else + { + fb_assert(name->specified()); + field->null() = -1; + } + } +} + +template <short N> +void listField(Auth::ICharUserField* to, Field<VarChar<N> >& from) +{ + to->set(from().data); + to->setEntered(from.null() == 0 ? 1 : 0); +} + +} + +namespace Auth { + +class SrpManagement : public Firebird::StdPlugin<IManagement, FB_AUTH_MANAGE_VERSION> +{ +public: + explicit SrpManagement(Firebird::IPluginConfig* par) + : config(par->getFirebirdConf()) + { + config->release(); + } + + void prepareDataStructures() + { + const char* script[] = { +"CREATE TABLE PLG$SRP (PLG$USER_NAME SEC$USER_NAME NOT NULL PRIMARY KEY, " +"PLG$VERIFIER VARCHAR(128) CHARACTER SET OCTETS NOT NULL, " +"PLG$SALT VARCHAR(32) CHARACTER SET OCTETS NOT NULL, " +"PLG$COMMENT RDB$DESCRIPTION, PLG$FIRST SEC$NAME_PART, " +"PLG$MIDDLE SEC$NAME_PART, PLG$LAST SEC$NAME_PART)" , + +"CREATE VIEW PLG$SRP_VIEW AS " +"SELECT PLG$USER_NAME, PLG$VERIFIER, PLG$SALT, PLG$COMMENT, PLG$FIRST, PLG$MIDDLE, PLG$LAST " +"FROM PLG$SRP WHERE CURRENT_USER = 'SYSDBA' OR CURRENT_ROLE = 'RDB$ADMIN' OR CURRENT_USER = PLG$SRP.PLG$USER_NAME", + +"GRANT ALL ON PLG$SRP to VIEW PLG$SRP_VIEW", + +"GRANT SELECT ON PLG$SRP_VIEW to PUBLIC", + +"GRANT UPDATE(PLG$VERIFIER, PLG$SALT, PLG$FIRST, PLG$MIDDLE, PLG$LAST) ON PLG$SRP_VIEW TO PUBLIC", + NULL }; + + Firebird::LocalStatus s; + Firebird::RefPtr<Firebird::ITransaction> ddlTran(att->startTransaction(&s, 0, NULL)); + if (!s.isSuccess()) + { + Firebird::status_exception::raise(s.get()); + } + + try + { + for (const char** sql = script; *sql; ++sql) + { + att->execute(&s, ddlTran, 0, *sql, 3, 0, NULL, NULL); + if (!s.isSuccess()) + { + Firebird::status_exception::raise(s.get()); + } + } + + ddlTran->commit(&s); + if (!s.isSuccess()) + { + Firebird::status_exception::raise(s.get()); + } + } + catch (const Firebird::Exception&) + { + if (ddlTran) + { + ddlTran->rollback(&s); + } + throw; + } + } + + // IManagement implementation + void FB_CARG start(Firebird::IStatus* status, ILogonInfo* logonInfo) + { + try + { + Firebird::MasterInterfacePtr()->upgradeInterface(logonInfo, FB_AUTH_LOGON_INFO_VERSION, upInfo); + + status->init(); + + if (att) + { + (Firebird::Arg::Gds(isc_random) << "Database is already attached in SRP").raise(); + } + + if (secDbKey == INIT_KEY) + { + secDbKey = config->getKey("SecurityDatabase"); + } + const char* secDbName = config->asString(secDbKey); + + if (!(secDbName && secDbName[0])) + { + (Firebird::Arg::Gds(isc_random) << "Error getting security database name").raise(); + } + + Firebird::ClumpletWriter dpb(Firebird::ClumpletReader::dpbList, MAX_DPB_SIZE); + dpb.insertByte(isc_dpb_gsec_attach, TRUE); + + const unsigned char* authBlock; + unsigned int authBlockSize = logonInfo->authBlock(&authBlock); + + if (authBlockSize) + dpb.insertBytes(isc_dpb_auth_block, authBlock, authBlockSize); + else + { + const char* str = logonInfo->name(); + if (str && str[0]) + dpb.insertString(isc_dpb_trusted_auth, str, strlen(str)); + + str = logonInfo->role(); + + if (str && str[0]) + dpb.insertString(isc_dpb_sql_role_name, str, strlen(str)); + else if (logonInfo->forceAdmin()) + dpb.insertString(isc_dpb_trusted_role, ADMIN_ROLE, strlen(ADMIN_ROLE)); + } + + Firebird::RefPtr<Firebird::IProvider> p(Firebird::MasterInterfacePtr()->getDispatcher()); + p->release(); + att = p->attachDatabase(status, secDbName, dpb.getBufferLength(), dpb.getBuffer()); + if (!status->isSuccess()) + { + Firebird::status_exception::raise(status->get()); + } + + tra = att->startTransaction(status, 0, NULL); + if (!status->isSuccess()) + { + Firebird::status_exception::raise(status->get()); + } + } + catch (const Firebird::Exception& ex) + { + ex.stuffException(status); + + if (att) + { + // detach from database + Firebird::LocalStatus lStatus; + att->detach(&lStatus); + att = NULL; + } + } + } + + int FB_CARG execute(Firebird::IStatus* status, IUser* user, IListUsers* callback) + { + try + { + Firebird::MasterInterfacePtr()->upgradeInterface(callback, FB_AUTH_LIST_USERS_VERSION, upInfo); + Firebird::MasterInterfacePtr()->upgradeInterface(user, FB_AUTH_USER_VERSION, upInfo); + + status->init(); + + fb_assert(att); + fb_assert(tra); + + switch(user->operation()) + { + case MAP_DROP_OPER: + case MAP_SET_OPER: + { + Firebird::string sql; + sql.printf("ALTER ROLE RDB$ADMIN %s AUTO ADMIN MAPPING", + user->operation() == MAP_SET_OPER ? "SET" : "DROP"); + att->execute(status, tra, sql.length(), sql.c_str(), 3, 0, NULL, NULL); + if (!status->isSuccess()) + { + Firebird::status_exception::raise(status->get()); + } + } + break; + + case ADD_OPER: + { + const char* insert = + "INSERT INTO plg$srp_view(PLG$USER_NAME, PLG$VERIFIER, PLG$SALT, PLG$FIRST, PLG$MIDDLE, PLG$LAST) " + "VALUES(?, ?, ?, ?, ?, ?)"; + + Message add; + Login login(add); + Verifier verifier(add); + Salt slt(add); + Name first(add), middle(add), last(add); + + setField(login, user->userName()); + setField(first, user->firstName()); + setField(middle, user->middleName()); + setField(last, user->lastName()); + +#if SRP_DEBUG > 1 + BigInteger salt("02E268803000000079A478A700000002D1A6979000000026E1601C000000054F"); +#else + BigInteger salt; + salt.random(RemotePassword::SRP_SALT_SIZE); +#endif + Firebird::UCharBuffer s; + salt.getBytes(s); + slt().set(s.getCount(), s.begin()); + slt.null() = 0; + + dumpIt("salt", s); +#if SRP_DEBUG > 0 + fprintf(stderr, ">%s< >%s<\n", user->userName()->get(), user->password()->get()); +#endif + Firebird::string s1; + salt.getText(s1); + server.computeVerifier(user->userName()->get(), s1, user->password()->get()).getBytes(s); + dumpIt("verifier", s); + verifier().set(s.getCount(), s.begin()); + verifier.null() = 0; + + for (unsigned repeat = 0; ; ++repeat) + { + att->execute(status, tra, 0, insert, 3, 0, &add, NULL); + if (status->isSuccess() || repeat > 0) + { + break; + } + + const ISC_STATUS* v = status->get(); + while (v[0] == isc_arg_gds) + { + if (v[1] == isc_dsql_relation_err) + { + prepareDataStructures(); + tra->commit(status); + if (!status->isSuccess()) + { + Firebird::status_exception::raise(status->get()); + } + tra = att->startTransaction(status, 0, NULL); + if (!status->isSuccess()) + { + Firebird::status_exception::raise(status->get()); + } + break; + } + do + { + v += 2; + } while (v[0] != isc_arg_warning && v[0] != isc_arg_gds && v[0] != isc_arg_end); + } + } + if (!status->isSuccess()) + { + Firebird::status_exception::raise(status->get()); + } + } + break; + + case MOD_OPER: + { + Message up; + + Firebird::string update = "UPDATE plg$srp_view SET "; + + Firebird::AutoPtr<Verifier> verifier; + Firebird::AutoPtr<Salt> slt; + if (user->password()->entered()) + { + verifier = new Verifier(up); + slt = new Salt(up); + update += "PLG$VERIFIER=?,PLG$SALT=?,"; + } + + Firebird::AutoPtr<Name> first, middle, last; + allocField(first, up, user->firstName(), update, "PLG$FIRST"); + allocField(middle, up, user->middleName(), update, "PLG$MIDDLE"); + allocField(last, up, user->lastName(), update, "PLG$LAST"); + + if (update[update.length() - 1] != ',') + { + return 0; + } + update.rtrim(","); + + update += " WHERE PLG$USER_NAME=?"; + Login login(up); + + if (verifier.hasData()) + { +#if SRP_DEBUG > 1 + BigInteger salt("02E268803000000079A478A700000002D1A6979000000026E1601C000000054F"); +#else + BigInteger salt; + salt.random(RemotePassword::SRP_SALT_SIZE); +#endif + Firebird::UCharBuffer s; + salt.getBytes(s); + (*slt)().set(s.getCount(), s.begin()); + slt->null() = 0; + + dumpIt("salt", s); +#if SRP_DEBUG > 0 + fprintf(stderr, ">%s< >%s<\n", user->userName()->get(), user->password()->get()); +#endif + Firebird::string s1; + salt.getText(s1); + server.computeVerifier(user->userName()->get(), s1, user->password()->get()).getBytes(s); + dumpIt("verifier", s); + (*verifier)().set(s.getCount(), s.begin()); + verifier->null() = 0; + } + + assignField(first, user->firstName()); + assignField(middle, user->middleName()); + assignField(last, user->lastName()); + setField(login, user->userName()); + + att->execute(status, tra, 0, update.c_str(), 3, 0, &up, NULL); + if (!status->isSuccess()) + { + Firebird::status_exception::raise(status->get()); + } + } + break; + + case DEL_OPER: + { + Message dl; + const char* d... [truncated message content] |