db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <Richard.Hille...@Sun.COM>
Subject Re: Duplication of first 5 characters of a SQLState
Date Mon, 07 Nov 2005 16:37:03 GMT
I agree. To roll up the two questions, can someone shed light on the 

o What is supposed to be encoded by the trailing 3 characters of 
11-character sql states?

o Why isn't the XJ* series of sql states gathered into a tidy, commented 
block as is done elsewhere in this file?


Dag H. Wanvik wrote:

>looking at the Javadoc for SQLState, I noticed that it describes some
>state ranges, e.g. for Basic services, Connectivity, Language, but
>these explanations are not comprehensive, e.g. states starting with
>"XJ.." are not mentioned. What's the story here?
>Shouldn't this be augmented? 
>>>>>>"Rick" == Rick Hillegas <Richard.Hillegas@Sun.COM> wrote:
>Rick> Hi Deepa,
>Rick> Sql states are supposed to uniquely identify error conditions. To me 
>Rick> these look like different errors, each of which should have its own sql 
>Rick> state. Could you fix this while you're in there? It looks like there are 
>Rick> four sql states whose codes are duplicated:
>Rick> ij> select sql_state, count(sql_state)
>Rick> from new org.apache.derby.diag.ErrorMessages() c
>Rick> group by sql_state
>Rick> having count(sql_state) > 1
>Rick> ;
>Rick> SQL_&|2
>Rick> -----------------
>Rick> 22007|2
>Rick> 42601|2
>Rick> 42815|2
>Rick> XJ081|2
>Rick> The duplications of 42601 and XJ081 look like mistakes to me.
>Rick> The other two sql states (22007 and 42815) have 11 character codes. The 
>Rick> header comment in SQLState.java explains the meaning of 5, 7, and 9 
>Rick> character codes. But I don't see any explanation of these 11 character 
>Rick> codes. Can anyone shed some light on this?
>Rick> Thanks,
>Rick> -Rick
>Rick> Deepa Remesh wrote:
>Rick> >For DERBY-682, I was adding SQLStates with severity >=
>Rick> >session_severity to the test lang/errorCode.sql. While doing this, I
>Rick> >found that the SQLState 'XJ081' appears two times in the message
>Rick> >properties file with two different severity levels. Output from ij is:
>Rick> >ij> select * from new org.apache.derby.diag.ErrorMessages() c where
>Rick> >sql_state = 'XJ081';
>Rick> >SQL_&|MESSAGE                                                       
>Rick> >                                                              
>Rick> >--------------------------------------------------------------------------------------------------------------------------------------------------
>Rick> >XJ081|Invalid value '{0}' passed as parameter '{1}' to method '{2}'   
>Rick> >                                                               |20000
>Rick> >XJ081|Conflicting create/restore/recovery attributes specified.       
>Rick> >                                                               |40000
>Rick> >
>Rick> >SQLState.java has this:
>Rick> >String INVALID_API_PARAMETER = "XJ081.S";
>Rick> >I checked the code and both these are exceptions are thrown from the code.
>Rick> >
>Rick> >The Javadoc for org.apache.derby.iapi.reference.SQLState says this:
>Rick> >"If the state is seven characters long then only the first five will
>Rick> >be seen by the error reporting code and exception." Can this
>Rick> >duplication of first 5 characters in SQLState cause any problems?
>Rick> >
>Rick> >Thanks,
>Rick> >Deepa
>Rick> >  
>Rick> >

View raw message