https://bugs.kde.org/show_bug.cgi?id=512562

            Bug ID: 512562
           Summary: QSql of apostrophes in .desktop filenames results in
                    huge logspam
    Classification: Plasma
           Product: plasmashell
      Version First 6.5.3
       Reported In:
          Platform: Manjaro
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Application Launcher (Kickoff) widget
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
  Target Milestone: 1.0

SUMMARY
Searching for .desktop shortcuts whose filename include an apostrophe from the
application launcher spams gigantic QSqlErrors blocks in journal.

STEPS TO REPRODUCE
1. run `touch ~/.local/share/applications/Tes\'t.desktop`
2. update cache `kbuildsycoca6 --noincremental`
3. open application launcher and try to look up for said Tes't
4. get gigantic blocks of QSqlErrors about syntax errors in journal

OBSERVED RESULT

plasmashell[1604]: [Error at ResultSetPrivate::initQuery]:  QSqlError("1",
"Unable to execute statement", "near \"s\": syntax error") in query:
plasmashell[1604]:
                               SELECT
                                   from_table.targettedResource as resource
                                 , SUM(from_table.cachedScore)  as score
                                 , MIN(from_table.firstUpdate)  as firstUpdate
                                 , MAX(from_table.lastUpdate)   as lastUpdate
                                 , from_table.usedActivity      as activity
                                 , from_table.initiatingAgent   as agent
                                 , COALESCE(ri.title,
from_table.targettedResource) as title
                                 , ri.mimetype as mimetype
                                 , 1 as linkStatus

                               FROM
                                   ResourceScoreCache from_table
                               LEFT JOIN
                                   ResourceInfo ri
                                   ON from_table.targettedResource =
ri.targettedResource



                               WHERE
                                   (agent = 'The Devil\'s Calculator')
                                   AND (activity =
'87a55533-4845-4b3e-937b-87df1fbceec5')
                                   AND (resource LIKE '/%' ESCAPE '\' OR
resource LIKE 'smb:%' ESCAPE '\' OR resource LIKE 'fish:%' ESCAPE '\' OR
resource LIKE 'sftp:%' ESCAPE '\' OR resource LIKE 'ftp:%' ESCAPE '\')
                                   AND (1)
                                   AND (1)
                                   AND (1)

                               GROUP BY resource, title

                               ORDER BY linkStatus DESC, lastUpdate DESC,
resource ASC
                                LIMIT 50

plasmashell[1604]: Failed to resolve executable from service. Error: "No Exec
field in /home/saukko/.local/share/applications/Tes't.desktop"
plasmashell[1604]: [Error at ResultSetPrivate::initQuery]:  QSqlError("1",
"Unable to execute statement", "near \"t\": syntax error") in query:
plasmashell[1604]:
                               SELECT
                                   from_table.targettedResource as resource
                                 , SUM(from_table.cachedScore)  as score
                                 , MIN(from_table.firstUpdate)  as firstUpdate
                                 , MAX(from_table.lastUpdate)   as lastUpdate
                                 , from_table.usedActivity      as activity
                                 , from_table.initiatingAgent   as agent
                                 , COALESCE(ri.title,
from_table.targettedResource) as title
                                 , ri.mimetype as mimetype
                                 , 1 as linkStatus

                               FROM
                                   ResourceScoreCache from_table
                               LEFT JOIN
                                   ResourceInfo ri
                                   ON from_table.targettedResource =
ri.targettedResource



                               WHERE
                                   (agent = 'Tes\'t')
                                   AND (activity =
'87a55533-4845-4b3e-937b-87df1fbceec5')
                                   AND (resource LIKE '/%' ESCAPE '\' OR
resource LIKE 'smb:%' ESCAPE '\' OR resource LIKE 'fish:%' ESCAPE '\' OR
resource LIKE 'sftp:%' ESCAPE '\' OR resource LIKE 'ftp:%' ESCAPE '\')
                                   AND (1)
                                   AND (1)
                                   AND (1)

                               GROUP BY resource, title

                               ORDER BY linkStatus DESC, lastUpdate DESC,
resource ASC
                                LIMIT 50


EXPECTED RESULT
No logspam

SOFTWARE/OS VERSIONS
kinfo:
Operating System: Manjaro Linux
KDE Plasma Version: 6.5.3
KDE Frameworks Version: 6.20.0
Qt Version: 6.10.0
Kernel Version: 6.18.0-rc6-2-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X3D 8-Core Processor
Memory: 128 GiB of RAM (125.4 GiB usable)
Graphics Processor: AMD Radeon RX 7900 XTX

ADDITIONAL INFORMATION
1. I wasn't able to locate and look at plasmashell's sql impl but i assume this
is possibly the exact issue https://stackoverflow.com/a/17280686

2. A non-dummy example .desktop file:
$ The Devil's Calculator.desktop
[Desktop Entry]
Name=The Devil's Calculator
Comment=Play this game on Steam
Exec=steam steam://rungameid/1014280
Icon=steam_icon_1014280
Terminal=false
Type=Application
Categories=Game;

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to