File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed
Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 11version https://git-lfs.github.com/spec/v1
2- oid sha256:4a4a5b427c437bab2b9c7e0e76a58dde6f72e0379626d501e986d226ec61376a
3- size 5932421
2+ oid sha256:65cc586dc93a57806c48beabc75d67668cc652f4dbdc754c7a5bde10b77f8247
3+ size 5931870
Original file line number Diff line number Diff line change @@ -357,9 +357,14 @@ struct resultSetS *executeQuerySelectSerial(
357357 // Get all indexed attributes in the WHERE clause, using the B+ tree indexes where possible
358358 struct whereClauseS * wc = whereClause ;
359359 while (wc != NULL ) {
360+ // Skip nested conditions for index lookup (they don't have a direct attribute)
361+ if (wc -> attribute == NULL ) {
362+ wc = wc -> next ;
363+ continue ;
364+ }
365+
360366 for (int i = 0 ; i < engine -> num_indexes ; i ++ ) {
361367 if (strcmp (wc -> attribute , engine -> indexed_attributes [i ]) == 0 ) {
362- anyIndexExists = true;
363368 indexExists [i ] = true;
364369
365370 // Use B+ tree index for this attribute
@@ -427,6 +432,8 @@ struct resultSetS *executeQuerySelectSerial(
427432 continue ;
428433 }
429434
435+ anyIndexExists = true;
436+
430437 // Allocating for keys, using num_records as upper bound.
431438 KEY_T * returned_keys = malloc (engine -> num_records * sizeof (KEY_T ));
432439 ROW_PTR * returned_pointers = malloc (engine -> num_records * sizeof (ROW_PTR ));
Original file line number Diff line number Diff line change @@ -36,4 +36,4 @@ WHERE sudo_used = TRUE OR (risk_level = 5 AND shell_type = "bash");
3636# -- Sample 8:
3737SELECT user_name, working_directory, base_command
3838FROM Commands
39- WHERE user_id = 1001 OR (user_name = "student1002" AND shell_type = "zsh");
39+ WHERE user_id = 1001 OR (user_name = "student1002" AND shell_type = "zsh");
You can’t perform that action at this time.
0 commit comments