-
Notifications
You must be signed in to change notification settings - Fork 46
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
Replace sprintf usage with snprintf #21
Replace sprintf usage with snprintf #21
Conversation
.gitignore
Outdated
@@ -39,6 +39,8 @@ benchmark/mysql-connector-cpp/ | |||
benchmark/mariadb.json | |||
benchmark/mysql.json | |||
benchmark/main-benchmark | |||
cmake-build-*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I gave some comments in the PR you referred. I'm gonna repeat them here.
These are too project-specific. I mean, I don't think they are default names of directories created by cmake/build by cmake generated projects. I am not sure I want these to be added to .gitignore for everybody. On other hand it's pretty common naming pattern. Once again - I am not sure about this
src/logger/LoggerFactory.cpp
Outdated
@@ -51,7 +51,7 @@ namespace mariadb | |||
bool LoggerFactory::initLoggersIfNeeded() | |||
{ | |||
if (!NO_LOGGER) { | |||
NO_LOGGER.reset(new NoLogger()); | |||
NO_LOGGER = Shared::Logger(new NoLogger()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that PR I asked "Is there real need for this change? I don't think so" Now I guess the idea is to initialize in case it's not initialized. Like calling method of not initialized object is not a good idea. But it's not initialization and one line before we test that object as boolean and that involves method calling.
In 1.1 this dance around NO_LOGGER has been removed and I should do the same in 1.0 probably. But as for your PR - I guess there is probably no need to change this line
src/logger/LoggerFactory.h
Outdated
@@ -32,9 +32,11 @@ namespace mariadb | |||
{ | |||
class LoggerFactory | |||
{ | |||
private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is that? also not needed. Everything is private in a class by default
Thank you for another pull request. I've made my comments. |
Co-authored-by: JOAQUIN BEJAR <jb@taunais.com>
016e434
to
680e4bb
Compare
Thanks for following up and pushing that logging change into |
Out of curiosity - what do you use it for? also, since your patch against master that is 1.0 version, are you using 1.0 and if yes why not the 1.1? It is also ga, currently it is still in develop branch. To my taste it's a way better |
Ah, I assumed that `master` was whatever the running current release cycle
was. I'll probably move over to using `develop` soon then!
I do a lot of the engine/core work for `Final Fantasy XI` MMO server
emulators. I introduced the cpp connector over our existing use of the c
connector to make it easier
to support prepared statements, make result access thread-safe, and be able
to pull out results by column name from result sets. The change was
initially born out of
trying to squeeze out some more performance through prepared statements,
but all the extra goodies have been great!
This is the PR I added these changes in:
LandSandBoat/server#4601
This is the layer I wrap the cpp connector with:
https://github.com/LandSandBoat/server/blob/base/src/common/database.h#L168
I think my only issues have been having to reimplement or workaround some
things that are missing in the cpp connector that I was using in the c
connector, like `affectedRows`:
https://github.com/LandSandBoat/server/blob/base/src/common/database.h#L225
But largely the experience has been positive, thanks for you work 👍
…On Tue, Nov 12, 2024 at 5:04 PM lawrinn ***@***.***> wrote:
Out of curiosity - what do you use it for? also, since your patch against
master that is 1.0 version, are you using 1.0 and if yes why not the 1.1?
It is also ga, currently it is still in develop branch. To my taste it's a
way better
—
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKTJIIZUMKDGLWPFJ4MNP32AIYI5AVCNFSM6AAAAABRAEYKEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZRGA4TSOJTHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Oh, I did a writeup about this upgrade process you might find interesting:
https://github.com/LandSandBoat/server/wiki/Database-Library-Upgrade
…On Tue, Nov 12, 2024 at 5:15 PM Zach Toogood ***@***.***> wrote:
Ah, I assumed that `master` was whatever the running current release cycle
was. I'll probably move over to using `develop` soon then!
I do a lot of the engine/core work for `Final Fantasy XI` MMO server
emulators. I introduced the cpp connector over our existing use of the c
connector to make it easier
to support prepared statements, make result access thread-safe, and be
able to pull out results by column name from result sets. The change was
initially born out of
trying to squeeze out some more performance through prepared statements,
but all the extra goodies have been great!
This is the PR I added these changes in:
LandSandBoat/server#4601
This is the layer I wrap the cpp connector with:
https://github.com/LandSandBoat/server/blob/base/src/common/database.h#L168
I think my only issues have been having to reimplement or workaround some
things that are missing in the cpp connector that I was using in the c
connector, like `affectedRows`:
https://github.com/LandSandBoat/server/blob/base/src/common/database.h#L225
But largely the experience has been positive, thanks for you work 👍
On Tue, Nov 12, 2024 at 5:04 PM lawrinn ***@***.***> wrote:
> Out of curiosity - what do you use it for? also, since your patch against
> master that is 1.0 version, are you using 1.0 and if yes why not the 1.1?
> It is also ga, currently it is still in develop branch. To my taste it's a
> way better
>
> —
> Reply to this email directly, view it on GitHub
> <#21 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAKTJIIZUMKDGLWPFJ4MNP32AIYI5AVCNFSM6AAAAABRAEYKEGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZRGA4TSOJTHA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***
> com>
>
|
Well, 1.1. was supposed to become master once it goes ga, but then I've become reluctant of doing this pull requests are one of reasons - people submit their requests against master, and it's a way easier to merge from 1.0 to 1.1. then in opposite direction. Asking to rebase against different branch makes PR's a bit more cumbersome. |
hmm, it looks like you use rowsCount(). if (rset && rset->rowsCount() && rset->next()) |
Extracts one of the smaller items from this previous PR: #16
License things (I saw some mention of this in other PRs):
The files I've modified are listed under LGPL v2.1, but I'm happy to hand over all rights to the maintainers and MariaDB group, to use in whatever way they like, under whatever license they want.