System.Data.SQLite
Check-in [917fbb8c4d]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Changes due to 3.3.4
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: 917fbb8c4dcfd76f812d08525bf40b9d666080f2
User & Date: rmsimpson 2006-02-10 19:44:42
Context
2006-02-10
19:45
Pre 3.3.4 interim updates check-in: e3ded2c8dc user: rmsimpson tags: sourceforge
19:44
Changes due to 3.3.4 check-in: 917fbb8c4d user: rmsimpson tags: sourceforge
19:44
Lots of schema fixes and support for new 3.3.4 stuff check-in: 9e6e1cf6df user: rmsimpson tags: sourceforge
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SQLite.Interop/SQLite.Interop.vcproj.

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
..
73
74
75
76
77
78
79


80
81
82
83
84
85
86
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
...
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
...
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
...
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
...
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
...
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
...
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
...
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
...
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="3"
				FavorSizeOrSpeed="1"
				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;SQLITE_HAS_CODEC"
				StringPooling="true"
				ExceptionHandling="0"
				RuntimeLibrary="2"
				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"
				FloatingPointModel="2"
				RuntimeTypeInfo="false"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
................................................................................
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="advapi32.lib $(NOINHERIT)"
				OutputFile="../bin/System.Data.SQLite.DLL"


				ModuleDefinitionFile="src\sqlite3.def"
				EmbedManagedResourceFile=""
				DelayLoadDLLs="advapi32.dll"
				OptimizeForWindows98="1"
				ImportLibrary=""
				TargetMachine="1"
				KeyFile=""
................................................................................
		</Configuration>
		<Configuration
			Name="Release|Pocket PC 2003 (ARMV4)"
			OutputDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
			IntermediateDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
			ConfigurationType="2"
			CharacterSet="1"
			WholeProgramOptimization="0"
			>
			<Tool
				Name="VCPreBuildEventTool"
				Description="Preparing build ..."
				CommandLine="CScript //nologo fixsource.vbs&#x0D;&#x0A;"
			/>
			<Tool
................................................................................
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				ExecutionBucket="7"
				AdditionalOptions="/GS-"
				Optimization="1"
				PreprocessorDefinitions="_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_WINDOWS;_USRDLL;CPPSMART_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);UNICODE;_UNICODE;SQLITE_HAS_CODEC"
				StringPooling="true"
				ExceptionHandling="0"
				RuntimeLibrary="2"
				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
................................................................................
			<Tool
				Name="VCMIDLTool"
				TargetEnvironment="2"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="3"
				FavorSizeOrSpeed="1"
				PreprocessorDefinitions="NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;WIN64;SQLITE_HAS_CODEC"
				StringPooling="true"
				ExceptionHandling="0"
				RuntimeLibrary="2"
				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"
				FloatingPointModel="2"
				RuntimeTypeInfo="false"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
................................................................................
			<Tool
				Name="VCMIDLTool"
				TargetEnvironment="3"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="3"
				FavorSizeOrSpeed="1"
				PreprocessorDefinitions="NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;WIN64;SQLITE_HAS_CODEC"
				StringPooling="true"
				ExceptionHandling="0"
				RuntimeLibrary="2"
				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"
				FloatingPointModel="2"
				RuntimeTypeInfo="false"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
................................................................................
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;SQLITE_HAS_CODEC"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
................................................................................
			/>
			<Tool
				Name="VCCLCompilerTool"
				ExecutionBucket="7"
				AdditionalOptions="/GS-"
				Optimization="0"
				FavorSizeOrSpeed="0"
				PreprocessorDefinitions="_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_WINDOWS;_USRDLL;CPPSMART_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);UNICODE;_UNICODE;SQLITE_HAS_CODEC"
				RuntimeLibrary="3"
				EnableFunctionLevelLinking="true"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
................................................................................
				Name="VCMIDLTool"
				TargetEnvironment="2"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;WIN64;SQLITE_HAS_CODEC"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
................................................................................
				Name="VCMIDLTool"
				TargetEnvironment="3"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;WIN64;SQLITE_HAS_CODEC"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
................................................................................
				>
			</File>
			<File
				RelativePath=".\src\select.c"
				>
				<FileConfiguration
					Name="Release|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Pocket PC 2003 (ARMV4)"
................................................................................
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"
					ExcludedFromBuild="true"
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"







|

|


<







 







>
>







 







|







 







|


<







 







|

|


<







 







|

|


<







 







|







 







|







 







|







 







|







 







<







 







<







49
50
51
52
53
54
55
56
57
58
59
60

61
62
63
64
65
66
67
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
...
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
...
140
141
142
143
144
145
146
147
148
149

150
151
152
153
154
155
156
...
227
228
229
230
231
232
233
234
235
236
237
238

239
240
241
242
243
244
245
...
316
317
318
319
320
321
322
323
324
325
326
327

328
329
330
331
332
333
334
...
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
...
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
...
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
...
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
...
888
889
890
891
892
893
894

895
896
897
898
899
900
901
...
919
920
921
922
923
924
925

926
927
928
929
930
931
932
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="2"
				FavorSizeOrSpeed="1"
				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA"
				StringPooling="true"
				ExceptionHandling="0"

				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"
				FloatingPointModel="2"
				RuntimeTypeInfo="false"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
................................................................................
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="advapi32.lib $(NOINHERIT)"
				OutputFile="../bin/System.Data.SQLite.DLL"
				GenerateManifest="false"
				IgnoreDefaultLibraryNames=""
				ModuleDefinitionFile="src\sqlite3.def"
				EmbedManagedResourceFile=""
				DelayLoadDLLs="advapi32.dll"
				OptimizeForWindows98="1"
				ImportLibrary=""
				TargetMachine="1"
				KeyFile=""
................................................................................
		</Configuration>
		<Configuration
			Name="Release|Pocket PC 2003 (ARMV4)"
			OutputDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
			IntermediateDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
			ConfigurationType="2"
			CharacterSet="1"
			WholeProgramOptimization="1"
			>
			<Tool
				Name="VCPreBuildEventTool"
				Description="Preparing build ..."
				CommandLine="CScript //nologo fixsource.vbs&#x0D;&#x0A;"
			/>
			<Tool
................................................................................
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				ExecutionBucket="7"
				AdditionalOptions="/GS-"
				Optimization="1"
				PreprocessorDefinitions="_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);NDEBUG;_WINDOWS;_USRDLL;CPPSMART_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);UNICODE;_UNICODE;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA"
				StringPooling="true"
				ExceptionHandling="0"

				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
................................................................................
			<Tool
				Name="VCMIDLTool"
				TargetEnvironment="2"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="2"
				FavorSizeOrSpeed="1"
				PreprocessorDefinitions="NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;WIN64;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA"
				StringPooling="true"
				ExceptionHandling="0"

				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"
				FloatingPointModel="2"
				RuntimeTypeInfo="false"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
................................................................................
			<Tool
				Name="VCMIDLTool"
				TargetEnvironment="3"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="2"
				FavorSizeOrSpeed="1"
				PreprocessorDefinitions="NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;WIN64;SQLITE_HAS_CODEC;;SQLITE_ENABLE_COLUMN_METADATA"
				StringPooling="true"
				ExceptionHandling="0"

				BufferSecurityCheck="false"
				EnableFunctionLevelLinking="true"
				FloatingPointModel="2"
				RuntimeTypeInfo="false"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
................................................................................
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
................................................................................
			/>
			<Tool
				Name="VCCLCompilerTool"
				ExecutionBucket="7"
				AdditionalOptions="/GS-"
				Optimization="0"
				FavorSizeOrSpeed="0"
				PreprocessorDefinitions="_WIN32_WCE=$(CEVER);UNDER_CE=$(CEVER);WINCE;$(PLATFORMDEFINES);_DEBUG;_WINDOWS;_USRDLL;CPPSMART_EXPORTS;$(ARCHFAM);$(_ARCHFAM_);UNICODE;_UNICODE;SQLITE_HAS_CODEC;;SQLITE_ENABLE_COLUMN_METADATA"
				RuntimeLibrary="3"
				EnableFunctionLevelLinking="true"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
................................................................................
				Name="VCMIDLTool"
				TargetEnvironment="2"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;WIN64;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
................................................................................
				Name="VCMIDLTool"
				TargetEnvironment="3"
			/>
			<Tool
				Name="VCCLCompilerTool"
				AdditionalOptions="/GS-"
				Optimization="0"
				PreprocessorDefinitions="_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NO_TCL;THREADSAFE;WIN64;SQLITE_HAS_CODEC;SQLITE_ENABLE_COLUMN_METADATA"
				RuntimeLibrary="3"
				RuntimeTypeInfo="false"
				DebugInformationFormat="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
................................................................................
				>
			</File>
			<File
				RelativePath=".\src\select.c"
				>
				<FileConfiguration
					Name="Release|Win32"

					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Pocket PC 2003 (ARMV4)"
................................................................................
					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Win32"

					>
					<Tool
						Name="VCCLCompilerTool"
					/>
				</FileConfiguration>
				<FileConfiguration
					Name="Debug|Pocket PC 2003 (ARMV4)"

Changes to SQLite.Interop/fixsource.vbs.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  
  Dim srcFile
  Dim srcFileContents
  dim newFileContents
  
  ' Changes the name of the function so we can get first crack at it in interop.h to provide GetSchemaTable() support
  '
  Set srcFile = fso.OpenTextFile("src\select.c", 1) 
  srcFileContents = srcFile.ReadAll()
  srcFile.Close()  
  newFileContents = Replace(srcFileContents, "static void generateColumnNames(", "static void _generateColumnNames(")
  If (newFileContents <> srcFileContents) Then
    WScript.StdOut.WriteLine "Updating select.c"
    Set srcFile = fso.CreateTextFile("src\select.c", true)
    srcFile.Write(newFileContents)
    srcFile.Close()
  End If

  ' SQLite supports : and $ for named parameters, but we add support for @ as well here
  '  
  ' Set srcFile = fso.OpenTextFile("src\tokenize.c", 1)  
  ' srcFileContents = srcFile.ReadAll()
  ' srcFile.Close()
  ' If InStr(1, srcFileContents, "    case '@':", 1) = 0 Then







|
|
|
|
|
|
|
|
|
|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  
  Dim srcFile
  Dim srcFileContents
  dim newFileContents
  
  ' Changes the name of the function so we can get first crack at it in interop.h to provide GetSchemaTable() support
  '
  ' Set srcFile = fso.OpenTextFile("src\select.c", 1) 
  ' srcFileContents = srcFile.ReadAll()
  ' srcFile.Close()  
  ' newFileContents = Replace(srcFileContents, "static void generateColumnNames(", "static void _generateColumnNames(")
  ' If (newFileContents <> srcFileContents) Then
  '   WScript.StdOut.WriteLine "Updating select.c"
  '   Set srcFile = fso.CreateTextFile("src\select.c", true)
  '   srcFile.Write(newFileContents)
  '   srcFile.Close()
  ' End If

  ' SQLite supports : and $ for named parameters, but we add support for @ as well here
  '  
  ' Set srcFile = fso.OpenTextFile("src\tokenize.c", 1)  
  ' srcFileContents = srcFile.ReadAll()
  ' srcFile.Close()
  ' If InStr(1, srcFileContents, "    case '@':", 1) = 0 Then

Changes to SQLite.Interop/interop.c.

13
14
15
16
17
18
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
116
117
118
119
120


121
122

123
124
125
126
127
128
129
...
758
759
760
761
762
763
764
765
766



















































767
768
769
770

771
772
773
#if _WIN32_WCE
#include "merge.h"
#else
#include "merge_full.h"
#endif // _WIN32_WCE
#endif // NDEBUG

// Forward declare this function, we're implementing it later
static void generateColumnNames(
  Parse *pParse,      /* Parser context */
  SrcList *pTabList,  /* List of tables */
  ExprList *pEList    /* Expressions defining the result set */
);


#include "src\select.c"

/*

** Generate code that will tell the VDBE the names of columns
** in the result set.  This information is used to provide the
** azCol[] values in the callback.
*/
static void generateColumnNames(
  Parse *pParse,      /* Parser context */
  SrcList *pTabList,  /* List of tables */
  ExprList *pEList    /* Expressions defining the result set */
){
  Vdbe *v = pParse->pVdbe;
  int i, j;
  sqlite3 *db = pParse->db;
  int fullNames, shortNames;
  int realNames;                                     /*** ADDED - SQLite.Interop ***/


  realNames = (db->flags & 0x01000000)!=0;           /*** ADDED - SQLite.Interop ***/
  if (!realNames) // Default to normal Sqlite3       /*** ADDED - SQLite.Interop ***/
  {                                                  /*** ADDED - SQLite.Interop ***/
    _generateColumnNames(pParse, pTabList, pEList);  /*** ADDED - SQLite.Interop ***/
    return;                                          /*** ADDED - SQLite.Interop ***/
  }                                                  /*** ADDED - SQLite.Interop ***/


#ifndef SQLITE_OMIT_EXPLAIN
  /* If this is an EXPLAIN, skip this step */
  if( pParse->explain ){
    return;
  }

#endif


  assert( v!=0 );
  if( pParse->colNamesSet || v==0 || sqlite3MallocFailed() ) return;
  pParse->colNamesSet = 1;
  fullNames = (db->flags & SQLITE_FullColNames)!=0;
  shortNames = (db->flags & SQLITE_ShortColNames)!=0;
  if (realNames) fullNames = 1;                      /*** ADDED - SQLite.Interop ***/


  sqlite3VdbeSetNumCols(v, pEList->nExpr);
  for(i=0; i<pEList->nExpr; i++){
    Expr *p;
    p = pEList->a[i].pExpr;
    if( p==0 ) continue;
    if( pEList->a[i].zName && (realNames == 0 || p->op != TK_COLUMN)){   /*** CHANGED - SQLite.Interop ***/
      char *zName = pEList->a[i].zName;
      sqlite3VdbeSetColName(v, i, zName, strlen(zName));
      continue;
    }

    if( p->op==TK_COLUMN && pTabList ){
      Table *pTab;
      char *zCol;
      int iCol = p->iColumn;
      for(j=0; j<pTabList->nSrc && pTabList->a[j].iCursor!=p->iTable; j++){}
      assert( j<pTabList->nSrc );
      pTab = pTabList->a[j].pTab;
      if( iCol<0 ) iCol = pTab->iPKey;
      assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
      if( iCol<0 ){
        zCol = "rowid";
      }else{
        zCol = pTab->aCol[iCol].zName;
      }

      if( !shortNames && !fullNames && p->span.z && p->span.z[0] ){
        sqlite3VdbeSetColName(v, i, (char*)p->span.z, p->span.n);
      }else if( fullNames || (!shortNames && pTabList->nSrc>1) ){
        char *zName = 0;
        char *zTab;
        char *zDb = 0;                                                          /*** ADDED - SQLite.Interop ***/
        int iDb;


        iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);


        zTab = pTabList->a[j].zAlias;
        if( fullNames || zTab==0 ){
          if (iDb > 1) zDb = db->aDb[iDb].zName;                    /*** ADDED - SQLite.Interop ***/
          zTab = pTab->zName;
        }

        if (!zDb || !realNames) sqlite3SetString(&zName, zTab, "\x01", zCol, 0);   /*** CHANGED - SQLite.Interop ***/
        else sqlite3SetString(&zName, zDb, "\x01", zTab, "\x01", zCol, 0);            /*** ADDED - SQLite.Interop ***/
        sqlite3VdbeSetColName(v, i, zName, P3_DYNAMIC);
      }else{
        sqlite3VdbeSetColName(v, i, zCol, strlen(zCol));
      }

    }else if( p->span.z && p->span.z[0] ){
      sqlite3VdbeSetColName(v, i, (char*)p->span.z, p->span.n);
      /* sqlite3VdbeCompressSpace(v, addr); */
    }else{
      char zName[30];
      assert( p->op!=TK_COLUMN || pTabList==0 );
      sprintf(zName, "column%d", i+1);
      sqlite3VdbeSetColName(v, i, zName, 0);
    }
  }


  generateColumnTypes(pParse, pTabList, pEList);
}


#ifdef OS_WIN

#include <tchar.h>

typedef void (__stdcall *SQLITEUSERFUNC)(void *, int, void **);
typedef int  (__stdcall *SQLITECOLLATION)(int, const void *, int, const void*);
................................................................................
}

__declspec(dllexport) void __stdcall sqlite3_result_text16_interop(sqlite3_context *ctx, const void *pv, int n, void(*cb)(void *))
{
  sqlite3_result_text16(ctx, pv, n, cb);
}

__declspec(dllexport) void __stdcall sqlite3_realcolnames(sqlite3 *db, int bOn)
{



















































  if (bOn)
    db->flags |= 0x01000000;
  else
    db->flags &= (~0x01000000);

}

#endif // OS_WIN







|
|
|
|
|
|
<
>
|
<
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
>
|
|
|
|
|
|
<
>
|
|
|
|
<
>
|
<
>
|
|
|
|
|
|
<
>
|
|
|
|
|
|
|
|
|
<
>
|
|
|
|
|
|
|
|
|
|
|
|
|
<
>
|
|
|
|
|
|
|
<
>
|
<
>
|
|
|
|
<
>
|
|
|
|
|
<
>
|
|
|
|
|
|
|
|
<
<
>
>
|
<
>







 







|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
|
<

13
14
15
16
17
18
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
116
117
118


119
120
121

122
123
124
125
126
127
128
129
...
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823

824
#if _WIN32_WCE
#include "merge.h"
#else
#include "merge_full.h"
#endif // _WIN32_WCE
#endif // NDEBUG

//// Forward declare this function, we're implementing it later
//static void generateColumnNames(
//  Parse *pParse,      /* Parser context */
//  SrcList *pTabList,  /* List of tables */
//  ExprList *pEList    /* Expressions defining the result set */
//);

//
//#include "src\select.c"

//
///*
//** Generate code that will tell the VDBE the names of columns
//** in the result set.  This information is used to provide the
//** azCol[] values in the callback.
//*/
//static void generateColumnNames(
//  Parse *pParse,      /* Parser context */
//  SrcList *pTabList,  /* List of tables */
//  ExprList *pEList    /* Expressions defining the result set */
//){
//  Vdbe *v = pParse->pVdbe;
//  int i, j;
//  sqlite3 *db = pParse->db;
//  int fullNames, shortNames;
//  int realNames;                                     /*** ADDED - SQLite.Interop ***/

//
//  realNames = (db->flags & 0x01000000)!=0;           /*** ADDED - SQLite.Interop ***/
//  if (!realNames) // Default to normal Sqlite3       /*** ADDED - SQLite.Interop ***/
//  {                                                  /*** ADDED - SQLite.Interop ***/
//    _generateColumnNames(pParse, pTabList, pEList);  /*** ADDED - SQLite.Interop ***/
//    return;                                          /*** ADDED - SQLite.Interop ***/
//  }                                                  /*** ADDED - SQLite.Interop ***/

//
//#ifndef SQLITE_OMIT_EXPLAIN
//  /* If this is an EXPLAIN, skip this step */
//  if( pParse->explain ){
//    return;

//  }
//#endif

//
//  assert( v!=0 );
//  if( pParse->colNamesSet || v==0 || sqlite3MallocFailed() ) return;
//  pParse->colNamesSet = 1;
//  fullNames = (db->flags & SQLITE_FullColNames)!=0;
//  shortNames = (db->flags & SQLITE_ShortColNames)!=0;
//  if (realNames) fullNames = 1;                      /*** ADDED - SQLite.Interop ***/

//
//  sqlite3VdbeSetNumCols(v, pEList->nExpr);
//  for(i=0; i<pEList->nExpr; i++){
//    Expr *p;
//    p = pEList->a[i].pExpr;
//    if( p==0 ) continue;
//    if( pEList->a[i].zName && (realNames == 0 || p->op != TK_COLUMN)){   /*** CHANGED - SQLite.Interop ***/
//      char *zName = pEList->a[i].zName;
//      sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, strlen(zName));
//      continue;

//    }
//    if( p->op==TK_COLUMN && pTabList ){
//      Table *pTab;
//      char *zCol;
//      int iCol = p->iColumn;
//      for(j=0; j<pTabList->nSrc && pTabList->a[j].iCursor!=p->iTable; j++){}
//      assert( j<pTabList->nSrc );
//      pTab = pTabList->a[j].pTab;
//      if( iCol<0 ) iCol = pTab->iPKey;
//      assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
//      if( iCol<0 ){
//        zCol = "rowid";
//      }else{
//        zCol = pTab->aCol[iCol].zName;

//      }
//      if( !shortNames && !fullNames && p->span.z && p->span.z[0] ){
//        sqlite3VdbeSetColName(v, i, COLNAME_NAME, (char*)p->span.z, p->span.n);
//      }else if( fullNames || (!shortNames && pTabList->nSrc>1) ){
//        char *zName = 0;
//        char *zTab;
//        char *zDb = 0;                                                          /*** ADDED - SQLite.Interop ***/
//        int iDb;

//
//        iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);

//
//        zTab = pTabList->a[j].zAlias;
//        if( fullNames || zTab==0 ){
//          if (iDb > 1) zDb = db->aDb[iDb].zName;                    /*** ADDED - SQLite.Interop ***/
//          zTab = pTab->zName;

//        }
//        if (!zDb || !realNames) sqlite3SetString(&zName, zTab, "\x01", zCol, 0);   /*** CHANGED - SQLite.Interop ***/
//        else sqlite3SetString(&zName, zDb, "\x01", zTab, "\x01", zCol, 0);            /*** ADDED - SQLite.Interop ***/
//        sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, P3_DYNAMIC);
//      }else{
//        sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, strlen(zCol));

//      }
//    }else if( p->span.z && p->span.z[0] ){
//      sqlite3VdbeSetColName(v, i, COLNAME_NAME, (char*)p->span.z, p->span.n);
//      /* sqlite3VdbeCompressSpace(v, addr); */
//    }else{
//      char zName[30];
//      assert( p->op!=TK_COLUMN || pTabList==0 );
//      sprintf(zName, "column%d", i+1);
//      sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, 0);


//    }
//  }
//  generateColumnTypes(pParse, pTabList, pEList);

//}

#ifdef OS_WIN

#include <tchar.h>

typedef void (__stdcall *SQLITEUSERFUNC)(void *, int, void **);
typedef int  (__stdcall *SQLITECOLLATION)(int, const void *, int, const void*);
................................................................................
}

__declspec(dllexport) void __stdcall sqlite3_result_text16_interop(sqlite3_context *ctx, const void *pv, int n, void(*cb)(void *))
{
  sqlite3_result_text16(ctx, pv, n, cb);
}

__declspec(dllexport) const char * __stdcall sqlite3_column_database_name_interop(sqlite3_stmt *stmt, int iCol, int *plen)
{
  const char *pval = sqlite3_column_database_name(stmt, iCol);
  *plen = (pval != 0) ? strlen(pval) : 0;
  return pval;
}

__declspec(dllexport) const void * __stdcall sqlite3_column_databsae_name16_interop(sqlite3_stmt *stmt, int iCol, int *plen)
{
  const void *pval = sqlite3_column_database_name16(stmt, iCol);
  *plen = (pval != 0) ? wcslen((wchar_t *)pval) * sizeof(wchar_t) : 0;
  return pval;
}

__declspec(dllexport) const char * __stdcall sqlite3_column_table_name_interop(sqlite3_stmt *stmt, int iCol, int *plen)
{
  const char *pval = sqlite3_column_table_name(stmt, iCol);
  *plen = (pval != 0) ? strlen(pval) : 0;
  return pval;
}

__declspec(dllexport) const void * __stdcall sqlite3_column_table_name16_interop(sqlite3_stmt *stmt, int iCol, int *plen)
{
  const void *pval = sqlite3_column_table_name16(stmt, iCol);
  *plen = (pval != 0) ? wcslen((wchar_t *)pval) * sizeof(wchar_t) : 0;
  return pval;
}

__declspec(dllexport) const char * __stdcall sqlite3_column_origin_name_interop(sqlite3_stmt *stmt, int iCol, int *plen)
{
  const char *pval = sqlite3_column_origin_name(stmt, iCol);
  *plen = (pval != 0) ? strlen(pval) : 0;
  return pval;
}

__declspec(dllexport) const void * __stdcall sqlite3_column_origin_name16_interop(sqlite3_stmt *stmt, int iCol, int *plen)
{
  const void *pval = sqlite3_column_origin_name16(stmt, iCol);
  *plen = (pval != 0) ? wcslen((wchar_t *)pval) * sizeof(wchar_t) : 0;
  return pval;
}

__declspec(dllexport) int sqlite3_table_column_metadata_interop(sqlite3 *db, const char *zDbName, const char *zTableName, const char *zColumnName, char **pzDataType, char **pzCollSeq, int *pNotNull, int *pPrimaryKey, int *pAutoinc, int *pdtLen, int *pcsLen)
{
  int n = sqlite3_table_column_metadata(db, zDbName, zTableName, zColumnName, pzDataType, pzCollSeq, pNotNull, pPrimaryKey, pAutoinc);
  *pdtLen = (*pzDataType != 0) ? strlen(*pzDataType) : 0;
  *pcsLen = (*pzCollSeq != 0) ? strlen(*pzCollSeq) : 0;

  return n;
}

//__declspec(dllexport) void __stdcall sqlite3_realcolnames(sqlite3 *db, int bOn)
//{
//  if (bOn)
//    db->flags |= 0x01000000;
//  else
//    db->flags &= (~0x01000000);
//}


#endif // OS_WIN