Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CREATE USER ... TAGS ( argument_1 = 'value1', ..., argument_N = 'valueN' ) - wrong results of statement when there are many arguments [CORE4768] #5068

Closed
firebird-issue-importer opened this issue Apr 21, 2015 · 8 comments

Comments

@firebird-issue-importer

Submitted by: @pavel-zotov

Attachments:
c4464-tmp.zip

The following batch will create statement like this:

drop user usr_01;
commit;
create user usr_01 password '123' tags (
arg_00001='value 00001'
,arg_00002='value 00002'
,arg_00003='value 00003'
, . . .
,arg_NNNN='value NNNN'
);

-- and then extract data from sec$users and sec$attributes for newly created user 'usr_01':

select
cast(u.sec$user_name as char(10)) login,
cast(a.sec$key as char(20)) tag,
cast(a.sec$value as char(25)) val,
sec$plugin sec_plg
from sec$users u
left join sec$user_attributes a on u.sec$user_name = a.sec$user_name
where u.sec$user_name = upper('usr_01');

Batch:

@echo off
setlocal enabledelayedexpansion enableextensions
set sql=ctags-tmp.sql
del %sql% 2>nul
set tq=%1
if .%1.==.. set tq=10
echo drop user usr_01;>>%sql%
echo commit;>>%sql%
echo create user usr_01 password '123' tags (>>%sql%
for /l %%i in (1,1,%tq%) do (
set /a k=100000+%%i
set k=!k:~-5!
if .%%i.==.1. (
echo arg_!k!='value !k!'>>%sql%
) else (
echo ,arg_!k!='value !k!'>>%sql%
)
)
echo );>>%sql%
echo commit;>>%sql%

echo set width sec_plg 7;>>%sql%
echo select>>%sql%
echo cast(u.sec$user_name as char(10)) login,>>%sql%
echo cast(a.sec$key as char(20)) tag,>>%sql%
echo cast(a.sec$value as char(25)) val,>>%sql%
echo sec$plugin sec_plg>>%sql%
echo from sec$users u>>%sql%
echo left join sec$user_attributes a on u.sec$user_name = a.sec$user_name>>%sql%
echo where u.sec$user_name = upper('usr_01');>>%sql%

When I run this batch with argument %1 = 6000 it will create pretty big script 'ctags-tmp.sql' that is in attach.
This script:

C:\MIX\firebird\fb30\isql.exe localhost/3333:e30 -pag 9999999 -i ctags-tmp.sql 1>log 2>err

-- works WITHOUT any error, i.e. user `u01` and his attributes (tags) are created OK.

But in fact NOT ALL attributes which are specified in .sql will be created, only ~40 instead of required 6000 (please look in attach result of this script).

Commits: d284fa3 FirebirdSQL/fbt-repository@deaf333

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Apr 21, 2015

Modified by: @pavel-zotov

Attachment: c4464-tmp.zip [ 12721 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Apr 21, 2015

Commented by: @pavel-zotov

PS.

Launching batch with argument = 2978 will produce .sql that DOES store all 2978 attributes. But launching with arg = 2979 will broke everything:

LOGIN TAG VAL SEC_PLG
========== ==================== ========================= =======
USR_01 AR Srp

(yes, only 'half' of some attribute is stored - cant` see even its number)

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Apr 22, 2015

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Apr 27, 2015

Commented by: @AlexPeshkoff

Also fixed engine to make it raise error on too big segmented blob put.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Apr 27, 2015

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 31, 2015

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Deferred

Test Details: List of plugins in "UserManager" config parameter has to contain `Srp` element.
// TODO //

Test Specifics: [Custom configuration required]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 12, 2018

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Deferred => Done successfully

Test Details: List of plugins in "UserManager" config parameter has to contain `Srp` element.
// TODO //

=>

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jun 12, 2018

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants