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
A number of errors when database name is longer than 255 symbols [CORE6248] #6492
Comments
Commented by: @pavel-zotov NBACKUP can work with .FDB file which name is less or equal 253 (ascii ?) character (at least on Winows). After this following error raises: Adding of suffix "..delta" to DB name can not be neither avoided nor replaced with some other (shorter) text. So, for practice usage max length of path + DB filename must be limited with 253 bytes rather than 255 as this ticket title states. |
Commented by: @mrotteveel I'd suggest that instead, the columns of these tables should be changed to allow for longer filenames. And one Windows, checks should be made for API usage, because recent versions of Windows do support longer file paths that 255 characters, though I'm not exactly sure if that requires a different API or specific settings. |
Commented by: @pavel-zotov > instead, the columns of these tables should be changed to allow for longer filenames. Sorry, this i did not understand. Do you mean to increase size of RDB$ / MON$ tables text fields ? > recent versions of Windows do support longer file paths that 255 characters Such API can provoke to create database with path+file name length beyond this limit and, consequently, this makes such DB not usable on OS which still has limit about 255 chars. |
Commented by: @pavel-zotov One more limitation was encountered in record-level backup (i.e. gbak or fbsvcmgr action_backup): maximum length of path + name of DB can be 245 characters. This is the only action that has such limit; all other have greater than this (nbackup = 253, others = 255).
|
Commented by: @hvlad It have no sence as you can't force user to not move\rename existing database file to make full path longer than 255 chars. |
Commented by: @pavel-zotov What exactly 'have no sence' ? |
Commented by: @pavel-zotov > as you can't force user to not move\rename Sorry, could not understand this properly when first read. |
Modified by: @AlexPeshkoffassignee: Alexander Peshkov [ alexpeshkoff ] |
Commented by: @hvlad Alex, |
Commented by: @AlexPeshkoff No, I plan to truncate database name in found by Pavel places |
Modified by: @AlexPeshkoffsummary: Ability to create database with length more than 255 characters should be prohibited => A number of errors when database name is longer than 255 symbols |
Commented by: @AlexPeshkoff Fixed code of gbak, monitoring tables and system function rdb$get_context(). Behavior is consistent with "good old" database info call used in 'show db' in isql, i.e. database name is truncated to 255 chars. Appropriate warnings are issued. .delta suffix added in nbackup is not an issue at all - ALTER DATABASE ADD DIFFERENCE FILE should be used for databases with long name. |
Modified by: @AlexPeshkoffstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 4.0 Beta 2 [ 10888 ] |
Commented by: @pavel-zotov > Fixed code of gbak ... database name is truncated to 255 chars This:gbak:readied database <CUTED-OFF name on 261th character, ellipsis instead of tailing text>
|
Commented by: @pavel-zotov PS. Further, if gbak switches contain '-st tdrw' then name of DB file becomes yet shorter: 235, 243 & 238: gbak: time delta reads writes Am i right in guess that some limitation in gbak utility exists for "decoration" purposes to make text width no more than 260 chars (when we run it without '-st tdrw') or 290 chars (when we use '-st tdrw') ? |
Commented by: @pavel-zotov PPS. Command "gstat -h <dbname_with_length_255_characters>" truncates visible part of DB file name to 241 crahacter. For example, if name of database is: C:\FBTESTING\QA\FBT-REPO\TMP\ABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255.FDB -- then "gstat -h" for this DB will show in the 1st line: Database "C:\FBTESTING\QA\FBT-REPO\TMP\ABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC255DEFABC25... |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Done with caveats Test Details: STDOUT-logs of backup, restore and gstat currently (09-mar-2020) have only truncated name of DB with length about 230...240 chars. |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @asfernandes |
Submitted by: @pavel-zotov
Is related to CORE6419
Following script illustrates athe problem (of course, most probably it can occur with too long PATH that contains from dozen of nested folders rather than single file name):
set list on;
shell del C:\temp\123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123.fdb 2>nul;
shell del C:\temp\1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234.fdb 2>nul;
shell del C:\temp\12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678.fdb 2>nul;
--set echo on;
-- Length of full path + file name = 255 bytes is maximal limit for DB referencing using mon$database_name and/or rdb$get_context('SYSTEM', 'DB_NAME'):
create database 'C:\temp\123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123.fdb';
show database; -- passed OK
select mon$database_name, rdb$get_context('SYSTEM', 'DB_NAME') from mon$database; -- passed OK
commit;
drop database;
------------------------------------------------------------------------ this needs to be fixed: -------------------------------------------------------------
-- When length of full path+file name is 256 then DB is created but can not be referred using RDB$GET_CONTEXT() or MON$DATABASE:
create database 'localhost:C:\temp\1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234.fdb';
show database; -- passed OK. WHY ??
select mon$database_name from mon$database; -- Statement failed, SQLSTATE = 22001 / ... -string right truncation / -expected length 255, actual 256
select rdb$get_context('SYSTEM', 'DB_NAME') from mon$database; -- Statement failed, SQLSTATE = 22001 / ... -string right truncation / -expected length 255, actual 256
commit;
drop database;
PS.
-- When length of full path+file name is 260 then "the system cannot find the path specified" raises.
-- Statement failed, SQLSTATE = 08001 / I/O error during "CreateFile (create)" operation for file ... / -Error while trying to create file
create database 'localhost:C:\temp\12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678.fdb';
drop database;
quit;
Commits: 74f7b30 684e17d
====== Test Details ======
STDOUT-logs of backup, restore and gstat currently (09-mar-2020) have only truncated name of DB with length about 230...240 chars.
Test verifies presense of such truncated strings rather then expected full path + name of DB.
The text was updated successfully, but these errors were encountered: