SQL/MP Version Management Guide

Version Compatibility for SQL Programs
Compaq NonStop™ SQL/MP Version Management Guide429833-001
7-11
Migrating to a Newer Version
Migrating to a Newer Version
You do not need to recompile an existing SQL program to continue running it on a node
on which the SQL/MP software is upgraded to a newer version. If you do not recompile
the program, the program executes in the same way it did under the older version
software. However, if you do recompile the program, the way in which it is recompiled
can affect the way it executes.
Explicit and Automatic Recompilation
When you recompile a program by running the SQL compiler with a program as an
input, the type of recompilation that takes place is called explicit recompilation. After an
explicit recompilation, the format version of the recompiled program matches the
version of the compiler you are using.
For example, if a program with a format version (PFV) of 2 is recompiled by a version
315 SQL compiler, its PFV is raised to 315. The program then must be executed by a
version 315 or newer executor. If the software on the node where the program is
compiled is subsequently downgraded to an older version, the program can no longer be
executed.
When the SQL compiler recompiles a program or part of a program during execution of
the program, the type of recompilation that takes place is called automatic
recompilation. Automatic recompilation does not change the format version or catalog
version of the recompiled program, because the recompiled object is not stored on disk.
When a program is automatically recompiled, it still can be executed by an older version
SQL executor.
Both kinds of recompilation (explicit and automatic) are performed by the SQL
compiler on the node where the program being recompiled is running.
Upgrading an SQL Compiler by Upgrading a Node
If the SQL/MP software on a node is upgraded to a newer version after an SQL program
is compiled, the version of the SQL compiler on the same node is also upgraded. As a
result, the version of the SQL compiler on the node is newer than the version of the SQL
compiler that originally compiled the program. When this situation occurs, execution is
affected in these ways:
Recompilation of a version 2 program by a version 300 or newer SQL compiler does
not cause the operation of the program to change unless the source program uses
new reserved words in column definitions.
Query execution plans might differ, as described under Effect of Newer Version on
Query Execution Plans on page 7-12.
Recompilation of a version 1 program by a version 300 or newer compiler does not
cause the operation of the program to change unless the source program includes the
following:
°
Reserved words in column definitions
°
Null values in table columns
°
Queries against changed catalog tables