Re: [Firebird-devel] garbage_collect_idx() doesn't work?..

2014-04-07 Thread Dimitry Sibiryakov
07.04.2014 12:31, Alex Peshkoff wrote: > HalfStaticArray has no overhead as long as it works with statically > allocated memory. May be. It is hard to see behind stack of templates. -- WBR, SD. -- Put Bad Develope

[Firebird-devel] Memory pools using

2014-04-07 Thread Dimitry Sibiryakov
Hello, All. Are there rules which memory pool must be used in a code? For example, I see that VIO_verb_cleanup() uses default global pool when calling VIO_Data() instead of transaction pool. What may be a reason for this? -- WBR, SD. --

Re: [Firebird-devel] Memory pools using

2014-04-07 Thread Dimitry Sibiryakov
07.04.2014 18:57, Dmitry Yemanov wrote: > tdbb_default is not a global pool, it's a context pool. > VIO_verb_cleanup() sets the transaction pool as a context pool for > duration of its execution. > > Of course, tra_pool could also be used explicitly there. However, the > basic rule is to use tdbb_d

[Firebird-devel] VIO_verb_cleaunp() and locks

2014-04-07 Thread Dimitry Sibiryakov
Hello, All. I can't understand one piece of code in VIO_verb_cleanup(): > if (!DPM_get(tdbb, &rpb, LCK_write)) { > BUGCHECK(186); // msg 186 record disappeared > } > if (rpb.rpb_flags & rpb_delta) { > VIO_data(tdbb, &rpb, tdbb->getDefaultPool()); > } > else { > CCH_RELEAS

Re: [Firebird-devel] classes\InternalMessageBuffer.h

2014-04-09 Thread Dimitry Sibiryakov
09.04.2014 8:32, Dmitry Yemanov wrote: > Is it really necessary at all? We already have UCharBuffer (both better > named and serving the same goal). This buffer is not any UChar buffer, but message data buffer. It could implement data access methods. Though, I agree, that name 'Buffer' is too

[Firebird-devel] Building Firebird 3.0 on Windows in a directory with spaces in name

2014-04-10 Thread Dimitry Sibiryakov
Hello, All. I would like to suggest a little patch that let Firebird 3.0 to be built on Windows in directory containing spaces (which is usual for "My Documents" for example). -- WBR, SD. setenvvar.bat.diff.7z Description: Binary data ---

Re: [Firebird-devel] Bad constant specification in common.h

2014-04-11 Thread Dimitry Sibiryakov
11.04.2014 5:10, Claudio Valderrama C. wrote: > I would reduce the code I copied above to only > three lines: I would clean this macro out completely. All modern compilers support LL suffix. -- WBR, SD. -- Put

[Firebird-devel] Request savepoints

2014-04-11 Thread Dimitry Sibiryakov
Hello, All. Could anybody explain me the purpose of following piece of code in VIO_proc_merge_save_point(), please? > if ( (sav_point = transaction->tra_save_free) ) { > transaction->tra_save_free = sav_point->sav_next; > } > else { > sav_point

[Firebird-devel] TRA_rollback() and 'force' flag

2014-04-13 Thread Dimitry Sibiryakov
Hello, All. What is the meaning of 'force' parameter for TRA_rollback? Is it license to leave database in inconsistent state: with orphan pages/BLOBs/index nodes for the sake of instant end of transaction? -- WBR, SD. ---

Re: [Firebird-devel] TRA_rollback() and 'force' flag

2014-04-13 Thread Dimitry Sibiryakov
13.04.2014 17:54, Dmitry Yemanov wrote: >> Is it license to leave database in inconsistent state: with orphan >> pages/BLOBs/index >> >nodes for the sake of instant end of transaction? > Yes. The state of transaction is consistent (rolled back via TIP), all > the remainders are a garbage to be col

Re: [Firebird-devel] TRA_rollback() and 'force' flag

2014-04-13 Thread Dimitry Sibiryakov
13.04.2014 18:53, Dmitry Yemanov wrote: > VIO_verb_cleanup() rolls back nothing unless sav_verb_count is non-zero. > It shouldn't be the case inside TRA_rollback. Ah, you are right, of course. I'm ashamed. -- WBR, SD. ---

Re: [Firebird-devel] garbage_collect_idx() doesn't work?..

2014-04-14 Thread Dimitry Sibiryakov
04.04.2014 10:46, Alex Peshkoff wrote: > Never told this. Instead I've agreed that such argument as avoiding > additional atomic ops is always important. But it's definitely more > important inside engine in time critical part of it. In this case shouldn't vio.cpp:realoc_record() to be reworked

Re: [Firebird-devel] Created: (CORE-4369) consistency check in MERGE with more data

2014-04-14 Thread Dimitry Sibiryakov
14.04.2014 20:40, Adriano dos Santos Fernandes wrote: > I localized the commit who caused this bug, but so far I'm unable to > fix. It is strange, but on my fresh build script from the ticket is executed without any error. -- WBR, SD. -

Re: [Firebird-devel] Created: (CORE-4369) consistency check in MERGE with more data

2014-04-14 Thread Dimitry Sibiryakov
14.04.2014 20:40, Adriano dos Santos Fernandes wrote: > I localized the commit who caused this bug, but so far I'm unable to > fix. Actually, on official snapshot 31021 it also work without error. -- WBR, SD. -- L

Re: [Firebird-devel] Created: (CORE-4369) consistency check in MERGE with more data

2014-04-14 Thread Dimitry Sibiryakov
14.04.2014 21:26, Adriano dos Santos Fernandes wrote: > Try to commit after the EXECUTE BLOCK. It may be that. Yes, now I see the crash. According to stack trace I would guess that update_in_place() didn't expand delta-backversion to full one or just didn't clean the flag. -- WBR, SD. -

Re: [Firebird-devel] Created: (CORE-4369) consistency check in MERGE with more data

2014-04-14 Thread Dimitry Sibiryakov
In any case the best fix would be to raise error when MERGE is attempting to update the same record second time. It'll make it standard conformant. -- WBR, SD. -- Learn Graph Databases - Download FREE O'Reilly Bo

Re: [Firebird-devel] Created: (CORE-4369) consistency check in MERGE with more data

2014-04-14 Thread Dimitry Sibiryakov
14.04.2014 22:03, Adriano dos Santos Fernandes wrote: > But don't the error can happen in another situations, say, subsequent > updates? I would say - no. Subsequent updates cannot call VIO_modify() with the same rpb two times in row. But you are right: rpb_delta flag appeared without visi

Re: [Firebird-devel] Created: (CORE-4369) consistency check in MERGE with more data

2014-04-15 Thread Dimitry Sibiryakov
14.04.2014 22:03, Adriano dos Santos Fernandes wrote: > But don't the error can happen in another situations, say, subsequent > updates? Having looked a bit deeper I'm sure that this error cannot happen on subsequent updates because they will produce following sequence of events: update->upd

Re: [Firebird-devel] isql v3 with older servers

2014-04-15 Thread Dimitry Sibiryakov
The only version-depended part of isql is metadata extraction. I don't think that there is a point to worry about its compatibility. -- WBR, SD. -- Learn Graph Databases - Download FREE O'Reilly Book "Graph Datab

Re: [Firebird-devel] isql v3 with older servers

2014-04-15 Thread Dimitry Sibiryakov
15.04.2014 18:17, Dmitry Yemanov wrote: > There's also another one - family of SHOW commands. And they're expected > to work as long as you're able to connect to some database. And they will work as long as one requests objects that existed in previous versions. Those who ask for list of pack

Re: [Firebird-devel] isql v3 with older servers

2014-04-15 Thread Dimitry Sibiryakov
15.04.2014 19:11, Dmitry Yemanov wrote: > If show.epp/extract.epp is cleaned up to support v3.0 / ODS12 only, then > requesting objects existing in v2.0 / ODS11 may fail. This is the whole > point of this discussion. Do anybody have examples of what will fail and how?.. -- WBR, SD. --

Re: [Firebird-devel] When did they remove the code to locally connect to a database?

2014-04-22 Thread Dimitry Sibiryakov
22.04.2014 15:41, Ted Miglautsch wrote: > I am wondering in what version of firebird did they remove the code to > allow local connections to databases? > > I just upgraded my O/S to Ubuntu 12.04, which then upgraded my firebird > to version 2.2.14. Now it seems I can no longer connect to my local

Re: [Firebird-devel] [FB-Tracker] Created: (CORE-4403) Allow referencing cursors as record variables in PSQL

2014-04-24 Thread Dimitry Sibiryakov
24.04.2014 18:56, Claudio Valderrama C. wrote: > What I see is that fields with the same name, even though they come from > different tables, would need to be given an alias: > > select T1.A, T2.A ... as cursor C do > v = C.A; -- Error > > => > select T1.A as t1a, T2.A as t2a ... as cursor C

Re: [Firebird-devel] Re Planning the post v3 development

2014-04-28 Thread Dimitry Sibiryakov
27.04.2014 23:04, Jesus Garcia wrote: > I know there is replications applications in firebird, but them are not what > is needed. What features you are missing in them? -- WBR, SD. -- "Accelerate Dev Cycles with

Re: [Firebird-devel] Planning the post v3 development

2014-04-28 Thread Dimitry Sibiryakov
28.04.2014 14:14, Simonov Denis wrote: > 3. Built as a plug -row replication . The standard delivery enable > replication between servers firebird. For other servers, you can write > your own plugin. I'm sleeping on it. > Create a bunch of triggers to support replication is not the nicest way.

Re: [Firebird-devel] Planning the post v3 development

2014-04-28 Thread Dimitry Sibiryakov
28.04.2014 23:21, Claudio Valderrama C. wrote: > I know people will feel outraged with my opinion, but anyway: make DDL > operations atomic and immediate. Uncommitted DDL and DML working in unison > with stable DB structure is a naive dream, period. I may be wrong as often, but AFAIU this dream ma

Re: [Firebird-devel] Planning the post v3 development

2014-04-29 Thread Dimitry Sibiryakov
29.04.2014 0:16, Claudio Valderrama C. wrote: >> -Original Message- >> From: Dimitry Sibiryakov [mailto:s...@ibphoenix.com] >> Sent: Lunes, 28 de Abril de 2014 18:03 >> >> I may be wrong as often, but AFAIU this dream may be a reality if: >> >> 1)

Re: [Firebird-devel] Planning the post v3 development

2014-04-29 Thread Dimitry Sibiryakov
29.04.2014 10:03, Dmitry Yemanov wrote: > 29.04.2014 02:02, Dimitry Sibiryakov wrote: > >> I may be wrong as often, but AFAIU this dream may be a reality if: >> >> 1) Eliminate DFW >> 2) Perform DDL (operations with system tables) in user transaction > >

Re: [Firebird-devel] Planning the post v3 development

2014-04-29 Thread Dimitry Sibiryakov
29.04.2014 11:05, Vlad Khorsun wrote: > Practically - what generation of altered object > user transaction should work with ? According to its isolation level, I'd say. -- WBR, SD. -- "Accelerate Dev Cycles with

Re: [Firebird-devel] Planning the post v3 development

2014-04-29 Thread Dimitry Sibiryakov
29.04.2014 11:17, Dmitry Yemanov wrote: > So user snapshot transaction should not seen changes done by itself (as > user thinks, as it executes DDL in the same transaction)? That's why I think that executing DDL in separate autocommit transaction is a bad idea. -- WBR, SD. --

Re: [Firebird-devel] Planning the post v3 development

2014-04-29 Thread Dimitry Sibiryakov
29.04.2014 11:07, Alex wrote: > On 04/29/2014 12:49 PM, Dimitry Sibiryakov wrote: > >> May be stop separate metadata cache at all and use ordinary data cache >> for reading >> system tables directly every time. > > And have prepare time increased many t

Re: [Firebird-devel] Replication

2014-04-29 Thread Dimitry Sibiryakov
29.04.2014 14:24, Carlos H. Cantu wrote: > You are right about the DB design, but that's up to the user. You > dont and should not worry with this. But the one who implements built-in replication will have to worry about conflict handling, constraint failure and so on. In the case of synch

Re: [Firebird-devel] Odp: Replication

2014-04-30 Thread Dimitry Sibiryakov
30.04.2014 6:45, liviusliv...@poczta.onet.pl wrote: > If we talking about synchronous replication then what problem with extending > shadow files > feature to support it? People are asking for multimaster, not just inaccessible standby. Even read-only standby is not going to work with shadow

Re: [Firebird-devel] Transactional Metadata (was: Planning the post v3 development)

2014-05-02 Thread Dimitry Sibiryakov
29.04.2014 12:48, Alex Peshkoff wrote: > It's about reading table data from page cache when prepare gets slower > many times. If system table is not in page cache it will be hundreds > times slower. Yes, this particular piece of code. But how big % of execution time it takes in greater pictur

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-03 Thread Dimitry Sibiryakov
03.05.2014 20:50, Dmitry Yemanov wrote: > Is the problem mostly in numeric->double conversion or does compress() > mangle the key unrecoverrably in any case? AFAIK, transformation of string into key is up to ICU which does not provide a way for backward transformation. -- WBR, SD. -

Re: [Firebird-devel] Not handled correctly is such a design in Legacy API.

2014-05-04 Thread Dimitry Sibiryakov
04.05.2014 11:10, Simonov Denis wrote: > execute block > as > begin > suspend; > end > > FB2.5 > > No result. It's good. IMHO, such construction must produce error "no output variables" at prepare time as it is does "select from t": SQL> select from rdb$database; Statement failed, SQLST

Re: [Firebird-devel] Not handled correctly is such a design in Legacy API.

2014-05-04 Thread Dimitry Sibiryakov
04.05.2014 11:34, Simonov Denis wrote: > Maybe you're right. But I am surprised at the difference in treatment in > the Legacy and the new API. And also the fact that in Fb2.5 is handled > differently. Following patch should fix the issue: > Index: why.cpp > ===

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-05 Thread Dimitry Sibiryakov
05.05.2014 17:06, Jim Starkey wrote: > My third concern is that garbage collection will be very tricky, but as > lone as the going/staying lists are maintained, doable. Actually, transaction numbers in nodes should allow to stop using going/staying lists among with overhead of collecting them

[Firebird-devel] BUGCHECK 290

2014-05-06 Thread Dimitry Sibiryakov
Hello, All. When EXE_verb_cleanup() re-throw any error as BUGCHECK(290), it loose all information about original error. IMHO, it is not good because it makes diagnostic harder. Should I create a ticket in tracker? -- WBR, SD. ---

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-06 Thread Dimitry Sibiryakov
06.05.2014 10:28, Dmitry Yemanov wrote: > Decreasing the scale is allowed and should work fine, AFAIU. Shouldn't it be contrary?.. If in table is value 1.234 and scale is changed from 3 to 2, this value will be displayed as 1.23, but cannot be found by eq. Vice versa it works: value 1.23 wi

Re: [Firebird-devel] BUGCHECK 290

2014-05-06 Thread Dimitry Sibiryakov
06.05.2014 10:54, Dmitry Yemanov wrote: > I believe we don't need a bugcheck there at all. Transaction should be > invalidated and the original error rethrown. AFAICS further DML operations are allowed in invalidated transaction. Shouldn't ROLLBACK to be the only permitted action? -- WBR

Re: [Firebird-devel] Running firebird.exe as application

2014-05-06 Thread Dimitry Sibiryakov
06.05.2014 20:32, Mark Rotteveel wrote: > So: what is the meaning of -m, and why is it necessary? It stand for "multi-threaded". Without it firebird.exe works in classic mode and spawn separate processes for each connection. -- WBR, SD. --

Re: [Firebird-devel] FYI: Interesting approach to cache management

2014-05-06 Thread Dimitry Sibiryakov
06.05.2014 23:21, Leyne, Sean wrote: > I also know that there has been historical discussion of changing the engine > to recognize > table scan/NATURAL and backup to modify the cache operation. They weren't just discussion, Firebird already work this way from the beginning. -- WBR, SD.

Re: [Firebird-devel] BUGCHECK 290

2014-05-07 Thread Dimitry Sibiryakov
06.05.2014 10:54, Dmitry Yemanov wrote: > Transaction should be invalidated Is line "tra_flags |= TRA_invalidated" enough for that or something more should be done for transaction invalidation? -- WBR, SD. -- Is

Re: [Firebird-devel] BUGCHECK 290

2014-05-07 Thread Dimitry Sibiryakov
07.05.2014 11:49, Dmitry Yemanov wrote: > Enough, AFAIK. Ok, done. -- WBR, SD. -- Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Re

[Firebird-devel] Careful writes: data and index

2014-05-08 Thread Dimitry Sibiryakov
Hello, All. If a record is inserted or modified, what will be order of page written: data page first then index page or vice versa? -- WBR, SD. -- Is your legacy SCM system holding you back? Join Perforce May

[Firebird-devel] WHEN handler and data state

2014-05-08 Thread Dimitry Sibiryakov
Hello, All. Which data state is supposed to be seen in WHEN block? Before undoing changes or after it? Say, we have "update t set f=1" then in begin-end block "update set f=2" is done and then exception is thrown. What value should give "select f from t" in WHEN block? 1 or 2? --

Re: [Firebird-devel] Careful writes: data and index

2014-05-08 Thread Dimitry Sibiryakov
08.05.2014 19:22, Dmitry Yemanov wrote: > IIRC, there is no precedence dependency between these two pages, so they > can be written in any order. So, with FW=OFF, killing server in-between can produce both orphan nodes and missing entries depending on luck and parallel activity. -- WBR,

Re: [Firebird-devel] Careful writes: data and index

2014-05-08 Thread Dimitry Sibiryakov
08.05.2014 19:49, Leyne, Sean wrote: > True, but that is database corruption problem, not an order of precedence > issue. Orphan nodes are harmless, missing entries are worse. -- WBR, SD. -- Is your legacy SCM sy

Re: [Firebird-devel] Careful writes: data and index

2014-05-08 Thread Dimitry Sibiryakov
08.05.2014 20:05, Dmitry Yemanov wrote: > 2) There's no much difference between FW ON and OFF in this particular > case. Even with forced writes enabled, the server may die in between > writing those pages. In this case transaction won't be marked as committed and record will be garbage colle

[Firebird-devel] Multiple WHEN handlers

2014-05-09 Thread Dimitry Sibiryakov
Hello, All. Must multiple error handlers be allowed for the same block? I.e. something like this: BEGIN WHEN SQLCODE -803 DO WHEN GDSCODE isc_key_violation DO WHEN ANY DO . END -- WBR, SD.

Re: [Firebird-devel] Multiple WHEN handlers

2014-05-09 Thread Dimitry Sibiryakov
09.05.2014 13:52, Mark Rotteveel wrote: > So although multiple WHENs might be handy, they are - afaik - currently > not allowed, and this limitation can be worked around. Actually, according to my test, they are allowed now, but their behavior seems strange to me. That's why I ask. For exa

Re: [Firebird-devel] Multiple WHEN handlers

2014-05-09 Thread Dimitry Sibiryakov
09.05.2014 14:37, Dmitry Yemanov wrote: > They were always allowed, so we cannot even think about breaking this. > The only thing that may be treated like a bug is CORE-3275. Ok. From your comment in the ticket I conclude that _every_ matching handler must be executed. Am I right? I.e. in

Re: [Firebird-devel] Multiple WHEN handlers

2014-05-09 Thread Dimitry Sibiryakov
09.05.2014 15:37, Dmitry Yemanov wrote: > Looking at the code, the problem is that the first successfully matched > WHEN block clears the status vector, so only WHEN ANY can be matched > after that. And this code (inherited from InterBase) seems to be written > intentionally. BTW, this is not t

[Firebird-devel] MET_scan_relation()

2014-05-09 Thread Dimitry Sibiryakov
Hello, All. What following asserts are supposed to check? My debug build is falling into them every time I try to check (almost fresh) database. switch (REL.RDB$RELATION_TYPE) { case rel_persistent: break; case rel_external: fb_assert(relati

Re: [Firebird-devel] MET_scan_relation()

2014-05-09 Thread Dimitry Sibiryakov
09.05.2014 19:37, Dmitry Yemanov wrote: > What is "check database"? Validate with gfix? Yes, gfix -full >> >case rel_global_temp_delete: >> >fb_assert(relation->rel_flags & REL_temp_tran); > What exactly asserts do you see fired? This one. I just run "isql -i oltp_ddl.sql"

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-10 Thread Dimitry Sibiryakov
10.05.2014 9:03, Molnár Attila wrote: > *VARIANT data type in PSQL* > - gain : a little memory and/or CPU overhead but much cleaner code. Also > rdb$get/set_context value colud be variant. Welcome to the hell of unpredictable type conversion. > *Optimization II. > *- temporal indexing

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-10 Thread Dimitry Sibiryakov
10.05.2014 10:12, Molnár Attila wrote: > OK, this just means smaller treshold rate. But with this some case you > can gain HUGE performance boost (especially when the resultset can't fit > into memory and have to write to disk) Big result set is a sign of wrong application design. And in any ca

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-10 Thread Dimitry Sibiryakov
10.05.2014 14:03, Vlad Khorsun wrote: > For blob's we still need that lists, yes No. In my workcopy I got rid of them for blobs. The trick is not to garbage collect blobs that are referenced by potentially active versions in undo log. -- WBR, SD.

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-10 Thread Dimitry Sibiryakov
10.05.2014 14:50, Vlad Khorsun wrote: > Explain, please, because i see no way to use undo log (which is > maintained in > memory for *currently* active tx) for garbage collection of record chain > which primary > version was created by *another* tx. It is not needed because blob id is a

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-10 Thread Dimitry Sibiryakov
10.05.2014 15:30, Vlad Khorsun wrote: > Here you wrong: if blob contents was not changed by update, there will > be no new blob. Yes, and in this case blob cannot be garbage collected because next record version refers to it. No need to analyze whole versions chain (collect staying list

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-10 Thread Dimitry Sibiryakov
10.05.2014 15:30, Vlad Khorsun wrote: > if blob contents was not changed by update, there will be no new blob. Imagine that we have version chain like this (only blob ids are listed): 1->2->2->3->3->3(first staying)->3->4->5->5 Because to the right from "first staying" version cannot be

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-10 Thread Dimitry Sibiryakov
10.05.2014 17:04, Jim Starkey wrote: > Are you saying that the blob is copied on record update even if the blob > has not changed? No. Blob content is copied if old blob id differs from new one during update. On insert it is copied always unless temporary id is used. At least this behavio

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-11 Thread Dimitry Sibiryakov
11.05.2014 0:18, Vlad Khorsun wrote: > It is wrong for "lost update" scenario, which is allowed for > read-committed transactions: > > att1: start tx1, insert version1 (blob1), commit tx1 > > att1: start tx2 (read-committed), read version1 (blob1) > > att2: start tx4, update version2 (blob2),

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-11 Thread Dimitry Sibiryakov
11.05.2014 10:44, Vlad Khorsun wrote: It is better to write application to test it. And application should be clever enough to be able to put already read blob_id into parameter instead of creating new blob_id. I tested with attached application and got this: tx1: blob id = 80:1 tx2: bl

[Firebird-devel] CORE-3515

2014-05-12 Thread Dimitry Sibiryakov
Hello, All. Similar logic as described in subj can be found also in expunge(). Record is deleted from data page first and only then garbage in index is collected. May it be another source of the problem? -- WBR, SD. --

Re: [Firebird-devel] CORE-3515

2014-05-12 Thread Dimitry Sibiryakov
12.05.2014 16:30, Vlad Khorsun wrote: > Sure. And this is why i wrote recently > > > currently used way of GC ... not 100% safe in highly concurrent > environment. Can this case be fixed by moving call to delete_record() below garbage_collect()? Something like this: > // If there aren

[Firebird-devel] Collection of garbage in record with uncommitted version

2014-05-13 Thread Dimitry Sibiryakov
Hello, All. If a record has uncommitted head version created by active transaction and some garbage in backversions "tail", can anyone (background GC thread, sweep or parallel transaction) wipe this garbage from the tail while the transaction is still active? I can't understand why li

Re: [Firebird-devel] Collection of garbage in record with uncommitted version

2014-05-13 Thread Dimitry Sibiryakov
13.05.2014 13:36, Vlad Khorsun wrote: > Yes How? If I remember your lesson right, garbage in a record is collected only if head version is marked with transaction number lesser that OAT. > list_staying used to undo dead record version. It is not a most often > operation. Actual

Re: [Firebird-devel] Collection of garbage in record with uncommitted version

2014-05-13 Thread Dimitry Sibiryakov
13.05.2014 14:25, Vlad Khorsun wrote: >>Actually, it is used in following cases: >> > >> >1) Undo with VIO_backout(). >> >2) Undo of update_in_place() in VIO_verb_cleanup(). >> >3) Applying third and following changes of the same record in one >> >transaction. > I know. I just a bit lazy

Re: [Firebird-devel] CORE-3515

2014-05-13 Thread Dimitry Sibiryakov
13.05.2014 14:33, Vlad Khorsun wrote: > Your code will leave record with broken backversion pointer in case of > failure while garbage_collect is running. To avoid this, we need to zero > backpointer before > garbage_collect. It also have risk to create orphan backversions but it is > not a big

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-13 Thread Dimitry Sibiryakov
10.05.2014 14:03, Vlad Khorsun wrote: >As for A-B-A > updates i see no problem as there will be 3 separate index entries with own > tx numbers. Currently we also have 3 index entires for such scenario, btw. > Old IB's optimization to not store existing key second time is not working in > concur

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-13 Thread Dimitry Sibiryakov
13.05.2014 17:10, Jim Starkey wrote: > On 5/13/2014 10:59 AM, Dimitry Sibiryakov wrote: >> > If I'm not mistaken, these repeating index entries works as a >> > reference counters and >> >allow to stop using staying list for indexes even in current code

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-13 Thread Dimitry Sibiryakov
13.05.2014 17:43, Jim Starkey wrote: >For example, > when cleaning up after a crash, does the code scan all record versions > to avoiding taking out a single version when the code was expecting a > double entry? Nice catch. Yes, if a version don't have all index entries inserting finished,

[Firebird-devel] FIFO list

2014-05-14 Thread Dimitry Sibiryakov
Hello, All. Firebird::Stack implements LIFO list. Is there a ready to use template for FIFO list? -- WBR, SD. -- "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Seleni

[Firebird-devel] Double update in trigger

2014-05-14 Thread Dimitry Sibiryakov
Hello, All. In Firebird 3.0 following script works differently from 2.5. Is it expected side-effect of cursor stability? create table u_dbl(id integer primary key, f integer); create index idx_dbl on u_dbl(f); set term ^; create trigger dbl_boom for u_dbl before update as declare variable

Re: [Firebird-devel] Created: (CORE-4369) consistency check in MERGE with more data

2014-05-14 Thread Dimitry Sibiryakov
14.04.2014 20:40, Adriano dos Santos Fernandes wrote: > I localized the commit who caused this bug, but so far I'm unable to > fix. BTW, I've hacked this bug away by calling VIO_get_current() unconditionally instead of conditional call of VIO_refetch_record() in VIO_modify(). May be it can gi

Re: [Firebird-devel] Double update in trigger

2014-05-14 Thread Dimitry Sibiryakov
14.05.2014 17:44, Vlad Khorsun wrote: > If you really interested in answer and respect other list members, add > results of your > scripts here to not force others to do what you already did. 2.5 result: > Statement failed, SQLSTATE = 22012 > arithmetic exception, numeric overflow, or st

Re: [Firebird-devel] Feature request & discussion (Reply to Planning the post v3 development)

2014-05-14 Thread Dimitry Sibiryakov
14.05.2014 17:48, Vlad Khorsun wrote: >> 10.05.2014 14:03, Vlad Khorsun wrote: >>If I'm not mistaken, these repeating index entries works as a reference >> counters and > > Nope. A-A...A-B will produce two index entries Right. And it means that there are two _series_ of versions: one

Re: [Firebird-devel] CORE-3515

2014-05-14 Thread Dimitry Sibiryakov
14.05.2014 17:39, Vlad Khorsun wrote: >> > You are tight, but this performance penalty won't be bigger than in >> > VIO_backout() case >> >with DPM_backout_mark() call. > Probably. What do you want to show here ? That one additional write in expunge() must be an acceptable price for ro

Re: [Firebird-devel] Double update in trigger

2014-05-14 Thread Dimitry Sibiryakov
14.05.2014 18:10, Vlad Khorsun wrote: > I'd said it is really because cursor stability. Looks like top-level > update ignores update of record > with ID = 2, made by trigger. Not only this. Two new versions of the record were created instead of one (because update_in_place() wasn't call

[Firebird-devel] A patch to submit

2014-05-19 Thread Dimitry Sibiryakov
Hello, All. I would like to submit an attached patch. It does following things: 1) Fix CORE-4382, CORE-4383 and CORE-4424. 2) Fix unregistered case of missing index entries and blob ids after releasing one savepoint of many (list_staying() didn't take into account versions in memory undo lo

Re: [Firebird-devel] A patch to submit

2014-05-19 Thread Dimitry Sibiryakov
19.05.2014 18:23, Ann Harrison wrote: > Can you explain "erase in place" briefly? In specific, how is it undone in a > catastrophic > failure (i.e. not a transaction cleanup)? I simply call update_in_place() with delete stub from VIO_erase() if the head record version is marked with the sam

Re: [Firebird-devel] A patch to submit

2014-05-20 Thread Dimitry Sibiryakov
20.05.2014 16:31, Ann Harrison wrote: > If a transaction deletes a record in which the latest version was created by > a different > transaction, you create a separate deleted stub, just as before. > > Right? Yes, sure. -- WBR, SD.

Re: [Firebird-devel] DDL Triggers, how to retrieve type?

2014-05-22 Thread Dimitry Sibiryakov
23.05.2014 8:14, Martijn Tonies (Upscene Productions) wrote: >> - Any other suggestion? > > Drop dialect 1 support. Allow dialect 1 to have access to BIGINT fields. -- WBR, SD. -- "Accelerate Dev Cycles with Autom

Re: [Firebird-devel] DDL Triggers, how to retrieve type?

2014-05-23 Thread Dimitry Sibiryakov
23.05.2014 8:41, Martijn Tonies (Upscene Productions) wrote: > but the question that arises is "why?" > > What are the reasons to continue to use dialect 1? Mathematic, for example. Standard behavior of division which dialect 3 supports is not the best idea. -- WBR, SD.

Re: [Firebird-devel] DDL Triggers, how to retrieve type?

2014-05-23 Thread Dimitry Sibiryakov
23.05.2014 11:29, Alex Peshkoff wrote: > It's not absolutely required to have bigint column - it's enough to > store bit number, which is less than 64. It makes impossible to use JOIN to retrieve trigger's type via SQL query. In this case there is no point to pollute RDB$TYPES with useless ga

Re: [Firebird-devel] DDL Triggers, how to retrieve type?

2014-05-23 Thread Dimitry Sibiryakov
23.05.2014 11:54, Alex Peshkoff wrote: > Did you read that this is mask, not code? It's anyway impossible to join > directly, but with some functions - why not. With mask it is possible to use LIST() and BIT_AND() to get list of triggers with actions. With bit number it won't work because of

Re: [Firebird-devel] DDL Triggers, how to retrieve type?

2014-05-23 Thread Dimitry Sibiryakov
23.05.2014 12:48, Vlad Khorsun wrote: > This "useless garbage" is required for self-documenting Self-documenting of what? Isn't list in header enough for this purpose?.. -- WBR, SD. -- "Accelerate Dev Cycles with

Re: [Firebird-devel] DDL Triggers, how to retrieve type?

2014-05-23 Thread Dimitry Sibiryakov
23.05.2014 13:04, Martijn Tonies (Upscene Productions) wrote: > Also, I'm not quite getting how a bit mask can be a list of normal numbers, > but this may be just me being confused. No, I also have no idea how to corellate data in RDB$TYPES with all the rest. -- WBR, SD. -

Re: [Firebird-devel] DDL Triggers, how to retrieve type?

2014-05-24 Thread Dimitry Sibiryakov
24.05.2014 2:28, Claudio Valderrama C. wrote: > We have > BIN_SHL > BIN_SHR > for shifting bits. Oh, indeed. Stupid me... :( -- WBR, SD. -- "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE In

[Firebird-devel] Database-only config parameter

2014-05-26 Thread Dimitry Sibiryakov
Hello, All. Is it possible for 3.0 to have a parameter which can be set only for database, but not globally? -- WBR, SD. -- The best possible search technologies are now affordable for all companies. Download

[Firebird-devel] Per-database SharedDatabase,SharedCache?

2014-05-28 Thread Dimitry Sibiryakov
Hi, All. I wonder why SharedDatabase cannot be set on database level (and why config manager doen't show any error if it found this setting in database block)? -- WBR, SD. -- Time is money. Stop wasting it! G

[Firebird-devel] Working with plugins from Firebird code

2014-05-29 Thread Dimitry Sibiryakov
Hello, All. Instead of guessing from code, I would like to ask how to: 1) Get set of plugins of a definite type configured for a given database loading them if necessary; 2) Call a method of each of them; 3) Call a method of each of them once again. I found that IPluginSet may be suit

Re: [Firebird-devel] Working with plugins from Firebird code

2014-06-01 Thread Dimitry Sibiryakov
01.06.2014 8:23, Alex Peshkoff wrote: > what for do you need rewind() here? If several replication plugins are configured for the same database, it is the right thing to make them working simultaneously. So, for every changed record I must call an every plugin's method. It is time-critical

[Firebird-devel] Non-upgradeable IVersioned-derived interface

2014-06-08 Thread Dimitry Sibiryakov
Hello, All. If I don't want interface of different from desired version to be used, how to do it? Any special kind of UpgradeInfo, perhaps or can I just pass NULL as UpgradeInfo struct pointer?.. -- WBR, SD. --

[Firebird-devel] Plugin version number

2014-06-10 Thread Dimitry Sibiryakov
Hello, All. What is the right method to choose subj for a new plugin? Should it be a sum of version numbers of all parent classes (ie IVersioned+IPluginModule+IBasePlugin etc)? -- WBR, SD. -- HPCC Systems Ope

Re: [Firebird-devel] Plugin version number

2014-06-10 Thread Dimitry Sibiryakov
10.06.2014 13:42, Alex Peshkoff wrote: > Choosing version is needed only f you add new type of plugin - for > existing plugin types version number is already chosen. And this is exactly what I'm trying to do. > Now let me return to one more aspect. Adding own plugin types by users > was not ta

Re: [Firebird-devel] Plugin version number

2014-06-10 Thread Dimitry Sibiryakov
10.06.2014 15:57, Alex Peshkoff wrote: > That's not about versioning, but about choosing a way to assign to > plugins user types not conflicting with system types. Or having plugins > of different types is also completely unnecessary?;) Actually, yes. I don't understand what you call "user type

Re: [Firebird-devel] Plugin version number

2014-06-10 Thread Dimitry Sibiryakov
10.06.2014 19:54, Alex Peshkoff wrote: > Well, Dimitry in that case please explain what do you mean by 'what > version should be assigned to plugin'. The only case when new version > should be chosen is when new type of plugin added. Right. That's what I'm trying to do now. > When you asked ab

<    1   2   3   4   5   6   7   8   9   10   >