| OLD | NEW |
| 1 # 2012 January 4 {} | 1 # 2012 January 4 {} |
| 2 # | 2 # |
| 3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
| 4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
| 5 # | 5 # |
| 6 # May you do good and not evil. | 6 # May you do good and not evil. |
| 7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
| 8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
| 9 # | 9 # |
| 10 #*********************************************************************** | 10 #*********************************************************************** |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 CREATE VIRTUAL TABLE temp.types2_recover USING recover( | 272 CREATE VIRTUAL TABLE temp.types2_recover USING recover( |
| 273 types2, | 273 types2, |
| 274 id ROWID NOT NULL, | 274 id ROWID NOT NULL, |
| 275 rowtype TEXT, | 275 rowtype TEXT, |
| 276 value | 276 value |
| 277 ); | 277 ); |
| 278 } | 278 } |
| 279 execsql {SELECT rowid, id, rowtype, value, TYPEOF(value) FROM types2_recover} | 279 execsql {SELECT rowid, id, rowtype, value, TYPEOF(value) FROM types2_recover} |
| 280 } {1 1 NULL {} null 2 2 INTEGER 17 integer 3 3 FLOAT 3.1415927 real 4 4 TEXT {Th
is is text} text 5 5 BLOB {This is a blob} blob} | 280 } {1 1 NULL {} null 2 2 INTEGER 17 integer 3 3 FLOAT 3.1415927 real 4 4 TEXT {Th
is is text} text 5 5 BLOB {This is a blob} blob} |
| 281 | 281 |
| 282 # Inserting an integral value into a FLOAT can use more compact INTEGER |
| 283 # storage. |
| 284 do_test recover-types-7.0 { |
| 285 db eval { |
| 286 DROP TABLE IF EXISTS floats; |
| 287 CREATE TABLE floats (value); |
| 288 INSERT INTO floats VALUES (CAST (0 AS FLOAT)); |
| 289 INSERT INTO floats VALUES (CAST (1 AS FLOAT)); |
| 290 INSERT INTO floats VALUES (CAST (2 AS FLOAT)); |
| 291 INSERT INTO floats VALUES (1.0); |
| 292 INSERT INTO floats VALUES (2.3); |
| 293 |
| 294 DROP TABLE IF EXISTS floats_new; |
| 295 CREATE TABLE floats_new (value); |
| 296 INSERT INTO floats_new SELECT value FROM floats; |
| 297 |
| 298 DROP TABLE IF EXISTS floats_recover; |
| 299 CREATE VIRTUAL TABLE temp.floats_recover USING recover( |
| 300 floats, |
| 301 value FLOAT |
| 302 ); |
| 303 } |
| 304 execsql {SELECT rowid, value, TYPEOF(value) FROM floats_new} |
| 305 execsql {SELECT rowid, value, TYPEOF(value) FROM floats_recover} |
| 306 } {1 0.0 real 2 1.0 real 3 2.0 real 4 1.0 real 5 2.3 real} |
| 307 |
| 282 finish_test | 308 finish_test |
| OLD | NEW |