HaxeFoundation / HaxeFoundation/haxe

MySQL database connects on haxe 4.3.7 but fails on haxe 5/nightly

Open
#12,369 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```
haxelib git logging https://github.com/core-haxe/logging
haxelib git db-core https://github.com/core-haxe/db-core
haxelib git db-mysql https://github.com/core-haxe/db-mysql
haxelib git mysql https://github.com/core-haxe/mysql
haxelib git promises https://github.com/core-haxe/promises
haxelib git libmysqlclient https://github.com/core-haxe/libmysqlclient
```
```-cp src
-D analyzer-optimize
-main Main

--cpp bin/cpp
--library db-core
--library db-mysql
--debug
```

```hx
import haxe.Timer;
import db.DatabaseFactory;

class Main {
static function main() {
trace('here');
var connected:Bool = false;
var timer = new Timer(1000);
timer.run = () -> {
trace('connected? $connected');
}

var db = DatabaseFactory.instance.createDatabase(DatabaseFactory.MYSQL, {
database: 'test',
host: "127.0.0.1",
user: "root",
pass: "123456"
});

db.connect().then(function(state) {
trace('here');
if (state.data) {
connected = true;
trace('Database connected');
} else {
trace('Database not connected');
}
}, (err) -> trace(err));
}
}
```
Occurs on both Windows and Linux, works on haxe 4.3.7 and on nightlies it compiles fine, runs but fails to connect (with no errors)

Contributor guide

Open the contributing guide

Research direction

Reproduce the example using the listed haxelib dependencies and C++ target on Haxe 4.3.7 and a Haxe 5/nightly build. Compare the db.connect() result and callback behavior, then inspect the connection and error paths in db-mysql, mysql, and libmysqlclient. Done means the regression is explained and the connection either succeeds or reports a useful error on affected builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, mysql
Domain
compilers, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.