Quantcast
Channel: Oracle SQLOracle SQL
Viewing all articles
Browse latest Browse all 2

An interesting question from Valentin Nikotin

$
0
0

Test table:

create table tclob(c clob);

What is this code going to put out from the following blocks with and without “rollback”:

Spoiler:: Task 1 SelectShow>
Spoiler:: Task 2 SelectShow>
Spoiler:: Task 3 SelectShow>
Spoiler:: Task 4 SelectShow>

Check it both in Windows and Solaris/Linux :)

Explanation
It is clear that this bug is platform-depending and that the matter is in specifics of working with memory. The answer lies in the fact that cl3 and cl2 have unsynchronized lengths, which means that Oracle “forgets” to change the lengths of all remaining variables, that point to this “clob”, and as every operation of changing cl2/cl3 in fact changes the same thing, it turns out that “superfluous” becomes overwritten.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images