| Bug #117722 | Forward Engineer - Filter Not Working | ||
|---|---|---|---|
| Submitted: | 17 Mar 3:37 | Modified: | 13 May 12:45 |
| Reporter: | Stan Banash | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Workbench | Severity: | S3 (Non-critical) |
| Version: | 8.0.42 | OS: | Windows (Microsoft Windows 11 Pro) |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | WBBugReporter | ||
[17 Mar 3:37]
Stan Banash
[17 Mar 5:02]
MySQL Verification Team
HelloStan Banash, Thank you for the report and feedback. Verified as described. regards, Umesh
[13 May 12:45]
Stan Banash
This is still occurring in version 8.0.42. Any updates?
[31 Oct 19:11]
Md Asaduzzaman
Hello Stan Banash, I am also facing the same problem.
[23 Nov 15:19]
승호 한
**Root Cause Identified**
I have analyzed the MySQL Workbench 8.0.44 source code and found the root cause of this bug.
**File:** `backend/wbpublic/grtdb/grt_string_list_model.cpp`
**Function:** `GrtStringListModel::process_mask()`
**Line:** ~280
**Bug:**
```cpp
if (*i && itemsSize < n) { // ❌ WRONG: condition reversed
```
**Fix:**
```cpp
if (*i && n < itemsSize) { // ✅ CORRECT: proper bounds check
```
**Explanation:**
The condition `itemsSize < n` is always FALSE since itemsSize (total items) will never be less than n (loop counter). This causes the entire filtering logic to be skipped, leaving items in both include and exclude lists.
**Impact:**
All filtering operations are broken in Forward Engineer dialog.
**Patch (unified diff):**
```diff
--- a/backend/wbpublic/grtdb/grt_string_list_model.cpp
+++ b/backend/wbpublic/grtdb/grt_string_list_model.cpp
@@ -277,7 +277,7 @@
size_t n = 0;
size_t itemsSize = _items.size();
for (std::vector<bool>::iterator i = items.begin(); i != items.end(); ++i, ++n) {
- if (*i && itemsSize < n) {
+ if (*i && n < itemsSize) {
const Item_handler &item = _items[n];
```
This is a simple one-line fix that should resolve the issue completely.
**Testing:**
After applying the fix:
1. Open Forward Engineer dialog
2. Select a table and click ">" to exclude
3. Table should disappear from left list and appear only once in right list
Hope this helps expedite the fix!
