CurtTilmes / perl6-dbmysql

DB::MySQL
2 stars 3 forks source link

Odd NativeCall issue Encountered #11

Open Xliff opened 2 years ago

Xliff commented 2 years ago

Here is the error message:

Native call expected argument 3 with VMArray representation, but got a CArray (NativeCall::Types::CArray[uint32])
  in block mysql_options at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/core/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 636
  in method option at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/sources/95C0806CA001A1EB28D0FC597A2FE4FF5195D52C (DB::MySQL::Native) line 429
  in method connect at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/sources/BE89865FDE4F84357883D27506D5B5CF8AE4AF41 (DB::MySQL) line 27
  in method db at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/sources/03DA109C5B8532E87FCA813A145C35AABBCB9BC8 (DB) line 18
  in method db at /home/cbwood/Work/BizzellAppServer/app/lib/Bizzell/Roles/DB.pm6 (Bizzell::Roles::DB) line 155
  in block  at /home/cbwood/Work/BizzellAppServer/app/lib/Bizzell/Roles/DB.pm6 (Bizzell::Roles::DB) line 192
  in method prepareAllQueries at /home/cbwood/Work/BizzellAppServer/app/lib/Bizzell/Roles/DB.pm6 (Bizzell::Roles::DB) line 185
  in block <unit> at service.p6 line 44

I'll try and chase this down, further.

Xliff commented 2 years ago

Here is the culprit:

    multi method option(mysql-option $option, Int:D $i)
    {
        my CArray[uint32] $arg .= new($i);
        $.check($.mysql_options($option, $arg))
    }

Along with the associated NativeCall definition:

    method mysql_options(int32 $option, Blob $arg --> int32)
        is native(LIBMYSQL) is symbol('mysql_options') {}

Which doesn't look to match the latest API:

int
mysql_options(MYSQL *mysql,
              enum mysql_option option,
              const void *arg)

So I hope this provides enough information to fix the issue. If you need further information or bug tracing from me, please ask.

CurtTilmes commented 2 years ago

Xliff, I invited you as a collaborator on this repository. Feel free to commit your changes. -- I mostly use PostgreSQL and SQLite. Let me know if you'd like me to just transfer ownership to you completely.

Xliff commented 2 years ago

@curt - Thanks! I will take the collaborator role. I still think you should maintain ownership, however.