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

Existing Database Tables not recognized as created #4

Open
Strohtaler opened this issue Apr 26, 2022 · 3 comments
Open

Existing Database Tables not recognized as created #4

Strohtaler opened this issue Apr 26, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@Strohtaler
Copy link

I noted that even after having all database tables created (Ticket Server), I still got the link to create the database.

After digging a bit, I found that some PHP scripts have code to check if a given table is already created, for example in function ts_doesTableExist in ticketServer/server.php. The table name comparison (line 1254) is done in a case-sensitive way like:
if( $tableName == $inTableName ), This will fail since some databases return table names in all lowercase (others all uppercase).

It can be solved (as tested) using if( strcasecmp( $tableName, $inTableName ) == 0 ) instead, but I am not a PHP developer, so I prefer not doing it myself.

(Actually I would prefer to directly query for the given table SELECT count(*) FROM information_schema.tables WHERE table_schema = '$databaseName' and table_name = '$inTableName')

@connorhsm
Copy link
Member

What database engines do this, and which were you using for this to happen?

I believe all of this code was written with MySQL in mind, mostly over four years ago.

@Strohtaler
Copy link
Author

That could be the problem.
I am using XAMPP (x64-8.1.5-0-VS16) for servers and database - I supposed it comes with MySQL, its control center still states so, but it is MariaDB ( 10.4.24-MariaDB), a fork of MySQL.

@connorhsm
Copy link
Member

Afaik MariaDB can be used as a drop in replacement for MySQL, I was considering using it if I were to finish dockerising this project, but have yet to test.

@connorhsm connorhsm added the bug Something isn't working label Apr 9, 2023
@connorhsm connorhsm moved this to Todo in General dev tasks Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants