staudenmeir/laravel-adjacency-list

ModelName::tree()->get() gives "SQLSTATE[HY093]: Invalid parameter number"

kde99 opened this issue · 4 comments

kde99 commented

Hello everyone!

I just added this package to my Laravel project (currently on 10.28, laravel-adjacency-list version is 1.13.9). I have added

use HasRecursiveRelationships;

protected function getPathSeparator(): string
{
    return "'/'";
}

to my model class.

When I try to run a simple query against it such as:

TicketEsemenyek::tree()->get()

OR

TicketEsemenyek::withRecursiveQueryConstraint(function (Builder $query) {
    $query->where("ticket_esemenyek.ticket_id", "=", 2);
}, function () {
    return TicketEsemenyek::tree()->get();
});

I get the following error: SQLSTATE[HY093]: Invalid parameter number. I have tried to run the generated query (shown on the debug screen up top) and it works, and gives the correct results when ran in the mysql console (I am running dolt, but it is mysql compatible).
The query the debug screen is showing is (this is already prepared I assume):

WITH RECURSIVE `laravel_cte` AS (
  (
    SELECT
      *,
      0 AS `depth`,
      cast(`id` AS char(65535)) AS `path`
    FROM
      `ticket_esemenyek`
    WHERE
      `parent_id` IS NULL
  )
  UNION ALL
  (
    SELECT
      `ticket_esemenyek`.*,
      `depth` + 1 AS `depth`,
      concat(`path`, '/', `ticket_esemenyek`.`id`)
    FROM
      `ticket_esemenyek`
      INNER JOIN `laravel_cte` ON `laravel_cte`.`id` = `ticket_esemenyek`.`parent_id`
  )
)
SELECT
  *
FROM
  `laravel_cte`

And at the bottom the RAW SQL is given as:

with recursive `laravel_cte` as ((select *, 0 as `depth`, cast(`id` as char(65535)) as `path` from `ticket_esemenyek` where `parent_id` is null) union all (select `ticket_esemenyek`.*, `depth` + 1 as `depth`, concat(`path`, ?, `ticket_esemenyek`.`id`) from `ticket_esemenyek` inner join `laravel_cte` on `laravel_cte`.`id` = `ticket_esemenyek`.`parent_id`)) select * from `laravel_cte`

I have tried with and without strict_mode: it makes no difference. What could be causing the issue?

Thank you for your replies

Hi @kde99,
Please share the whole error message.

kde99 commented

Thanks for your reply.

Error screen shared on flare

Error code as in laravel.log:

[2023-10-18 18:01:53] local.ERROR: SQLSTATE[HY093]: Invalid parameter number (Connection: mysql, SQL: with recursive `laravel_cte` as ((select *, 0 as `depth`, cast(`id` as char(65535)) as `path` from `ticket_esemenyek` where `parent_id` is null) union all (select `ticket_esemenyek`.*, `depth` + 1 as `depth`, concat(`path`, '/', `ticket_esemenyek`.`id`) from `ticket_esemenyek` inner join `laravel_cte` on `laravel_cte`.`id` = `ticket_esemenyek`.`parent_id`)) select * from `laravel_cte`) {"exception":"[object] (Illuminate\\Database\\QueryException(code: HY093): SQLSTATE[HY093]: Invalid parameter number (Connection: mysql, SQL: with recursive `laravel_cte` as ((select *, 0 as `depth`, cast(`id` as char(65535)) as `path` from `ticket_esemenyek` where `parent_id` is null) union all (select `ticket_esemenyek`.*, `depth` + 1 as `depth`, concat(`path`, '/', `ticket_esemenyek`.`id`) from `ticket_esemenyek` inner join `laravel_cte` on `laravel_cte`.`id` = `ticket_esemenyek`.`parent_id`)) select * from `laravel_cte`) at L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php:801)
[stacktrace]
#0 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php(755): Illuminate\\Database\\Connection->runQueryCallback()
#1 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php(424): Illuminate\\Database\\Connection->run()
#2 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Query\\Builder.php(2752): Illuminate\\Database\\Connection->select()
#3 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Query\\Builder.php(2740): Illuminate\\Database\\Query\\Builder->runSelect()
#4 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Query\\Builder.php(3294): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#5 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Query\\Builder.php(2741): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#6 L:\\partneroldal\\vendor\\staudenmeir\\laravel-adjacency-list\\src\\Eloquent\\Traits\\BuildsAdjacencyListQueries.php(25): Illuminate\\Database\\Query\\Builder->get()
#7 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Builder.php(719): Staudenmeir\\LaravelAdjacencyList\\Eloquent\\Builder->getModels()
#8 L:\\partneroldal\\routes\\web.php(22): Illuminate\\Database\\Eloquent\\Builder->get()
#9 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\CallableDispatcher.php(40): Illuminate\\Routing\\RouteFileRegistrar->{closure}()
#10 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php(237): Illuminate\\Routing\\CallableDispatcher->dispatch()
#11 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php(208): Illuminate\\Routing\\Route->runCallable()
#12 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(799): Illuminate\\Routing\\Route->run()
#13 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#14 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#15 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#16 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#18 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\View\\Middleware\\ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#19 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#20 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#21 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#22 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
#23 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#25 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#26 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#27 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#28 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(800): Illuminate\\Pipeline\\Pipeline->then()
#29 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(777): Illuminate\\Routing\\Router->runRouteWithinStack()
#30 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(741): Illuminate\\Routing\\Router->runRoute()
#31 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(730): Illuminate\\Routing\\Router->dispatchToRoute()
#32 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(200): Illuminate\\Routing\\Router->dispatch()
#33 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#34 L:\\partneroldal\\vendor\\livewire\\livewire\\src\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#35 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Livewire\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware->handle()
#36 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#37 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#38 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#39 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#41 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#42 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#44 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance.php(99): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#45 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#46 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Middleware\\HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#47 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle()
#48 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Middleware\\TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#50 L:\\partneroldal\\vendor\\itsgoingd\\clockwork\\Clockwork\\Support\\Laravel\\ClockworkMiddleware.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Clockwork\\Support\\Laravel\\ClockworkMiddleware->handle()
#52 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#53 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then()
#54 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#55 L:\\partneroldal\\public\\index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle()
#56 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\resources\\server.php(16): require_once('...')
#57 {main}

[previous exception] [object] (PDOException(code: HY093): SQLSTATE[HY093]: Invalid parameter number at L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php:701)
[stacktrace]
#0 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php(701): PDOStatement->bindValue()
#1 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php(419): Illuminate\\Database\\Connection->bindValues()
#2 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php(788): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}()
#3 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php(755): Illuminate\\Database\\Connection->runQueryCallback()
#4 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Connection.php(424): Illuminate\\Database\\Connection->run()
#5 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Query\\Builder.php(2752): Illuminate\\Database\\Connection->select()
#6 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Query\\Builder.php(2740): Illuminate\\Database\\Query\\Builder->runSelect()
#7 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Query\\Builder.php(3294): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#8 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Query\\Builder.php(2741): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#9 L:\\partneroldal\\vendor\\staudenmeir\\laravel-adjacency-list\\src\\Eloquent\\Traits\\BuildsAdjacencyListQueries.php(25): Illuminate\\Database\\Query\\Builder->get()
#10 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Database\\Eloquent\\Builder.php(719): Staudenmeir\\LaravelAdjacencyList\\Eloquent\\Builder->getModels()
#11 L:\\partneroldal\\routes\\web.php(22): Illuminate\\Database\\Eloquent\\Builder->get()
#12 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\CallableDispatcher.php(40): Illuminate\\Routing\\RouteFileRegistrar->{closure}()
#13 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php(237): Illuminate\\Routing\\CallableDispatcher->dispatch()
#14 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Route.php(208): Illuminate\\Routing\\Route->runCallable()
#15 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(799): Illuminate\\Routing\\Route->run()
#16 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#17 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Middleware\\SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#18 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#19 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#20 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#21 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\View\\Middleware\\ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#22 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#23 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#24 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#25 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
#26 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#27 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#28 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#29 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#30 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#31 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(800): Illuminate\\Pipeline\\Pipeline->then()
#32 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(777): Illuminate\\Routing\\Router->runRouteWithinStack()
#33 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(741): Illuminate\\Routing\\Router->runRoute()
#34 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(730): Illuminate\\Routing\\Router->dispatchToRoute()
#35 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(200): Illuminate\\Routing\\Router->dispatch()
#36 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#37 L:\\partneroldal\\vendor\\livewire\\livewire\\src\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware.php(19): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#38 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Livewire\\Features\\SupportDisablingBackButtonCache\\DisableBackButtonCacheMiddleware->handle()
#39 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#41 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#42 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#44 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#45 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#46 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#47 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance.php(99): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#48 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#49 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Middleware\\HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#50 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle()
#51 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Http\\Middleware\\TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#52 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#53 L:\\partneroldal\\vendor\\itsgoingd\\clockwork\\Clockwork\\Support\\Laravel\\ClockworkMiddleware.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#54 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(180): Clockwork\\Support\\Laravel\\ClockworkMiddleware->handle()
#55 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#56 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then()
#57 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#58 L:\\partneroldal\\public\\index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle()
#59 L:\\partneroldal\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\resources\\server.php(16): require_once('...')
#60 {main}
"} 

The table in question is basically created with:

        Schema::create('ticket_esemenyek', function (Blueprint $table) {
            $table->id();
            $table->foreignId('ticket_id')->constrained('ticketek')->cascadeOnUpdate()->cascadeOnDelete();
            $table->unsignedBigInteger('parent_id')->nullable();
           // Other fields omitted
            $table->timestamps();
        });

Let me know if you need anything else.

Do you have a way to connect your app to a MySQL database and test the query with that?

If not, please put dd($query, $bindings); in line 800 of L:\partneroldal\vendor\laravel\framework\src\Illuminate\Database\Connection.php and run the query again.

kde99 commented

I tested with MySQL 8 and it works there. Also did the dd($query, $bindings) and it basically shows the same for both the connections (well makes sense since dolt is advertising itself as MySQL 8, so Laravel works the same), so it seems like the issue is with dolt itself.

I will shoot an issue to the dolt team so they can fix it, and sorry for wasting your time.

Thank you for help