-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Problems with the count drones query #145
Comments
I find that I have the same issue when trying to retrieve the resource description using the following script:
Basically, the game engine doesn't report an error. However, it also doesn't place a value in the results buffer. |
The following query also generates the same issue:
|
When running the above query, I found the following report in the game engine log:
This suggests that the game engine doesn't recognize the field type and is therefore not reporting the values. |
When I tried query 520, which I know works, to identify the central body for Earth (0), I got the following report in the game engine log:
This appears to have worked because the game engine doesn't have a problem with field type 3. |
Here are the hex values for some of the different SQL data types:
So it looks like type 3 is MYSQL_TYPE_LONG and that is acceptable. However, the game engine does not like type 5, which is MYSQL_TYPE_DOUBLE. Here are the corresponding data types:
|
Ok. It looks like to resolve the issue where the query returns the x, y , and z coordinates, I need to change the coordinate fields from double to int in the DB. Since these fields currently aren't being populated and the query would be useless, I won't waste my time with this particular issue. The issue with the other query not returning the resource description is similar. The resource description field is a different field type than the name. So, it is probably generating an error when the game engine tries to read from that field type. I would probably need to switch this over to VARCHAR to work. However, since this isn't an important query to support at this point, I'm not going to fuss with it either. |
The original issue, in which a count of the spacecraft failed to deliver results, is likely due to the fact that the MySQL count function returns a BIGINT value. However, the game engine is only configured to collect INT values. The only way I can fix this is by modifying and recompiling db.c so that it responds to both MYSQL_TYPE_LONG and MYSQL_TYPE_LONGLONG. This should be easy enough to do. I just need to use an or statement in the case test. |
When I tried creating a query to count the numbers of spacecraft in a companies fleet, it didn't work, failing to return any data to the results buffer. I spent a full afternoon troubleshooting without any success. I'm going to set this problem to the side for now but will likely need to come back to it soon.
The text was updated successfully, but these errors were encountered: