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

                 Key: CORE-4768
                 URL: http://tracker.firebirdsql.org/browse/CORE-4768
             Project: Firebird Core
          Issue Type: Bug
            Reporter: Pavel Zotov


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).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to