#1 2012-09-14 06:35:46

Bascy
Member
From: The Netherlands
Registered: 2012-06-22
Posts: 108

ORA-12899 error Value too large with auto-created Auth tables

When my unittest  running on Oracle auto-create the TAUTH* tables it creates the PasswordHashHexa field with length 40 (according to the index property in TSQLAuthUser)
But when adding the default users in InitializeTable() the PasswordHashHexa is longer than 40 positions, resulting in the following error:

ORA-12899: value too large for column "OPF_MORMOT"."AUTHUSER"."PASSWORDHASHHEXA" ( actual: 64. maximum 40)

The callstack being:

SynDBOracle.TSQLDBOracleLib.HandleError(-1,$54E30F8,False,sllNone)
SynDBOracle.TSQLDBOracleStatement.FetchTest(-1)
SynDBOracle.TSQLDBOracleStatement.ExecutePrepared
SQLite3DB.TSQLRestServerStaticExternal.ExecuteFromJSON('{"LogonName":"Supervisor","DisplayName":"Supervisor","PasswordHashHexa":"67aeea294e1cb515236fd7829c55ec820ef888e8e221814d24d83b3dc4d825dd","GroupRights":2}',0)
SQLite3DB.TSQLRestServerStaticExternal.EngineAdd(TSQLAuthUser,'{"LogonName":"Supervisor","DisplayName":"Supervisor","PasswordHashHexa":"67aeea294e1cb515236fd7829c55ec820ef888e8e221814d24d83b3dc4d825dd","GroupRights":2}')
SQLite3Commons.TSQLRestServer.Add($2592CC0,True,False)
SQLite3Commons.TSQLAuthGroup.InitializeTable($24E6260,'')
SQLite3.TSQLRestServerDB.CreateMissingTables(0)

Looking at the SHA256DigestToString function, it sets the length to SizeOf(TSHA256Digest) * 2
And TSHA256Digest is an array[0..31] of byte, so the result will be 64 in length

Last edited by Bascy (2012-09-14 06:40:34)

Offline

#2 2012-09-14 07:16:13

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,240
Website

Re: ORA-12899 error Value too large with auto-created Auth tables

I've fixed PasswordHashHexa field width.
See http://synopse.info/fossil/info/acb9d3ffef

Thanks for the report.

Offline

Board footer

Powered by FluxBB