|
|
|
|
Snort Forums Archive
Archive Home » Snort Development » MySQL reserved word schema in snort 2.3.3
Please note that the categories listed below represent an archived version of our forums pages. To view the current version and be able to post and reply to threads, please register and login here to go to the full forums pages.
[ Notice: Full Version of This Topic ]
MySQL reserved word schema in snort 2.3.3
Posted by gilgsn on July 15, 2005 15:12:47
Hello,
The MySQL version of 2.3.3 uses a table named "schema" which is a MySQL reserved word and creates SQL errors... Has this been fixed? Thanks.
Gil. |
|
Posted by canyberg on July 19, 2005 11:01:07
I asked the same question back in May and have not received a reply. Schema and Schemas are both reserved words but I don't recall if they are reserved in both MySQL 4 & 5 or just 5. |
|
Posted by shadowbq on August 15, 2005 16:18:33
As you can see the execption is only for MSSQL & ODBC...
THIS IS NOT FIXED.. in 2.4.0
file: spo_database.c
#if defined(ENABLE_MSSQL) || defined(ENABLE_ODBC)
if ( data->shared->dbtype_id == DB_MSSQL ||
(data->shared->dbtype_id==DB_ODBC && data->u_underlying_dbtype_id==DB_MSSQL) )
{
/* "schema" is a keyword in SQL Server, so use square brackets
* to indicate that we are referring to the table
*/
snprintf(select0, MAX_QUERY_LENGTH,
"SELECT vseq "
" FROM [schema]");
}
else
#endif
{
snprintf(select0, MAX_QUERY_LENGTH,
"SELECT vseq "
"FROM schema");
}
schema_version = Select(select0,data);
free(select0); select0 = NULL;
return schema_version;
} |
|
Posted by shadowbq on August 15, 2005 16:31:06
ALTER SCHEMA can be used as of MySQL 5.0.2.
I believe a work around would be:
USE backticks to reference reserved words.. instead of brackets as in MSSQL and ODBC |
|
Posted by shadowbq on August 15, 2005 16:47:37
This happened internally with MYSQL on a similiar RESERVED WORD
http://bugs.mysql.com/bug.php?id=7793 |
|
Posted by Joel_Esler on August 26, 2005 15:39:46
So you're saying Backticks should be added to "schema"?
Note: The spo_database.c code was not written by Snort developers/SOURCEfire
Joel Esler
SOURCEfire |
|
Posted by gbobeck on September 20, 2005 23:10:39
Is this still an issue with the 2.4.1 release? |
|
Posted by Joel_Esler on September 21, 2005 05:54:43
I don't believe we got anything to change in the new version, we haven't looked at it yet.
Joel Esler
SOURCEfire |
|
Posted by gbobeck on September 21, 2005 14:47:21
Ok. Thanks :-) |
|
Posted by gilgsn on September 22, 2005 08:51:47
Hello,
Well, I installed 2.4.1, same problem... This seems like an easy fix, just rename the table to something else then "schema"... Why not do it?
Thank you, sincerely,
Gil. |
|
Posted by Joel_Esler on September 22, 2005 13:12:26
I went through the code today and fixed it. It might make it into the next version of Snort.
Joel Esler
SOURCEfire |
|
Posted by gilgsn on September 27, 2005 12:10:35
Thank you very much. If I re-download 2.4, will the correction be there?
I can't do without this great program and the peace of mind it brings me.
Gil. |
|
Posted by Joel_Esler on September 28, 2005 05:22:11
You can either download the src/output-plugins/spo_database.c file from cvs.snort.org, insert it and
recompile, or 2.4.2 should be published soon with this fix in it.
Joel Esler
SOURCEfire |
|
Posted by gilgsn on October 09, 2005 19:01:18
Much appreciated, thank you.
Gil. |
|
Posted by Joel_Esler on October 10, 2005 11:42:21
No problem. Thread closed.
Joel Esler
SOURCEfire |
|
|
|
|
|