System.Data.SQLite
Check-in [84bfdb3d6b]
Not logged in

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

Overview
Comment:Fixed Indexes and IndexColumns schema to properly filter by specified index
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: 84bfdb3d6bb40f3368cef7735dc9b7e495216c94
User & Date: rmsimpson 2006-05-17 15:40:33
Context
2006-05-19
13:57
Tentative DataDirectory support check-in: f011ea6e60 user: rmsimpson tags: sourceforge
2006-05-17
15:40
Fixed Indexes and IndexColumns schema to properly filter by specified index check-in: 84bfdb3d6b user: rmsimpson tags: sourceforge
2006-05-16
15:09
1.0.29.0 check-in: 215bbdba11 user: rmsimpson tags: sourceforge
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLiteConnection.cs.

1168
1169
1170
1171
1172
1173
1174



1175


1176
1177
1178
1179
1180
1181
1182
....
1504
1505
1506
1507
1508
1509
1510

1511
1512
1513
1514
1515
1516
1517
1518
                  row["TABLE_CATALOG"] = strCatalog;
                  row["TABLE_NAME"] = rdTables.GetString(2);
                  row["INDEX_CATALOG"] = strCatalog;
                  row["PRIMARY_KEY"] = true;
                  row["INDEX_NAME"] = String.Format(CultureInfo.InvariantCulture, "sqlite_master_PK_{0}", rdTables.GetString(2));
                  row["UNIQUE"] = true;




                  tbl.Rows.Add(row);


                  primaryKeys.Clear();
                }
              }

              // Now fetch all the rest of the indexes.
              using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{0}].index_list([{1}])", strCatalog, rdTables.GetString(2)), this))
              {
................................................................................
                  row["CONSTRAINT_NAME"] = String.Format(CultureInfo.InvariantCulture, "sqlite_master_PK_{0}", rdTables.GetString(2));
                  row["TABLE_CATALOG"] = strCatalog;
                  row["TABLE_NAME"] = rdTables.GetString(2);
                  row["COLUMN_NAME"] = primaryKeys[0].Value;
                  row["INDEX_NAME"] = row["CONSTRAINT_NAME"];
                  row["ORDINAL_POSITION"] = primaryKeys[0].Key;


                  tbl.Rows.Add(row);
                }
              }

              using (SQLiteCommand cmdIndexes = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'index' AND [tbl_name] LIKE '{1}'", strCatalog, rdTables.GetString(2).Replace("'", "''")), this))
              {
                using (SQLiteDataReader rdIndexes = cmdIndexes.ExecuteReader())
                {







>
>
>
|
>
>







 







>
|







1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
....
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
                  row["TABLE_CATALOG"] = strCatalog;
                  row["TABLE_NAME"] = rdTables.GetString(2);
                  row["INDEX_CATALOG"] = strCatalog;
                  row["PRIMARY_KEY"] = true;
                  row["INDEX_NAME"] = String.Format(CultureInfo.InvariantCulture, "sqlite_master_PK_{0}", rdTables.GetString(2));
                  row["UNIQUE"] = true;

                  if (String.Compare((string)row["INDEX_NAME"], strIndex, true, CultureInfo.InvariantCulture) == 0
                  || strIndex == null)
                  {
                    tbl.Rows.Add(row);
                  }

                  primaryKeys.Clear();
                }
              }

              // Now fetch all the rest of the indexes.
              using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{0}].index_list([{1}])", strCatalog, rdTables.GetString(2)), this))
              {
................................................................................
                  row["CONSTRAINT_NAME"] = String.Format(CultureInfo.InvariantCulture, "sqlite_master_PK_{0}", rdTables.GetString(2));
                  row["TABLE_CATALOG"] = strCatalog;
                  row["TABLE_NAME"] = rdTables.GetString(2);
                  row["COLUMN_NAME"] = primaryKeys[0].Value;
                  row["INDEX_NAME"] = row["CONSTRAINT_NAME"];
                  row["ORDINAL_POSITION"] = primaryKeys[0].Key;

                  if (String.IsNullOrEmpty(strIndex) || String.Compare(strIndex, (string)row["INDEX_NAME"], true, CultureInfo.InvariantCulture) == 0)
                    tbl.Rows.Add(row);
                }
              }

              using (SQLiteCommand cmdIndexes = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'index' AND [tbl_name] LIKE '{1}'", strCatalog, rdTables.GetString(2).Replace("'", "''")), this))
              {
                using (SQLiteDataReader rdIndexes = cmdIndexes.ExecuteReader())
                {