#[TABLET] Vehicle Search not showing Vehicles

8 messages · Page 1 of 1 (latest)

restive halo
#

Issue: When you look for a Vehicle in the Vehicles Tab, nothing is popping up and it throws this error into the server console:

01:25:57 PM [    script:lb-tablet] SCRIPT ERROR: Callback 'police:searchVehicles' failed: lb-tablet was unable to execute a query!
01:25:57 PM [    script:lb-tablet] Query:     SELECT
01:25:57 PM [    script:lb-tablet]         v.plate, v.citizenid AS owner, v.mods, v.vehicle, p.avatar AS picture,
01:25:57 PM [    script:lb-tablet]         CONCAT(JSON_VALUE(u.charinfo, '$.firstname'), ' ', JSON_VALUE(u.charinfo, '$.lastname')) AS `name`
01:25:57 PM [    script:lb-tablet] 
01:25:57 PM [    script:lb-tablet]     FROM player_vehicles v
01:25:57 PM [    script:lb-tablet] 
01:25:57 PM [    script:lb-tablet]     LEFT JOIN players u ON u.citizenid = v.citizenid
01:25:57 PM [    script:lb-tablet]     LEFT JOIN lbtablet_police_profiles p ON p.id = v.citizenid COLLATE UTF8MB4_GENERAL_CI
01:25:57 PM [    script:lb-tablet]     WHERE v.plate LIKE ?
01:25:57 PM [    script:lb-tablet]     LIMIT ?, ?
01:25:57 PM [    script:lb-tablet] 
01:25:57 PM [    script:lb-tablet] ["%jugular%",0,10]
01:25:57 PM [    script:lb-tablet] Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '='
01:25:57 PM [    script:lb-tablet] > handler (@lb-tablet/lib/server/callbacks.lua:25)
01:25:57 PM [    script:lb-tablet] > logError (@oxmysql/dist/build.js:26282)
01:25:57 PM [    script:lb-tablet] > rawQuery (@oxmysql/dist/build.js:26458)
01:25:57 PM [    script:lb-tablet] > runMicrotasks (<anonymous>:0)
01:25:57 PM [    script:lb-tablet] > processTicksAndRejections (node:internal/process/task_queues:96)
01:25:57 PM [    script:lb-tablet] 

When: Everytime
How to recreate: Open Vehicles Tab and search for a vehicle
Does this happen for everyone: Yes
Version: 1.0.1
Framework: QB
Has this bug appeared more than once? If so, how often?: The whole time

tight frigate
#

We're looking into adding collations to all queries, but the easiest solution is for you to update the tables in your db to use the same collations

tight frigate
#

@restive halocan you try changing local fetchVehicle in lb-tablet/server/custom/frameworks/qb.lua to ```lua
local fetchVehicle = [[
SELECT
v.plate, v.citizenid AS owner, v.mods, v.vehicle, p.avatar AS picture,
CONCAT(JSON_VALUE(u.charinfo, '$.firstname'), ' ', JSON_VALUE(u.charinfo, '$.lastname')) AS name

FROM player_vehicles v

LEFT JOIN players u ON u.citizenid COLLATE UTF8MB4_UNICODE_CI = v.citizenid COLLATE UTF8MB4_UNICODE_CI
LEFT JOIN lbtablet_police_profiles p ON p.id COLLATE UTF8MB4_UNICODE_CI = v.citizenid COLLATE UTF8MB4_UNICODE_CI

]]```?

tight frigate
#

awesome 😄

#

i'll go through all queries and add collate... hopefully it should fix all issues

restive halo
#

Awesome! 😊