Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce MySQL support #61

Merged
merged 7 commits into from Jul 9, 2019
Merged

Introduce MySQL support #61

merged 7 commits into from Jul 9, 2019

Conversation

pacphi
Copy link
Collaborator

@pacphi pacphi commented Jul 9, 2019

No description provided.

* Start to address issue #14
* Favoring use of https://github.com/mirromutth/r2dbc-mysql
* Add convenience script for fetch and build of source since release of aforementioned provider is not yet available publicly
* Move DatabaseCreator and PoliciesLoader to task package
* Move GitClient to client package
* Update deprecated R2DBC API calls (e.g., execute().sql(... becomes execute(... )
* Add schema.ddl for MySQL
* Plumb additional choice in DbmsSettings#IndexPrefix
* Update README with instructions on how to get going w/ MySQL
* Finally add a variant build.w-mysql.gradle that adds mavenLocal() managed repository

> Still having issues at startup; will resolve in subsequent commit(s)
* Move to fluent API for parameterized queries
* Create service_bindings view
* Parameterized aggregate queries for counts are unsupported so we get it done with Flux#count()

Still getting the following exception at startup

2019-07-08T23:30:50,465 ERROR [reactor-tcp-nio-6] i.p.c.t.PoliciesLoader: PoliciesLoader terminated with error
org.springframework.transaction.TransactionSystemException: Could not roll back R2DBC transaction; nested exception is io.r2dbc.spi.R2dbcNonTransientResourceException: unknown message header 3 on command phase
        at org.springframework.data.r2dbc.connectionfactory.R2dbcTransactionManager.lambda$doRollback$9(R2dbcTransactionManager.java:362)
        at reactor.core.publisher.Mono.lambda$onErrorMap$24(Mono.java:3008)
* Add convenience deploy/destroy scripts
* Refine PoliciesLoader repo to save favoring concatMap over flatMap
* Remove unused imports
* Fix links in README

While we can successfully spin up a local instance of cf-butler and connect to a Docker instance of MySQL 5.7.26, no such luck with a cf push of cf-butler and subsequent bind-service and restage to a p.mysql service instance. Here's what we see in logs:

```
2019-07-09T11:17:22.07-0700 [APP/PROC/WEB/0] OUT 2019-07-09T18:17:22,069 ERROR [reactor-tcp-epoll-1] i.g.m.r.m.c.ReactorNettyClient: Connection Error: unknown character '-' for parse server version
   2019-07-09T11:17:22.07-0700 [APP/PROC/WEB/0] OUT java.lang.NumberFormatException: unknown character '-' for parse server version
   2019-07-09T11:17:22.07-0700 [APP/PROC/WEB/0] OUT     at io.github.mirromutth.r2dbc.mysql.ServerVersion.readIntBeforePoint(ServerVersion.java:145)
   2019-07-09T11:17:22.07-0700 [APP/PROC/WEB/0] OUT     at io.github.mirromutth.r2dbc.mysql.ServerVersion.parse(ServerVersion.java:48)
   2019-07-09T11:17:22.07-0700 [APP/PROC/WEB/0] OUT     at io.github.mirromutth.r2dbc.mysql.message.server.HandshakeHeader.decode(HandshakeHeader.java:72)
```

r2dbc-mysql is parsing for the server version and it appears the version reported contains an incompatible (parsed) character.
* Update schema.dll; restrict column sizing
* Update fetch and build script to pull in a temporary fix for determining the server version of the MySQL instance r2dbc-mysql facilitates interaction with
* Remove unused imports
@pacphi pacphi mentioned this pull request Jul 9, 2019
@pacphi pacphi merged commit dcf35b6 into master Jul 9, 2019
@pacphi pacphi deleted the mysql-support branch July 9, 2019 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant