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 Side-by-Side Diffs Ignore Whitespace Patch

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

  1168   1168                     row["TABLE_CATALOG"] = strCatalog;
  1169   1169                     row["TABLE_NAME"] = rdTables.GetString(2);
  1170   1170                     row["INDEX_CATALOG"] = strCatalog;
  1171   1171                     row["PRIMARY_KEY"] = true;
  1172   1172                     row["INDEX_NAME"] = String.Format(CultureInfo.InvariantCulture, "sqlite_master_PK_{0}", rdTables.GetString(2));
  1173   1173                     row["UNIQUE"] = true;
  1174   1174   
  1175         -                  tbl.Rows.Add(row);
         1175  +                  if (String.Compare((string)row["INDEX_NAME"], strIndex, true, CultureInfo.InvariantCulture) == 0
         1176  +                  || strIndex == null)
         1177  +                  {
         1178  +                    tbl.Rows.Add(row);
         1179  +                  }
         1180  +
  1176   1181                     primaryKeys.Clear();
  1177   1182                   }
  1178   1183                 }
  1179   1184   
  1180   1185                 // Now fetch all the rest of the indexes.
  1181   1186                 using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{0}].index_list([{1}])", strCatalog, rdTables.GetString(2)), this))
  1182   1187                 {
................................................................................
  1504   1509                     row["CONSTRAINT_NAME"] = String.Format(CultureInfo.InvariantCulture, "sqlite_master_PK_{0}", rdTables.GetString(2));
  1505   1510                     row["TABLE_CATALOG"] = strCatalog;
  1506   1511                     row["TABLE_NAME"] = rdTables.GetString(2);
  1507   1512                     row["COLUMN_NAME"] = primaryKeys[0].Value;
  1508   1513                     row["INDEX_NAME"] = row["CONSTRAINT_NAME"];
  1509   1514                     row["ORDINAL_POSITION"] = primaryKeys[0].Key;
  1510   1515   
  1511         -                  tbl.Rows.Add(row);
         1516  +                  if (String.IsNullOrEmpty(strIndex) || String.Compare(strIndex, (string)row["INDEX_NAME"], true, CultureInfo.InvariantCulture) == 0)
         1517  +                    tbl.Rows.Add(row);
  1512   1518                   }
  1513   1519                 }
  1514   1520   
  1515   1521                 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))
  1516   1522                 {
  1517   1523                   using (SQLiteDataReader rdIndexes = cmdIndexes.ExecuteReader())
  1518   1524                   {