Additional steps required if you used 12.5.4 features before downgrading

If you are rolling back after having used any of the 12.5.4 features, additional steps can be necessary. You should take steps before you downgrade to pre-12.5.4, and others should be performed immediately after downgrading. Areas of concern are listed for each new feature.

In general, no additional steps are required when you are returning to an Adaptive Server version in which the feature was already available. When returning to a server version earlier than the version in which the feature was introduced, you must be aware of the areas of concern listed below.

Encrypted Columns

If you have used the encrypted columns feature of 12.5.4, you must take steps in 12.5.4 before you downgrade. Perform the following. See “Downgrade instructions for Adaptive Server with encrypted columns”.

Real-Time Messaging

Drop all stored procedures, views, and triggers that use the messaging built-ins for the Real-Time Messaging feature.

For more information about Real Time Messaging, see the Real-time Data Services Messaging Users Guide.

New sort orders

Upgrading from 12.5.0.3 to 12.5.4 or later modifies syscharsets. All of the sort orders that were (formerly) destined for use with unichar was rewritten in terms of ID and CSID, although the names remain the same. Other sort orders (that is, any that you loaded with the charset utility or the sqlloc GUI front end) remain unmodified.

While running under 12.5.4, you may configure UTF-8 with a non-binary sort order. If you return to 12.5.0.3 that server fails to start, with a message saying that the character set/sort order combination is not supported. Versions earlier than 12.5.0.3, however, do not have the error handling code; you do not get the message but instead see inexplicable behavior. The most likely symptom is that the server cannot find anything using indexes on the system tables.

To get around this:

Now when you start 12.5.0.3, syscharsets is still in the 12.5.4 state. If you run sp_helpsort, rewrite syscharsets to a close approximation of what it was before the upgrade.

NoteIf you execute sp_helpsort now, and then decide to go back to 12.5.4, be aware that although syscharsets is in the 12.5.0.3 state, the upgrade does not run again since it has already run once. Execute sp_helpsort again on return to 12.5.4 to update the syscharsets table.

Unicode parser

If you have taken advantage of unicode parser feature through explicit or implicit use of the U&'syntax' (in a stored procedure, for example), the text of the stored procedure is saved in syscomments. If you roll back to 12.5.0.3 and the server needs to recompile from query text, you get syntax errors.

On another note, if you take advantage of the fact that in 12.5.4 unichar no longer requires UTF-8, you may have stored procedure plans that contain unichar-to-char conversions. In 12.5.4 this is handled correctly on a non-UTF-8 server. In 12.5.0.3 and earlier, however, the assumption was UTF-8; anything else causes the conversion to throw an error and abort the transaction.

date/time datatypes

When you start the 12.5.4 server, the new system types are installed in systypes. If you returned to 12.5.0.3:

If you returned to a pre-12.5.0.3 server, nothing prevents you from creating objects using date and time types (since no error handling code exists for this purpose), but this is not advisable because any operations on those objects such as selects or inserts result in stack traces.

If you have created 12.5.4 tables with date or time columns, or procedures with date or time parameters, you need to remove references to these types before rolling back to a pre-12.5.4 server. You can run the following, which identifies the offending tables and procedures, advising you to remove references to them or use alter table to modify the types:

sp_date_time_type

If sp_date_time_types does not find any date/time objects, it marks procedural objects for recompile, removing all internal references to these new types

SQL derived tables

If you used SQL derived tables before returning to a pre-12.5.4 version server, and you:

Native XML

The XML Services feature of Adaptive Server includes the following new built-in functions and clauses:

If you create views or stored procedures using one of these features in 12.5.4, then return to 12.5.0.3, you get an error that the feature is not supported in that version. If you store XML documents in:

For example, if a column named xmlindexed contains data generated in Adaptive Server 12.5.4 by the xmlparse built-in function, you can regenerate the text form of the document in the xmlsource column with the following SQL statement that uses the Adaptive Server 12.5.4 xmlextract built-in function:

update xmltab 
set xmlsource = xmlextract("/", xmlindexed) 

You may then do one of the following:

If you do not want to add the xmlsource column, you can combine these steps with the following SQL statement in ASE 12.5.4:

update xmltab 
set xmlindexed 
= com.sybase.xml.xql.Xql.parse 
(xmlextract("/", xmlindexed))

Prior to execution of this update statement, the xmlindexed column contains the parsed form of the documents generated by the xmlparse 12.5.4 built-in function. After the update statement, that column contains the parsed form of the documents, generated by the com.sybase.xml.xql.Xql.parse Java-based method, suitable for processing in Adaptive Server12.5.0.3 with the com.sybase.xml.xql.Xql.query Java-based method.

A configuration parameter was added to enable XML in 12.5.4. When you first restart with the prior version, you may see error message 5859 advising you that the parameter is unknown. After running installmaster from the pre-12.5.4 version this warning should no longer appear.

Automatic database expansion

If you installed the 12.5.4 automatic database expansion procedures using installdbextend, and then applied the threshold procedure to one or more database segments, the thresholds might not work properly when applied to the log segment after a downgrade to 12.5.0.3.

To clear all auto-expansion thresholds that might exist on one or more segments before downgrading, use the command:

sp_dbextend 'clear', 'threshold' 

Alternatively, you can disable the entire automatic expansion feature server-wide without changing any existing rules or clearing any thresholds. Execute the following commands using sa_role:

use master 
go 
sp_dbextend 'disable', 'database', 'server-wide' 
go

This prevents threshold procedures from doing any work even if they were fired at runtime.

Sybase recommends that you leave all the policies and thresholds in place, and simply disable the entire feature server-wide before the downgrade. This simplifies re-enabling automatic expansion if you return to 12.5.4 later.