8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00
Commit Graph

3175 Commits

Author SHA1 Message Date
Adriano dos Santos Fernandes
3f188ec758 Fix #8409 - Error message "SQL -104 / Unexpected end of command" appears in a trace log when 'SET AUTOTERM ON;' is used. 2025-01-22 07:53:48 -03:00
Dmitry Yemanov
69690fd44e Fix a crash appeared after the bugfix for #8185 (SIGSEGV with WHERE CURRENT OF statement with statement cache turned on). Reproducible with QA test bugs.core_5231 (release build only). This fix is a very simple one, just to avoid the object state being read after its possible removal. The returned usage counter is not used anyway. 2025-01-15 16:57:39 +03:00
Dmitry Yemanov
b2d03a0f51 More correct plan output for subqueries generated during NOT IN transformation 2025-01-10 11:19:54 +03:00
Dmitry Yemanov
f0740d2a32
Wipe out multi-file database support (#8047)
* Wipe out multi-file database support

* Fix (fingers crossed) Windows build, some more cleanup and code simplification

* Fix gstat build on Windows and also Android/MacOS builds
2024-12-28 09:27:34 +03:00
Ilya Eremin
b1ef0e3c52 Fix mismatched-new-delete warnings 2024-12-26 19:14:04 +03:00
Dmitry Yemanov
c60acb0028
Cleanup batches inside the engine if they were not released explicitly before disconnection. This avoids a resource leak (it's mostly about TempSpace). (#8341) 2024-12-05 12:59:45 +03:00
Ilya Eremin
babd741daa
Add AUTO RELEASE TEMP BLOBID transaction option (#8323)
* Add AUTO RELEASE TEMP BLOBID transaction option

It makes the transaction release temporary ID of user BLOB just after its materialization. It's useful for massive insertions of records with user-defined BLOBs because it eliminates the memory overhead caused by creating and keeping temporary IDs until the transaction ends. This option is used during the database restore.

* Place tokens in the correct sections

* Avoid repeated attempts to start a transaction with options that are not supported by the target server

* Correct AUTO RELEASE TEMP BLOBID description

* Check bad_tpb_form error for more reliable detection of unsupported transaction options

* Do not use unsupported options for transactions of parallel workers performing RestoreRelationTask
2024-11-25 11:32:33 +03:00
Dmitry Yemanov
0d72b8097c Do not consider non-deterministic expressions as invariants in pre-filters (#7853)
* Do not consider non-deterministic expressions as invariants in pre-filters

* Follow Adriano's suggestion

* Allow deterministic uncorrelated subqueries to be considered as invariants
2024-11-16 17:42:23 +03:00
Artyom Abakumov
52657ab691
Add ALTER PACKAGE BODY and CRETE OR ALTER PACKAGE BODY parse rules (#8309) 2024-11-08 08:18:11 -03:00
Adriano dos Santos Fernandes
8b0270ff9a Code improvement. 2024-10-25 18:08:43 -03:00
5b455e3b72
Extra initialization (#8293) 2024-10-25 18:06:52 -03:00
67d8e39e44
Ability to create an inactive index (#8091)
* Ability to create an inactive index

* Extract inactive indices in dialect 1
2024-10-25 14:35:02 +03:00
aa167e2b36
Fix for #8249 - CAST() ignores collation of target data type 2024-10-04 07:12:45 -03:00
Vlad Khorsun
7a44758eed Fixed porting error 2024-09-20 18:37:57 +03:00
Vlad Khorsun
6b445c0dc5 Catch possible stack overflow when preparing and compiling user statements 2024-09-20 17:30:32 +03:00
Vlad Khorsun
c75b160dc0 Fixed #8253 : Incorrect handling of non-ASCII object names in CREATE MAPPING statement 2024-09-20 17:28:59 +03:00
Adriano dos Santos Fernandes
d40d01bc45 Fix #8213 - WHEN NOT MATCHED BY SOURCE - does not work with a direct table as source. 2024-08-19 22:02:02 -03:00
Vlad Khorsun
db69e655d7 Correction for #8203, thanks to Adriano 2024-08-08 14:41:16 +03:00
Vlad Khorsun
c03852efc9 Merge pull request #8204 from FirebirdSQL/work/gh-8203
Fixed bug #8203 : Function MAKE_DBKEY may produce random errors if used with relation name
2024-08-07 08:42:13 +03:00
Adriano dos Santos Fernandes
aaf0e33414 Correction: revert code related with WITH CHECK OPTION internal triggers. 2024-08-03 22:37:57 -03:00
Adriano dos Santos Fernandes
9926ab88b4 Reimplement system triggers in C++/GDML code. 2024-08-03 15:38:33 -03:00
Adriano dos Santos Fernandes
a7d10a4014 Fix #8185 - SIGSEGV with WHERE CURRENT OF statement with statement cache turned on. 2024-07-28 21:48:55 -03:00
Vlad Khorsun
193b01ed17 Merge pull request #8169 from FirebirdSQL/work/gh-8168
Fixed bug #8168 : MAKE_DBKEY bug after backup/restore
2024-06-27 19:51:15 +03:00
TreeHunter
174038cbf5
Refactoring of CAST FORMAT (#7881) (#8134)
* Refactoring of CAST FORMAT

Move CAST FORMAT logic to separate file.
Separation of logic into parsing stage and execution stage.
Add more FORMAT validation based on SQL standard.

* Add more unit tests for incorrect FORMAT

* Remove incorrect const specifier

* Fixes after review

Minor code changes.
Move public CVT_FORMAT functions  to CvtFormat.h.
Add new error message if same is used pattern twice in string to datetime conversion.

* Fix indents in comments

* Add new files to windows build

* Remove constexpr specifier from functions that is not real constexpr

Because std::isdigit and std::isalpha are not constexpr.

---------

Co-authored-by: Artyom Ivanov <artyom.ivanov@red-soft.ru>
2024-06-03 10:43:06 -03:00
c952682135
Fix debug build failure with assertion in CRT (#8121) 2024-05-16 19:28:09 +03:00
Dmitry Yemanov
96dbef9cb3 This should fix #8086: IN predicate with string-type elements is evaluated wrongly against a numeric field 2024-05-02 14:35:25 +03:00
Vlad Khorsun
1d96c10fe9 Fixed bug #8087 : AV when preparing a query with IN list that contains both literals and sub-query 2024-04-17 22:36:09 +03:00
Adriano dos Santos Fernandes
003b2e0a77 Postfix for #8062 - CREATE IF NOT EXISTS.
Thanks to Pavel Zotov.
2024-04-15 23:20:30 -03:00
Adriano dos Santos Fernandes
b6eab891d5
Feature #8062 - CREATE IF NOT EXISTS. (#8072) 2024-04-14 16:32:51 -03:00
Adriano dos Santos Fernandes
73551f357e Fix #8063 - (var)char variables/parameters assignments fail in Stored Procedures with subroutines. 2024-04-02 11:09:54 -03:00
Adriano dos Santos Fernandes
f1c4e00cc4
Postfix for #7989 - Improve performance of external (UDR) functions (#8046)
* Postfix for #7989 - Improve performance of external (UDR) functions.

* Extract common functions.

* Fix profiler request time for external functions.

* Change cancellation detection for external functions.

* Move new private code to anonymous namesapce and rename functions.
2024-03-31 21:59:23 -03:00
MrTeeett
56e8c6224c
Add multi-character TRIM function (#8015)
* Add multi-character TRIM function

* Follow Adriano's suggestion

Co-authored-by: Adriano dos Santos Fernandes <529415+asfernandes@users.noreply.github.com>

---------

Co-authored-by: Dmitry Yemanov <dyemanov@users.noreply.github.com>
Co-authored-by: Adriano dos Santos Fernandes <529415+asfernandes@users.noreply.github.com>
2024-03-25 19:46:05 +03:00
TreeHunter
a429459b76
Change some aspects of the string-to-date conversion with format to make it more similar to the SQL standard #2388 (#7881)
* Use current TimeStamp for data in stringToDate conversion if it's not specify

Also fix RM pattern and change (A/P)M to (A/P).M.

* Add more tests

* Add TimeStamp validation

Also move duplicated code to functions.

* Add more unit tests for "YY" and "YYY" patterns

* Use Callback for getting current date

It's better because we can mock Callback for unit tests.

* Fix exception and README description

* Add ability to print blr_cast_format

* Put a comment about new BLR in the right place

* Add information about behavior of string to datetime conversion

* Rework old patterns and add new ones

Add A.M, P.M., RR and RRRR patterns.
Rework YY, YYY, HH and HH12 patterns due to new patterns.
Add restriction from SQL standard to format.
Fix incorrect error message for mismatched pattern.
Fix bug with 0 hours in HH12.

* Add more unit tests

* Update doc for cast format

* Allow specification of log_level for BOOST_TESTS in make

* Change enum class to enum in namespace

* Switch from plain enum to constexpr values

---------

Co-authored-by: Artyom Ivanov <artyom.ivanov@red-soft.ru>
2024-03-04 14:43:14 +03:00
Adriano dos Santos Fernandes
547cb8388b
Improve performance of external (UDR) functions (#7989) 2024-02-28 18:43:16 -03:00
Adriano dos Santos Fernandes
5dcc2e1627 Correction. Thanks to Vlad. 2024-02-27 20:40:04 -03:00
Vlad Khorsun
83e3a06645 Fixed bug #8020 : AV when both function and dependent table are dropped in the same transaction 2024-02-27 20:57:12 +02:00
Dmitry Yemanov
cc426c8447 Fixed #7993: Unexpected results when using CASE WHEN with RIGHT JOIN 2024-02-05 19:41:22 +03:00
Dmitry Yemanov
8d601425b1
Solution for #7568: Equivalence of boolean condition in partial index (#7987)
* Solution for #7568: Equivalence of boolean condition in partial index

* Follow Adriano's correction

Co-authored-by: Adriano dos Santos Fernandes <529415+asfernandes@users.noreply.github.com>

* Exclude IS [NOT] and IS [NOT] DISTINCT FROM from the optimization

---------

Co-authored-by: Adriano dos Santos Fernandes <529415+asfernandes@users.noreply.github.com>
2024-02-02 13:07:28 +03:00
Dmitry Yemanov
4cd3b0e47a
Cleanup RelaxedAliasChecking configuration setting (#7982) 2024-01-29 18:05:05 +03:00
Dmitry Yemanov
fd135f41e8 Hopefully, this should fix the remaining issues with invariants vs views (see #7863) 2024-01-24 09:22:53 +03:00
11dec10f9f
Fix both parts of #7924 (#7940)
* Fix both parts of #7924

* STL-compatible empty() method used

* Get back to isEmpty()
2024-01-22 17:41:36 +03:00
Adriano dos Santos Fernandes
8224df0278 Postfix for #7566 - Allow DEFAULT keyword in argument list.
When parameter has no default, use domain's default for TYPE OF or NULL.
2024-01-20 16:29:04 -03:00
Adriano dos Santos Fernandes
52a13993dd Fix #7958 - Unrecognized C++ exception (master only regression). 2024-01-14 16:26:49 -03:00
AlexPeshkoff
8aacea411b Cleanup: moved INTL objects, defined in common, from namespace Jrd to namespace Firebird 2024-01-11 20:00:14 +03:00
Adriano dos Santos Fernandes
252a675c2a Postfix for #4203 - thanks to Pavel Zotov. 2024-01-09 20:05:36 -03:00
Adriano dos Santos Fernandes
a04784d502 Postfix for #4203 - thanks to Pavel Zotov. 2024-01-09 08:57:42 -03:00
Adriano dos Santos Fernandes
d29e9cecb8 Corrections and documentation improvements to #4203 - DROP [IF EXISTS]. 2024-01-08 08:33:39 -03:00
Adriano dos Santos Fernandes
77ee904255
Feature #4203 - DROP [IF EXISTS] (#7946) 2024-01-07 11:30:33 -03:00
Adriano dos Santos Fernandes
305c40a05b Fix #7931 - Incorrect variable usage using UPDATE OR INSERT. 2023-12-19 22:53:57 -03:00
Dmitry Yemanov
898bf01575 Fixed #7903: Unexpected Results when Using CASE-WHEN with LEFT JOIN 2023-12-03 18:50:47 +03:00