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

564 Commits

Author SHA1 Message Date
robocop
e14bd3a279 Comment. 2010-01-31 05:10:30 +00:00
asfernandes
abf4ab92d3 More comments, misc and fix for aggregate inside window ORDER BY clause 2010-01-30 23:08:04 +00:00
asfernandes
4a202ba5a5 Misc 2010-01-30 14:45:41 +00:00
asfernandes
ee511fc7ec Comments (explanations and non-used code) 2010-01-30 02:32:57 +00:00
robocop
e5a0c430aa Misc. 2010-01-29 11:07:42 +00:00
asfernandes
465ec12478 Misc 2010-01-29 01:16:34 +00:00
asfernandes
81c3826fd1 Misc 2010-01-28 17:22:37 +00:00
asfernandes
8a0c6c9ea9 Simplify DSQL removing a lot of copy-and-paste and recursion that change some parameters some times.
Some assertion errors may have been introduced. It would be easy to revert them.
2010-01-28 15:18:11 +00:00
robocop
446097fe8e Be explicit, change "qualifier" to "package" in QualifiedName (needed anyway if/when schemas are added). 2010-01-27 04:32:27 +00:00
asfernandes
16f77c21a2 Cleanup 2010-01-27 02:20:19 +00:00
robocop
1d87d749f0 Misc. 2010-01-26 08:20:27 +00:00
asfernandes
b68658534f Feature CORE-2823 - Support the ORDER BY subclause for current aggregate functions (except LIST) 2010-01-23 03:02:53 +00:00
asfernandes
cf4e283f7d Separate aggregate/union maps from window maps 2010-01-21 18:33:18 +00:00
asfernandes
2faab16698 Misc 2010-01-21 02:51:32 +00:00
dimitr
ebf7907918 Misc. 2010-01-20 07:34:31 +00:00
asfernandes
9eadb6c355 Move the code to below thanks to Dmitry review.
This allow us to save a context number.
2010-01-19 18:26:28 +00:00
asfernandes
57b443e2d1 Complement Dmitry fix 2010-01-19 17:52:39 +00:00
dimitr
90beb3cb8c Hopefully, this change resolves CORE-2812: Prohibit any improper mixture of explicit and implicit joins.
A wider testing would be much appreciated.
2010-01-19 09:31:43 +00:00
dimitr
d35f6e316b 1) Simplify the explicit plan handling between the parser and the engine. It makes no sense to pass the join type as it's ignored internally.
2) Support hash joins in the plan output and in the parser. For the latter, it's just the syntax sugar, same as loop vs merge join (see above).
2010-01-19 09:25:29 +00:00
asfernandes
7fbee2c76b Feature OVER (PARTITION BY ...) clause for window functions 2010-01-18 21:37:47 +00:00
asfernandes
c3f9ef27e8 Refactor CREATE GENERATOR/SEQUENCE 2010-01-10 17:32:40 +00:00
asfernandes
63f481da40 1) Refactor the EXCEPTION statement
2) Cleanup DSQL nod_abort
2010-01-05 17:32:42 +00:00
dimitr
67a26916d9 Simplified the code a bit more (removed the redundant processing). 2010-01-04 07:54:26 +00:00
dimitr
778ea0d9bf Small refactoring (code simplification). 2010-01-03 10:33:22 +00:00
asfernandes
95e5fd5873 Fix problem of mixing dbkey and record version on the same internal parameter 2009-12-26 02:21:56 +00:00
asfernandes
534b8c020e Misc 2009-12-25 19:29:58 +00:00
robocop
105bb19114 Shortcut. 2009-12-24 12:56:31 +00:00
robocop
cd4c00ab21 Misc. 2009-12-24 10:42:32 +00:00
asfernandes
d3ac9ac6cc More refactoring: name changes, accessors, consts, removed not good references (statement referencing scratch and metadata indirectly) 2009-12-23 00:57:08 +00:00
asfernandes
8968888820 Getters and setters for DsqlCompiledStatement and consts 2009-12-22 15:36:10 +00:00
asfernandes
dd6331f002 Some fixes; Misc. 2009-12-22 00:08:49 +00:00
dimitr
1f3694c903 Support for PSQL functions (only the DSQL part so far). Still work in progress. 2009-12-21 17:23:07 +00:00
asfernandes
985bc2db87 Separate the scratch, statement and request flags. Don't ask me why I didn't change them to bools. 2009-12-20 22:42:43 +00:00
asfernandes
488eb40fe0 Refactor DSQL, continuing the work I started in 2.5:
- Renamed CompiledStatement to DsqlCompilerScratch and removed inheritance to dsql_req.
- Introduced DsqlCompilerStatement, moving things from dsql_req - not completelly shareable yet.
- Make dsql_req reference a DsqlCompilerStatement. DsqlCompilerScratch may be discarded in the future.
- Replaced AlterCharSetNode usage by PreparedStatement for the default collation in database creation.
- Changed METD API.
2009-12-20 21:01:10 +00:00
asfernandes
20ed875d57 Replaced linked list of dsql parameters by array 2009-12-19 18:50:38 +00:00
robocop
b2798cbd87 Misc. 2009-12-16 08:07:36 +00:00
asfernandes
b137cdfd80 Misc 2009-12-14 23:55:56 +00:00
robocop
dae574f7f1 Misc, style and unused vars. 2009-12-13 10:41:53 +00:00
asfernandes
fe95abee91 Make WITH LOCK work with window functions 2009-12-11 14:47:41 +00:00
hvlad
1dc03fa3b9 Fixed bug CORE-2783 : AV using recursive query as subquery in SELECT list and ORDER'ing by them 2009-12-09 23:06:29 +00:00
asfernandes
9ec1c36a55 Cleanup 2009-11-28 19:39:23 +00:00
asfernandes
7c11f5b6b0 Misc 2009-11-22 00:09:30 +00:00
asfernandes
200a63b1b4 Reduce usage of legacy (and unsafe) nodes related to PSQL parameters and variables.
Use btyacc feature "inherited attributes" (kind of parameters for non-terminals).
2009-11-21 20:42:27 +00:00
robocop
4d1783f379 Style. 2009-11-19 09:37:10 +00:00
robocop
d0fe2b0d6b Style. 2009-11-15 12:21:33 +00:00
asfernandes
957aa3e32b Fix problem reported by Bill - usage of variable in non-PSQL block crashs the server. Test case:
--
-- Defect S0320338
-- EXTRA COLON CAUSES ISQL TO CRASH
--
create database 'test.fdb';

create table USER_DATA (
    BASE_DATA_ID numeric(18,0) not null,
    OWNER_IDENTITY_ID numeric(18,0),
    primary key (BASE_DATA_ID)
);

create table IDENTITY (
    IDENTITY_ID numeric(18,0) not null,
    OBJECT_VERSION numeric(18,0) not null,
    IS_ACTIVE char(1),
    IS_GROUP char(1),
    OMRID varchar(80) not null unique,
    NAME varchar(80) not null,
    IDENTITY_PROXY_ID numeric(18,0) unique,
    primary key (IDENTITY_ID)
);

SELECT ident.IDENTITY_PROXY_ID
FROM USER_DATA ud
JOIN IDENTITY ident on ud.OWNER_IDENTITY_ID = ident.IDENTITY_ID
WHERE ud.BASE_DATA_ID = :OBJECT_ID;
-- this query should fail, but not crash

drop database;
2009-11-03 23:16:37 +00:00
asfernandes
914d6f383d Fixed CORE-2723 - When execute command UPDATE OR INSERT the server crashes 2009-11-01 18:51:48 +00:00
dimitr
5c80805bed Cleanup. 2009-10-31 11:45:44 +00:00
dimitr
7bdb39e616 Wipe out the SCROLLABLE_CURSORS code + minor cleanup.
Also, surfaced scrollability for PSQL cursors (without internal support yet).
2009-10-31 06:17:49 +00:00
asfernandes
4a3d198ade Misc 2009-10-31 01:46:06 +00:00
asfernandes
fb1e53fb67 Improvement CORE-2697 - Support the "? in SELECT some_col FROM some_table" subqueries 2009-10-30 14:47:25 +00:00
robocop
b304b96224 Misc. 2009-10-30 10:43:42 +00:00
asfernandes
51901b212a Fix some problems found by Claudio 2009-10-24 19:07:35 +00:00
asfernandes
b31aaf0129 Some statements nodes refactor - creation of IfNode, ExitNode, SuspendNode, PostEventNode and SavePointNode. 2009-10-24 17:45:33 +00:00
asfernandes
dc5edd5aed Misc 2009-10-23 00:42:40 +00:00
asfernandes
ed0e0daeb3 - External Engines implementation.
- Plugins API.

- Feature CORE-2700 - UDR (User Defined Routines) Engine - C++ API supporting functions, triggers and stored procedures.
- Feature CORE-2470 - Support for alternate format of strings literals.
- Feature CORE-2310 - DDL triggers.
- Feature CORE-2312 - PSQL Packages.
- Feature CORE-1209 - CONTINUE statement.
- Feature CORE-1180 - DDL syntax to change (not) nullable state of columns.
- Feature CORE-2090 - Support OVER () clause with current aggregate functions.

- Fixed CORE-2699 - Common table expression context could be used with parameters.

- Introduce ODS 12.0.

- Work in progress in type-safe parser.
- Refactor some DDL commands (procedures and triggers) from DYN to DdlNodes.
- Refactor virtual tables to use a class hierarchy instead of namespaces. This is basic thing, not based on the changes done in Vulcan. Window functions is based on this work.
- Refactor COMMENT ON and DROP FUNCTION from DYN to DdlNodes. COMMENT ON do not use GDML anymore, it uses DSQL with PreparedStatement class.
- Refactor EXECUTE BLOCK to StmtNodes.
- Refactor the IUDF to SysFunctions. That eliminates RDB$GET_CONTEXT and RDB$SET_CONTEXT from RDB$FUNCTIONS.
2009-10-21 00:42:38 +00:00
asfernandes
d6266054b7 Fixed CORE-2660 - COUNT(*) incorrectly returns 0 when a condition of an outer join doesn't match 2009-10-04 21:47:52 +00:00
asfernandes
102956a54d Fixed CORE-1787 - Consistency check when subquery is ordered by aggregate function from other context 2009-09-07 03:58:48 +00:00
asfernandes
88495f2e92 Fixed CORE-2584 - Wrong results for CASE used together with GROUP BY 2009-08-06 02:32:56 +00:00
asfernandes
a8c1cdb655 Fixed CORE-2579 - Parameters and variables cannot be used as expressions in EXECUTE PROCEDURE parameters without a colon prefix.
Improvement CORE-2580 - Allow usage of subselects as PSQL expressions
2009-08-01 18:20:17 +00:00
asfernandes
9bd287b702 Fixed CORE-2538 - PSQL doesnt allow to use singleton query result as input parameter of stored procedure when procedure accessed using 'execute procedure' 2009-07-05 00:48:36 +00:00
robocop
f10e1b72eb Style. 2009-06-27 06:23:36 +00:00
robocop
2e3ce0d23d Misc. 2009-06-07 09:49:58 +00:00
asfernandes
83820dc0d9 Fixed CORE-2499 - Implementation limit of DISTINCT items are not enforced, causing generation of incorrect BLR 2009-06-06 02:21:23 +00:00
hvlad
9a749a272f Implement improvement CORE-2452 : Add Role Name in input parameters for EXECUTE STATEMENT 2009-05-14 10:21:47 +00:00
alexpeshkoff
f5c31ce09a Fixed CORE-2441: Server crashes on UPDATE OR INSERT statement 2009-04-27 16:29:01 +00:00
robocop
6292032d72 Comments and style. 2009-04-19 10:06:07 +00:00
asfernandes
ed6912df8d Misc 2009-04-13 01:46:26 +00:00
hvlad
8f8472f58e Fixed bug CORE-2416 : AV preparing a query with aggregate over derived table 2009-04-12 07:53:44 +00:00
hvlad
fb3f935710 Fixed bug CORE-2419 : Assert in DEBUG build preparing query witn UNION in derived table 2009-04-12 07:32:45 +00:00
asfernandes
4a4fd4c9e4 Fixed CORE-2417 - Index cannot be used with <field> LIKE <constant> in HAVING clause. 2009-04-10 20:17:35 +00:00
asfernandes
00a64ad59b Fixed a problem introduced with my last commit. Assertion with query:
select * from (select * from t1 group by n) group by n;
2009-03-13 15:46:09 +00:00
asfernandes
bf64550086 Misc (spaces vs tab) 2009-03-13 15:30:33 +00:00
asfernandes
f32516ee4b Fix another (related to CORE-1246 and CORE-2339) issue with derived expressions, reported by Dmitry:
select
 *
from
(select
  coalesce(sum(r1.RDB$RELATION_ID), 0) as RDB$RELATION_ID
from
  (select *
  from
  rdb$database ) r1 ) r2

wrongly returns NULL
2009-03-13 15:26:50 +00:00
robocop
fab6a3a6cf Get rid of superflous parentheses. 2009-02-28 11:57:40 +00:00
asfernandes
1105286dee Misc 2009-02-07 15:20:34 +00:00
asfernandes
891845836d CORE-2298 - Add support for "some_col = ? or ? IS NULL" conditions 2009-02-05 14:29:28 +00:00
asfernandes
ced3b0010e Rollback CORE-2298 2009-01-29 20:36:29 +00:00
asfernandes
3592de2b06 Adjustments related to CORE-2298 2009-01-28 22:04:55 +00:00
asfernandes
9784181a33 Improvement CORE-2298 - Add support for "some_col = ? or ? IS NULL" conditions 2009-01-28 21:37:45 +00:00
dimitr
cf82309149 Slightly reworked my recent changes for IN (list).
Now it resolves the parameter datatypes the same way as before.
2009-01-21 18:06:20 +00:00
robocop
b8f95abd0b Cleanup. 2009-01-10 11:11:56 +00:00
asfernandes
647bc06ce1 Misc 2009-01-09 01:50:54 +00:00
robocop
b627ad2a39 Style. 2009-01-07 09:30:57 +00:00
asfernandes
91a4550d23 Misc 2009-01-06 17:46:08 +00:00
robocop
8dca837420 Style. 2009-01-06 05:53:34 +00:00
asfernandes
53f18ba5fc Fixed CORE-2265 - Grouping by function doesn't work properly
(This is related to CORE-1246 changes)
2009-01-04 18:41:36 +00:00
robocop
6406e45337 Shut up compiler warnings (unreferenced vars, uninitialized vars, compile-time conditional code, etc.) 2009-01-02 06:36:12 +00:00
robocop
9c9e4e9b0b There's no need to check whether a pointer is null before applying delete or delete[]. 2008-12-20 08:16:55 +00:00
asfernandes
8fbf0e8e8c Remove trailing spaces (.cpp files) 2008-12-05 01:20:14 +00:00
asfernandes
c51af68ff9 Misc 2008-11-09 22:42:11 +00:00
asfernandes
26e6444764 Misc 2008-11-08 18:05:21 +00:00
asfernandes
dcfdeca45c Fixed CORE-2176 - Unexpected (wrong) results with COALESCE and GROUP BY 2008-11-08 17:59:06 +00:00
asfernandes
ad716e38d9 Misc 2008-10-20 23:46:46 +00:00
dimitr
7729fe8622 1) Let's avoid a deep recursion for the IN (<list>) predicate. At least on the parser side.
2) Fixed the IN elements limit to be 1500 (as documented) instead of 1499.
2008-10-20 10:43:50 +00:00
asfernandes
774635c3a9 Fixed another case for CORE-1246 - Incorrect column values with outer joins and derived tables:
select t2.n
  from rdb$database t1
  left join (
    select 11 n
      from (
        select 0 a
          from rdb$database
      ) x1
  ) t2
    on 1 = 0
;

was returning 11.
2008-10-04 02:48:35 +00:00
asfernandes
cd8476bea3 Do not change the logic of things that was been working - thanks to Claudio 2008-09-09 11:01:29 +00:00
asfernandes
50ab76f9a7 Fixed:
CORE-2067 - GROUP by and RDB$DB_KEY problems
CORE-2068 - Comparision with IN and subquery with RDB$DB_KEY returns wrong result
CORE-2069 - Incorrect VIEW expansion when RDB$DB_KEY is used in view body
2008-09-07 21:50:00 +00:00
asfernandes
384beddc49 Do not mix flags of union and rse. Problem recently introduced:
select n from t1
union all
select n from t2;
Error: multiple rows in singleton select
2008-09-07 20:25:18 +00:00
asfernandes
b550749a47 Fixed CORE-1246 - Incorrect column values with outer joins and derived tables 2008-09-07 19:44:48 +00:00