[MDEV-25082] Trouble with Lazarus/ZeosDB with pipes, so how to now build libmysqld.dll? Created: 2021-03-08  Updated: 2021-03-09  Resolved: 2021-03-09

Status: Closed
Project: MariaDB Server
Component/s: Embedded Server
Affects Version/s: 10.5.8, 10.5.9
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Paul Norman Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: Lazarus, ZeosDB, embedded, libmysqld.dll, need_feedback
Environment:

ZeosLib 7.2.8.0 from the Lazarus "Online Package Manager"
Lazarus 2.0.8 r62944 FPC 3.0.4 x86_64-win64-win32/win64
Windows 8.1 Prof 64bit


Issue Links:
Issue split
split from MDEV-15100 libmysqld.dll in mariadb 10.2.12 not ... Closed

 Description   

I have tried:

mysqld.exe --skip-networking --enable-named-pipe --named-pipe=<some-unique-name>
and connecting via libmariadb.dll, via this named pipe <some-unique-name>.

But as I am using ZeosDB under Lazarus (64bit) naming a pipe does not seem to be an option.

So I have returned to trying the Embedded dll soluton and ...
– Previously ...

cmake . -DWITH_EMBEDDED_SERVER=1 && cmake --build . --config relwithdebinfo --target libmysqld

As per https://jira.mariadb.org/plugins/servlet/mobile#issue/MDEV-15100/comment/106350
would build libmysqld.dll and you would find it in

 libmysqld\RelWithDebInfo directory

How now do we build libmysqld.dll?

Or is it completely depreciated (-- but still very useful/needed sometimes!)



 Comments   
Comment by Vladislav Vaintroub [ 2021-03-08 ]

It is useful in very, very limited scenarios. We did not build it on Windows for 5 years, or something close to that. When I try to build 10.5 now on Windows, it fails, because apparently, something has changed in the way we make static libs out of static libs, and there are other errors. I doubt think there will be a revival of Windows embedded soon.

Instead I'd suggest to talk to whoever builds that framework that you are using, to support named pipes. If this Zeos, whatever it is, uses C client library underneath, you can pass string "." as host, and named pipe name as unix socket.

Or, you can use TCP as well, just find the port that is not used, and change the server's bind parameter to only accept local connections.

Comment by Paul Norman [ 2021-03-09 ]

Thank you I'll run your suggestions past ZeosDB community.

So as described above, use unix socket, even though documentation suggests its for *Nix family only?

Embeded is really more useful than might appear the case at first – it is afterall much much more than SQLite3 — on steriods, and far more advanced!
And look how widely used Sqlite3 is even in stand alone applications

Sad that Oracle was just blindly followed on this one, and please people don't forget those of us who have to write for Windows as well

Comment by Vladislav Vaintroub [ 2021-03-09 ]

The documentation for mysql_real_connect , for both MariaDB and MySQL, says that unix_socket is unix domain socket, or named pipe. The name if the parameter is misleading, I agree.

MySQL documentation also documents what happens if host name passed to the function is "."

With that, anything based on C client can work with named pipes, as long it exposes host and unix_socket parameter. I was not able to find any documentation for ZeosDB on the web, but I hope that it could work.

As for following Oracle's, I think this is a typical misunderstanding. Once again MariaDB(on Windows) pioneered throwing away an untested component, and Oracle followed, as always, without proper attribution.

Comment by Vladislav Vaintroub [ 2021-03-09 ]

I'm closing it for now. a 10 year old discussion https://zeoslib.sourceforge.io/viewtopic.php?t=3364 seems to have an example on how to connect using named pipes.

Generated at Thu Feb 08 09:35:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.