Re: [Firebird-devel] Dropping database default SQL SECURITY

2022-02-14 Thread Dmitry Yemanov

14.02.2022 22:40, Roman Simakov wrote:


I don't remember exactly why we decided to make it nullable. I suppose
for more backward compatibility. If a client doesn't use it it will be
NULL everywhere.


Maybe the idea was to distinguish between legacy databases (restored 
without SQL SECURITY) and explicitly declared SQL SECURITY in newer 
databases?



So in fact it can be NULL physically. But logically only two options
make sense. NULL is considered as legacy, i.e. INVOKER.
Thus you are right. For INVOKER we have two values to read and one to write.


The question is whether seeing legacy is really important. If not, I'd 
suggest to convert NULL into INVOKER during restore.



Dmitry


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Dropping database default SQL SECURITY

2022-02-14 Thread Roman Simakov
I don't remember exactly why we decided to make it nullable. I suppose
for more backward compatibility. If a client doesn't use it it will be
NULL everywhere.
So in fact it can be NULL physically. But logically only two options
make sense. NULL is considered as legacy, i.e. INVOKER.
Thus you are right. For INVOKER we have two values to read and one to write.

пн, 14 февр. 2022 г. в 19:43, Jiří Činčura :
>
> You say it cannot be NULL, yet you say the "initial NULL". Looks very 
> inconsist to me. Now for INVOKER there's 2 possible values. Yet one can't 
> ever be set by user.
>
> --
> Mgr. Jiří Činčura
> https://www.tabsoverspaces.com/
>
> On Mon, Feb 14, 2022, at 15:22, Roman Simakov wrote:
> > It's the default for a database. It cannot be NULL. Initial NULL means 
> > INVOKER.
> >
> > пн, 14 февр. 2022 г. в 16:43, Jiří Činčura :
> >>
> >> Hi *,
> >>
> >> How can I drop SQL SECURITY on database, aka setting the RDB$SQL_SECURITY 
> >> column back to "null"?
> >>
> >> --
> >> Mgr. Jiří Činčura
> >> https://www.tabsoverspaces.com/
> >>
> >>
> >> Firebird-Devel mailing list, web interface at 
> >> https://lists.sourceforge.net/lists/listinfo/firebird-devel
> >
> >
> >
> > --
> > Роман Симаков
> >
> >
> > Firebird-Devel mailing list, web interface at
> > https://lists.sourceforge.net/lists/listinfo/firebird-devel
>
>
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel



-- 
Роман Симаков


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] JRD_reschedule

2022-02-14 Thread Adriano dos Santos Fernandes
On 14/02/2022 10:43, Alex Peshkoff via Firebird-devel wrote:
> 
> - AST (yes, 'A'-async is wrong tday, but I use traditional term) processing

That is the part I was missing, thanks.

BTW in thread_db::reschedule() we have:

-

void thread_db::reschedule()
{
// Somebody has kindly offered to relinquish
// control so that somebody else may run

checkCancelState();

StableAttachmentPart::Sync* sync =
this->getAttachment()->getStable()->getSync();
Database* dbb = this->getDatabase();

if (sync->hasContention())
{
FB_UINT64 cnt = sync->getLockCounter();

EngineCheckout cout(this, FB_FUNCTION);
Thread::yield();

while (sync->hasContention() && (sync->getLockCounter() == cnt))
Thread::sleep(1);
}

checkCancelState();

Monitoring::checkState(this);

if (tdbb_quantum <= 0)
tdbb_quantum = (tdbb_flags & TDBB_sweeper) ? SWEEP_QUANTUM : 
QUANTUM;
}

-

Should not the checkCancelState() be better inside the "if
(sync->hasContention())" as the no contention case just checked it?


Adriano


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Dropping database default SQL SECURITY

2022-02-14 Thread Jiří Činčura
You say it cannot be NULL, yet you say the "initial NULL". Looks very inconsist 
to me. Now for INVOKER there's 2 possible values. Yet one can't ever be set by 
user.

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/

On Mon, Feb 14, 2022, at 15:22, Roman Simakov wrote:
> It's the default for a database. It cannot be NULL. Initial NULL means 
> INVOKER.
>
> пн, 14 февр. 2022 г. в 16:43, Jiří Činčura :
>>
>> Hi *,
>>
>> How can I drop SQL SECURITY on database, aka setting the RDB$SQL_SECURITY 
>> column back to "null"?
>>
>> --
>> Mgr. Jiří Činčura
>> https://www.tabsoverspaces.com/
>>
>>
>> Firebird-Devel mailing list, web interface at 
>> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>
>
>
> -- 
> Роман Симаков
>
>
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] DROP SQL SECURITY for trigger

2022-02-14 Thread Jiří Činčura
Makes sense. Thanks.

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/

On Mon, Feb 14, 2022, at 15:26, Roman Simakov wrote:
> It's possible to alter a trigger partly, alter an option of a trigger.
> SQL SECURITY is one of such options. For procedures you must specify
> "complete definition" every time.
>
> пн, 14 февр. 2022 г. в 12:35, Jiří Činčura :
>>
>> Hi *,
>>
>> I'm wondering why is there explicit "DROP SQL SECURITY" for triggers, while 
>> i.e. procedures use regular "alter" statement?
>>
>> --
>> Mgr. Jiří Činčura
>> https://www.tabsoverspaces.com/
>>
>>
>> Firebird-Devel mailing list, web interface at 
>> https://lists.sourceforge.net/lists/listinfo/firebird-devel
>
>
>
> -- 
> Роман Симаков
>
>
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] DROP SQL SECURITY for trigger

2022-02-14 Thread Roman Simakov
It's possible to alter a trigger partly, alter an option of a trigger.
SQL SECURITY is one of such options. For procedures you must specify
"complete definition" every time.

пн, 14 февр. 2022 г. в 12:35, Jiří Činčura :
>
> Hi *,
>
> I'm wondering why is there explicit "DROP SQL SECURITY" for triggers, while 
> i.e. procedures use regular "alter" statement?
>
> --
> Mgr. Jiří Činčura
> https://www.tabsoverspaces.com/
>
>
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel



-- 
Роман Симаков


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] Dropping database default SQL SECURITY

2022-02-14 Thread Roman Simakov
It's the default for a database. It cannot be NULL. Initial NULL means INVOKER.

пн, 14 февр. 2022 г. в 16:43, Jiří Činčura :
>
> Hi *,
>
> How can I drop SQL SECURITY on database, aka setting the RDB$SQL_SECURITY 
> column back to "null"?
>
> --
> Mgr. Jiří Činčura
> https://www.tabsoverspaces.com/
>
>
> Firebird-Devel mailing list, web interface at 
> https://lists.sourceforge.net/lists/listinfo/firebird-devel



-- 
Роман Симаков


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] JRD_reschedule

2022-02-14 Thread Alex Peshkoff via Firebird-devel

On 2/14/22 15:33, Adriano dos Santos Fernandes wrote:

Hi!

What is the importance of JRD_reschedule today?

More specifically speaking, verifying contention and "checking out"?



- AST (yes, 'A'-async is wrong tday, but I use traditional term) processing
- cancel, shutdown, etc. processing




Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] Dropping database default SQL SECURITY

2022-02-14 Thread Jiří Činčura
Hi *,

How can I drop SQL SECURITY on database, aka setting the RDB$SQL_SECURITY 
column back to "null"?

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] JRD_reschedule

2022-02-14 Thread Adriano dos Santos Fernandes
Hi!

What is the importance of JRD_reschedule today?

More specifically speaking, verifying contention and "checking out"?


Adriano


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] DROP SQL SECURITY for trigger

2022-02-14 Thread Jiří Činčura
Hi *,

I'm wondering why is there explicit "DROP SQL SECURITY" for triggers, while 
i.e. procedures use regular "alter" statement?

-- 
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel