Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | file format change (CVS 122) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
b7b90237945d3577caba3a2f5595e52b |
User & Date: | drh 2000-08-02 13:47:42.000 |
Context
2000-08-03
| ||
15:09 | bug fix (CVS 123) (check-in: 4dabf5e4e6 user: drh tags: trunk) | |
2000-08-02
| ||
13:47 | file format change (CVS 122) (check-in: b7b9023794 user: drh tags: trunk) | |
12:37 | file format change (CVS 121) (check-in: 4110936f11 user: drh tags: trunk) | |
Changes
Changes to src/build.c.
︙ | |||
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - + | ** DROP TABLE ** CREATE INDEX ** DROP INDEX ** creating expressions and ID lists ** COPY ** VACUUM ** |
︙ | |||
315 316 317 318 319 320 321 322 323 324 325 326 | 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | + + + - + + + + - + + + + + + + + + + + | ** the master table because we just connected to the database, so ** the entry for this table already exists in the master table. ** We do not want to create it again. */ void sqliteEndTable(Parse *pParse, Token *pEnd){ Table *p; int h; int addVersion; /* True to insert a "file format" meta record */ if( pParse->nErr ) return; p = pParse->pNewTable; addVersion = p!=0 && pParse->db->nTable==1; /* Add the table to the in-memory representation of the database */ |
︙ | |||
436 437 438 439 440 441 442 443 444 445 446 447 448 449 | 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | + | }else{ Table *p; for(p=pParse->db->apTblHash[h]; p && p->pHash!=pTable; p=p->pHash){} if( p && p->pHash==pTable ){ p->pHash = pTable->pHash; } } pParse->db->nTable--; sqliteDeleteTable(pParse->db, pTable); } } /* ** Create a new index for an SQL table. pIndex is the name of the index ** and pTable is the name of the table that is to be indexed. Both will |
︙ |
Changes to src/main.c.
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | - + + + + + + + + + + + + + | ** ************************************************************************* ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** |
︙ | |||
79 80 81 82 83 84 85 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - + + + + + + - + - + + + + + + + + + + - - - + + + - + - - + + + + + + | /* The following program is used to initialize the internal ** structure holding the tables and indexes of the database. ** The database contains a special table named "sqlite_master" ** defined as follows: ** ** CREATE TABLE sqlite_master ( |
︙ | |||
179 180 181 182 183 184 185 186 187 188 189 190 191 192 | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | + + + | /* Open the backend database driver */ db->pBe = sqliteDbbeOpen(zFilename, (mode&0222)!=0, mode!=0, pzErrMsg); if( db->pBe==0 ){ sqliteStrRealloc(pzErrMsg); sqliteFree(db); return 0; } /* Assume file format 1 unless the database says otherwise */ db->file_format = 1; /* Attempt to read the schema */ rc = sqliteInit(db, pzErrMsg); if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ sqlite_close(db); return 0; }else{ |
︙ |
Changes to src/shell.c.
︙ | |||
20 21 22 23 24 25 26 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | - + | ** drh@hwaci.com ** http://www.hwaci.com/drh/ ** ************************************************************************* ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** |
︙ | |||
435 436 437 438 439 440 441 442 443 444 445 446 447 | 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | + - + | c = azArg[0][0]; if( c=='d' && strncmp(azArg[0], "dump", n)==0 ){ char *zErrMsg = 0; char zSql[1000]; if( nArg==1 ){ sprintf(zSql, "SELECT name, type, sql FROM sqlite_master " "WHERE type!='meta' " "ORDER BY tbl_name, type DESC, name"); sqlite_exec(db, zSql, dump_callback, p, &zErrMsg); }else{ int i; for(i=1; i<nArg && zErrMsg==0; i++){ sprintf(zSql, "SELECT name, type, sql FROM sqlite_master " |
︙ | |||
547 548 549 550 551 552 553 | 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 | - + + | char *zErrMsg = 0; char zSql[1000]; memcpy(&data, p, sizeof(data)); data.showHeader = 0; data.mode = MODE_List; if( nArg>1 ){ sprintf(zSql, "SELECT sql FROM sqlite_master " |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | - + | ** Author contact information: ** drh@hwaci.com ** http://www.hwaci.com/drh/ ** ************************************************************************* ** Internal interface definitions for SQLite. ** |
︙ | |||
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | + + + + + + + | /* ** Each database is an instance of the following structure */ struct sqlite { Dbbe *pBe; /* The backend driver */ int flags; /* Miscellanous flags */ int file_format; /* What file format version is this database? */ int nTable; /* Number of tables in the database */ void *pBusyArg; /* 1st Argument to the busy callback */ int (*xBusyCallback)(void *,const char*,int); /* The busy callback */ Table *apTblHash[N_HASH]; /* All tables of the database */ Index *apIdxHash[N_HASH]; /* All indices of the database */ }; /* ** Possible values for the sqlite.flags. */ #define SQLITE_VdbeTrace 0x00000001 #define SQLITE_Initialized 0x00000002 /* ** Current file format version */ #define SQLITE_FileFormat 2 /* ** information about each column of an SQL table is held in an instance ** of this structure. */ struct Column { char *zName; /* Name of this column */ char *zDflt; /* Default value of this column */ |
︙ |
Changes to test/index.test.
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - + - + - + - + | # drh@hwaci.com # http://www.hwaci.com/drh/ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the CREATE INDEX statement. # |
︙ | |||
133 134 135 136 137 138 139 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - + | do_test index-4.1 { execsql {CREATE TABLE test1(cnt int, power int)} for {set i 1} {$i<20} {incr i} { execsql "INSERT INTO test1 VALUES($i,[expr {int(pow(2,$i))}])" } execsql {CREATE INDEX index9 ON test1(cnt)} execsql {CREATE INDEX indext ON test1(power)} |
︙ | |||
174 175 176 177 178 179 180 | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | - + - + - + - + - + - + | execsql {SELECT power FROM test1 WHERE cnt=6} } {64} do_test index-4.12 { execsql {SELECT cnt FROM test1 WHERE power=1024} } {10} do_test index-4.13 { execsql {DROP TABLE test1} |
︙ |
Changes to test/table.test.
︙ | |||
19 20 21 22 23 24 25 | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | - + - + - + - + - + - + - + - + - + - + | # drh@hwaci.com # http://www.hwaci.com/drh/ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the CREATE TABLE statement. # |
︙ | |||
124 125 126 127 128 129 130 | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | - + | do_test table-2.1c { db close sqlite db testdb set v [catch {execsql {CREATE TABLE sqlite_master(two text)}} msg] lappend v $msg } {1 {table sqlite_master already exists}} do_test table-2.1d { |
︙ | |||
146 147 148 149 150 151 152 | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | - + - + | } {1 {there is already an index named test3}} do_test table-2.2c { execsql {DROP INDEX test3} set v [catch {execsql {CREATE TABLE test3(two text)}} msg] lappend v $msg } {0 {}} do_test table-2.2d { |
︙ | |||
180 181 182 183 184 185 186 | 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | - + | f17 text, f18 text, f19 text, f20 text )} do_test table-3.1 { execsql $big_table |
︙ | |||
202 203 204 205 206 207 208 | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | - + - + - + - + - + - + - + | db close sqlite db testdb set v [catch {execsql {CREATE TABLE Big(xyz foo)}} msg] lappend v $msg } {1 {table Big already exists}} do_test table-3.6 { execsql {DROP TABLE big} |