Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Remove the sqlite4_get_table() API. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
ff68adaca1a45b382aad6ddf020909c6 |
User & Date: | drh 2012-04-23 12:47:08.087 |
Context
2012-04-23
| ||
14:11 | Add an xMkKey callback to the built-in collation sequence "nocase". Fix a bug in encoding text values with collation sequences into database keys. check-in: 6c9adc9acc user: dan tags: trunk | |
12:47 | Remove the sqlite4_get_table() API. check-in: ff68adaca1 user: drh tags: trunk | |
12:07 | Allow multiple NULL values in a UNIQUE index. check-in: 4dbb499c39 user: dan tags: trunk | |
Changes
Changes to main.mk.
︙ | ︙ | |||
58 59 60 61 62 63 64 | fts3_write.o func.o global.o hash.o \ icu.o insert.o kvlsm.o kvmem.o legacy.o \ main.o malloc.o math.o mem0.o mem1.o mem2.o mem3.o mem5.o \ mutex.o mutex_noop.o mutex_os2.o mutex_unix.o mutex_w32.o \ opcodes.o os.o os_os2.o os_unix.o os_win.o \ parse.o pragma.o prepare.o printf.o \ random.o resolve.o rowset.o rtree.o select.o status.o storage.o \ | | | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | fts3_write.o func.o global.o hash.o \ icu.o insert.o kvlsm.o kvmem.o legacy.o \ main.o malloc.o math.o mem0.o mem1.o mem2.o mem3.o mem5.o \ mutex.o mutex_noop.o mutex_os2.o mutex_unix.o mutex_w32.o \ opcodes.o os.o os_os2.o os_unix.o os_win.o \ parse.o pragma.o prepare.o printf.o \ random.o resolve.o rowset.o rtree.o select.o status.o storage.o \ tokenize.o trigger.o \ update.o util.o varint.o \ vdbe.o vdbeapi.o vdbeaux.o vdbecodec.o vdbecursor.o \ vdbemem.o vdbesort.o vdbetrace.o \ walker.o where.o utf.o vtab.o |
︙ | ︙ | |||
127 128 129 130 131 132 133 | $(TOP)/src/shell.c \ $(TOP)/src/sqlite.h.in \ $(TOP)/src/sqliteInt.h \ $(TOP)/src/sqliteLimit.h \ $(TOP)/src/status.c \ $(TOP)/src/storage.c \ $(TOP)/src/storage.h \ | < | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | $(TOP)/src/shell.c \ $(TOP)/src/sqlite.h.in \ $(TOP)/src/sqliteInt.h \ $(TOP)/src/sqliteLimit.h \ $(TOP)/src/status.c \ $(TOP)/src/storage.c \ $(TOP)/src/storage.h \ $(TOP)/src/tclsqlite.c \ $(TOP)/src/tokenize.c \ $(TOP)/src/trigger.c \ $(TOP)/src/utf.c \ $(TOP)/src/update.c \ $(TOP)/src/util.c \ $(TOP)/src/varint.c \ |
︙ | ︙ |
Changes to src/shell.c.
︙ | ︙ | |||
2047 2048 2049 2050 2051 2052 2053 2054 | }else if( c=='s' && strncmp(azArg[0], "stats", n)==0 && nArg>1 && nArg<3 ){ p->statsOn = booleanValue(azArg[1]); }else if( c=='t' && n>1 && strncmp(azArg[0], "tables", n)==0 && nArg<3 ){ char **azResult; | > | | > > | | | | > > > > > > > | | | > | < < | < | < < | | | > > > > > | > > > > | | > | > > > > > > | | | > | > > > | > | | < | < | | > | | 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 | }else if( c=='s' && strncmp(azArg[0], "stats", n)==0 && nArg>1 && nArg<3 ){ p->statsOn = booleanValue(azArg[1]); }else if( c=='t' && n>1 && strncmp(azArg[0], "tables", n)==0 && nArg<3 ){ sqlite4_stmt *pStmt; char **azResult; int nRow, nAlloc; char *zSql = 0; int ii; open_db(p); rc = sqlite4_prepare(p->db, "PRAGMA database_list", -1, &pStmt, 0); if( rc ) return rc; zSql = sqlite4_mprintf( "SELECT name FROM sqlite_master" " WHERE type IN ('table','view')" " AND name NOT LIKE 'sqlite_%%'" " AND name LIKE ?1"); while( sqlite4_step(pStmt)==SQLITE_ROW ){ const char *zDbName = (const char*)sqlite4_column_text(pStmt, 1); if( zDbName==0 || strcmp(zDbName,"main")==0 ) continue; if( strcmp(zDbName,"temp")==0 ){ zSql = sqlite4_mprintf( "%z UNION ALL " "SELECT 'temp.' || name FROM sqlite_temp_master" " WHERE type IN ('table','view')" " AND name NOT LIKE 'sqlite_%%'" " AND name LIKE ?1", zSql); }else{ zSql = sqlite4_mprintf( "%z UNION ALL " "SELECT '%q.' || name FROM \"%w\".sqlite_master" " WHERE type IN ('table','view')" " AND name NOT LIKE 'sqlite_%%'" " AND name LIKE ?1", zSql, zDbName, zDbName); } } sqlite4_finalize(pStmt); zSql = sqlite4_mprintf("%z ORDER BY 1", zSql); rc = sqlite4_prepare(p->db, zSql, -1, &pStmt, 0); sqlite4_free(zSql); if( rc ) return rc; nRow = nAlloc = 0; azResult = 0; if( nArg>1 ){ sqlite4_bind_text(pStmt, 1, azArg[1], -1, SQLITE_TRANSIENT); }else{ sqlite4_bind_text(pStmt, 1, "%", -1, SQLITE_STATIC); } while( sqlite4_step(pStmt)==SQLITE_ROW ){ if( nRow>=nAlloc ){ char **azNew; int n = nAlloc*2 + 10; azNew = sqlite4_realloc(azResult, sizeof(azResult[0])*n); if( azNew==0 ){ fprintf(stderr, "Error: out of memory\n"); break; } nAlloc = n; azResult = azNew; } azResult[nRow] = sqlite4_mprintf("%s", sqlite4_column_text(pStmt, 0)); if( azResult[nRow] ) nRow++; } sqlite4_finalize(pStmt); if( nRow>0 ){ int len, maxlen = 0; int i, j; int nPrintCol, nPrintRow; for(i=0; i<nRow; i++){ len = strlen30(azResult[i]); if( len>maxlen ) maxlen = len; } nPrintCol = 80/(maxlen+2); if( nPrintCol<1 ) nPrintCol = 1; nPrintRow = (nRow + nPrintCol - 1)/nPrintCol; for(i=0; i<nPrintRow; i++){ for(j=i; j<nRow; j+=nPrintRow){ char *zSp = j<nPrintRow ? "" : " "; printf("%s%-*s", zSp, maxlen, azResult[j] ? azResult[j] : ""); } printf("\n"); } } for(ii=0; ii<nRow; ii++) sqlite4_free(azResult[ii]); sqlite4_free(azResult); }else if( c=='t' && n>=8 && strncmp(azArg[0], "testctrl", n)==0 && nArg>=2 ){ static const struct { const char *zCtrlName; /* Name of a test-control option */ int ctrlCode; /* Integer code for that option */ } aCtrl[] = { |
︙ | ︙ |
Changes to src/sqlite.h.in.
︙ | ︙ | |||
1708 1709 1710 1711 1712 1713 1714 | ** ** The input to [sqlite4_complete16()] must be a zero-terminated ** UTF-16 string in native byte order. */ int sqlite4_complete(const char *sql); int sqlite4_complete16(const void *sql); | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 | ** ** The input to [sqlite4_complete16()] must be a zero-terminated ** UTF-16 string in native byte order. */ int sqlite4_complete(const char *sql); int sqlite4_complete16(const void *sql); /* ** CAPI3REF: Formatted String Printing Functions ** ** These routines are work-alikes of the "printf()" family of functions ** from the standard C library. ** |
︙ | ︙ | |||
2198 2199 2200 2201 2202 2203 2204 | void(*xProfile)(void*,const char*,sqlite4_uint64), void*); /* ** CAPI3REF: Query Progress Callbacks ** ** ^The sqlite4_progress_handler(D,N,X,P) interface causes the callback ** function X to be invoked periodically during long running calls to | | | 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 | void(*xProfile)(void*,const char*,sqlite4_uint64), void*); /* ** CAPI3REF: Query Progress Callbacks ** ** ^The sqlite4_progress_handler(D,N,X,P) interface causes the callback ** function X to be invoked periodically during long running calls to ** [sqlite4_exec()] and [sqlite4_step()] for ** database connection D. An example use for this ** interface is to keep a GUI updated during a large query. ** ** ^The parameter P is passed through as the only parameter to the ** callback function X. ^The parameter N is the number of ** [virtual machine instructions] that are evaluated between successive ** invocations of the callback X. |
︙ | ︙ |
Changes to src/test1.c.
︙ | ︙ | |||
563 564 565 566 567 568 569 | if( n>sizeof(zStr) ) n = sizeof(zStr); sqlite4_snprintf(sizeof(zStr), zStr, "abcdefghijklmnopqrstuvwxyz"); sqlite4_snprintf(n, zStr, zFormat, a1); Tcl_AppendResult(interp, zStr, 0); return TCL_OK; } | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 563 564 565 566 567 568 569 570 571 572 573 574 575 576 | if( n>sizeof(zStr) ) n = sizeof(zStr); sqlite4_snprintf(sizeof(zStr), zStr, "abcdefghijklmnopqrstuvwxyz"); sqlite4_snprintf(n, zStr, zFormat, a1); Tcl_AppendResult(interp, zStr, 0); return TCL_OK; } /* ** Usage: sqlite4_last_insert_rowid DB ** ** Returns the integer ROWID of the most recent insert. */ |
︙ | ︙ | |||
4913 4914 4915 4916 4917 4918 4919 | { "sqlite4_mprintf_n_test", (Tcl_CmdProc*)test_mprintf_n }, { "sqlite4_snprintf_int", (Tcl_CmdProc*)test_snprintf_int }, { "sqlite4_last_insert_rowid", (Tcl_CmdProc*)test_last_rowid }, { "sqlite4_exec_printf", (Tcl_CmdProc*)test_exec_printf }, { "sqlite4_exec_hex", (Tcl_CmdProc*)test_exec_hex }, { "sqlite4_exec", (Tcl_CmdProc*)test_exec }, { "sqlite4_exec_nr", (Tcl_CmdProc*)test_exec_nr }, | < < < | 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 | { "sqlite4_mprintf_n_test", (Tcl_CmdProc*)test_mprintf_n }, { "sqlite4_snprintf_int", (Tcl_CmdProc*)test_snprintf_int }, { "sqlite4_last_insert_rowid", (Tcl_CmdProc*)test_last_rowid }, { "sqlite4_exec_printf", (Tcl_CmdProc*)test_exec_printf }, { "sqlite4_exec_hex", (Tcl_CmdProc*)test_exec_hex }, { "sqlite4_exec", (Tcl_CmdProc*)test_exec }, { "sqlite4_exec_nr", (Tcl_CmdProc*)test_exec_nr }, { "sqlite4_close", (Tcl_CmdProc*)sqlite_test_close }, { "sqlite4_create_function", (Tcl_CmdProc*)test_create_function }, { "sqlite4_create_aggregate", (Tcl_CmdProc*)test_create_aggregate }, { "sqlite_register_test_function", (Tcl_CmdProc*)test_register_func }, { "sqlite_abort", (Tcl_CmdProc*)sqlite_abort }, { "sqlite_bind", (Tcl_CmdProc*)test_bind }, { "breakpoint", (Tcl_CmdProc*)test_breakpoint }, |
︙ | ︙ |