Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch toTypeFuncs Excluding Merge-Ins
This is equivalent to a diff from f0cf8c85 to a88b5be0
2013-10-14
| ||
19:35 | Add implementations for the toInteger() and toReal() SQL functions. (check-in: a0f7cbc0 user: drh tags: trunk) | |
10:46 | Add a new application_id for GeoPackage version 1.0. (check-in: 98ddfe45 user: drh tags: trunk) | |
2013-10-12
| ||
23:39 | Merge updates from trunk. (Closed-Leaf check-in: a88b5be0 user: mistachkin tags: toTypeFuncs) | |
20:22 | Restore the index_list pragma back to its former operation. Create a new PRAGMA stats used to access the table and index widths and heights. (check-in: f0cf8c85 user: drh tags: trunk) | |
15:12 | Fix handling of "DROP TABLE" commands when "PRAGMA defer_foreign_keys=1" is set. (check-in: 27001356 user: dan tags: trunk) | |
2013-09-24
| ||
19:07 | Merge updates from trunk. (check-in: 435ce3b3 user: mistachkin tags: toTypeFuncs) | |
Changes to Makefile.msc.
︙ | |||
27 28 29 30 31 32 33 34 35 36 37 38 39 40 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | + + + + + + + | !ENDIF # Set this non-0 to dynamically link to the MSVC runtime library. # !IFNDEF USE_CRT_DLL USE_CRT_DLL = 0 !ENDIF # Set this non-0 to generate assembly code listings for the source code # files. # !IFNDEF USE_LISTINGS USE_LISTINGS = 0 !ENDIF # Set this non-0 to attempt setting the native compiler automatically # for cross-compiling the command line tools needed during the compilation # process. # !IFNDEF XCOMPILE XCOMPILE = 0 |
︙ | |||
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 | 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 | + + + + + + + + + + + + + + | NSDKLIBPATH = $(NSDKLIBPATH:\\=\) # C compiler and options for use in building executables that # will run on the platform that is doing the build. # BCC = $(NCC) -W3 # Check if assembly code listings should be generated for the source # code files to be compiled. # !IF $(USE_LISTINGS)!=0 BCC = $(BCC) -FAcs !ENDIF # Check if the native library paths should be used when compiling # the command line tools used during the compilation process. If # so, set the necessary macro now. # !IF $(USE_NATIVE_LIBPATHS)!=0 NLTLIBPATHS = "/LIBPATH:$(NCRTLIBPATH)" "/LIBPATH:$(NSDKLIBPATH)" !ENDIF # C compiler and options for use in building executables that # will run on the target platform. (BCC and TCC are usually the # same unless your are cross-compiling.) # TCC = $(CC) -W3 -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src -fp:precise RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src # Check if assembly code listings should be generated for the source # code files to be compiled. # !IF $(USE_LISTINGS)!=0 TCC = $(TCC) -FAcs !ENDIF # When compiling the library for use in the WinRT environment, # the following compile-time options must be used as well to # disable use of Win32 APIs that are not available and to enable # use of Win32 APIs that are specific to Windows 8 and/or WinRT. # !IF $(FOR_WINRT)!=0 |
︙ | |||
1308 1309 1310 1311 1312 1313 1314 | 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 | - + | sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS) $(LTLINK) -DBUILD_sqlite -DTCLSH=2 -I$(TCLINCDIR) sqlite3_analyzer.c \ /link $(LTLINKOPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LTLIBS) $(TLIBS) clean: del /Q *.lo *.ilk *.lib *.obj *.pdb sqlite3.exe libsqlite3.lib |
︙ |
Changes to src/func.c.
︙ | |||
961 962 963 964 965 966 967 968 969 970 971 972 973 974 | 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | assert( sqlite3_value_type(argv[0])==SQLITE_NULL ); sqlite3_result_text(context, "NULL", 4, SQLITE_STATIC); break; } } } /* ** tointeger(X): If X is any value (integer, double, blob, or string) that ** can be losslessly converted into an integer, then make the conversion and ** return the result. Otherwise, return NULL. */ static void tointegerFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ assert( argc==1 ); UNUSED_PARAMETER(argc); switch( sqlite3_value_type(argv[0]) ){ case SQLITE_FLOAT: { double rVal = sqlite3_value_double(argv[0]); i64 iVal = (i64)rVal; if( rVal==(double)iVal ){ sqlite3_result_int64(context, iVal); } break; } case SQLITE_INTEGER: { sqlite3_result_int64(context, sqlite3_value_int64(argv[0])); break; } case SQLITE_BLOB: { const unsigned char *zBlob = sqlite3_value_blob(argv[0]); if( zBlob ){ int nBlob = sqlite3_value_bytes(argv[0]); if( nBlob==sizeof(i64) ){ i64 iVal; if( SQLITE_BIGENDIAN ){ int i; unsigned char *zBlobRev = contextMalloc(context, nBlob); if( !zBlobRev ) break; for(i=0; i<nBlob; i++) zBlobRev[i] = zBlob[nBlob-1-i]; memcpy(&iVal, zBlobRev, sizeof(i64)); sqlite3_free(zBlobRev); }else{ memcpy(&iVal, zBlob, sizeof(i64)); } sqlite3_result_int64(context, iVal); } } break; } case SQLITE_TEXT: { const unsigned char *zStr = sqlite3_value_text(argv[0]); if( zStr ){ int nStr = sqlite3_value_bytes(argv[0]); if( nStr && !sqlite3Isspace(zStr[0]) ){ i64 iVal; if( !sqlite3Atoi64((const char*)zStr, &iVal, nStr, SQLITE_UTF8) ){ sqlite3_result_int64(context, iVal); } } } break; } default: { assert( sqlite3_value_type(argv[0])==SQLITE_NULL ); break; } } } /* ** toreal(X): If X is any value (integer, double, blob, or string) that can ** be losslessly converted into a real number, then do so and return that ** real number. Otherwise return NULL. */ #if defined(_MSC_VER) #pragma optimize("", off) #endif static void torealFunc( sqlite3_context *context, int argc, sqlite3_value **argv ){ assert( argc==1 ); UNUSED_PARAMETER(argc); switch( sqlite3_value_type(argv[0]) ){ case SQLITE_FLOAT: { sqlite3_result_double(context, sqlite3_value_double(argv[0])); break; } case SQLITE_INTEGER: { i64 iVal = sqlite3_value_int64(argv[0]); double rVal = (double)iVal; if( iVal==(i64)rVal ){ sqlite3_result_double(context, rVal); } break; } case SQLITE_BLOB: { const unsigned char *zBlob = sqlite3_value_blob(argv[0]); if( zBlob ){ int nBlob = sqlite3_value_bytes(argv[0]); if( nBlob==sizeof(double) ){ double rVal; if( SQLITE_LITTLEENDIAN ){ int i; unsigned char *zBlobRev = contextMalloc(context, nBlob); if( !zBlobRev ) break; for(i=0; i<nBlob; i++) zBlobRev[i] = zBlob[nBlob-1-i]; memcpy(&rVal, zBlobRev, sizeof(double)); sqlite3_free(zBlobRev); }else{ memcpy(&rVal, zBlob, sizeof(double)); } sqlite3_result_double(context, rVal); } } break; } case SQLITE_TEXT: { const unsigned char *zStr = sqlite3_value_text(argv[0]); if( zStr ){ int nStr = sqlite3_value_bytes(argv[0]); if( nStr && !sqlite3Isspace(zStr[0]) && !sqlite3Isspace(zStr[nStr-1]) ){ double rVal; if( sqlite3AtoF((const char*)zStr, &rVal, nStr, SQLITE_UTF8) ){ sqlite3_result_double(context, rVal); return; } } } break; } default: { assert( sqlite3_value_type(argv[0])==SQLITE_NULL ); break; } } } #if defined(_MSC_VER) #pragma optimize("", on) #endif /* ** The unicode() function. Return the integer unicode code-point value ** for the first character of the input string. */ static void unicodeFunc( sqlite3_context *context, int argc, |
︙ | |||
1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 | 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 | + + | FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), FUNCTION(sqlite_log, 2, 0, 0, errlogFunc ), #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS FUNCTION(sqlite_compileoption_used,1, 0, 0, compileoptionusedFunc ), FUNCTION(sqlite_compileoption_get, 1, 0, 0, compileoptiongetFunc ), #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ FUNCTION(quote, 1, 0, 0, quoteFunc ), FUNCTION(tointeger, 1, 0, 0, tointegerFunc ), FUNCTION(toreal, 1, 0, 0, torealFunc ), FUNCTION(last_insert_rowid, 0, 0, 0, last_insert_rowid), FUNCTION(changes, 0, 0, 0, changes ), FUNCTION(total_changes, 0, 0, 0, total_changes ), FUNCTION(replace, 3, 0, 0, replaceFunc ), FUNCTION(zeroblob, 1, 0, 0, zeroblobFunc ), #ifdef SQLITE_SOUNDEX FUNCTION(soundex, 1, 0, 0, soundexFunc ), |
︙ |
Added test/func4.test.