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

mysql escaped fields #36

Open
GoogleCodeExporter opened this issue Oct 26, 2015 · 1 comment
Open

mysql escaped fields #36

GoogleCodeExporter opened this issue Oct 26, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Not sure if this is a bug or not, but I was trying to add a new field into my 
database, and it wasn't working.

in the mysqloutput.cpp file, starting on like 224, I changed the code to 
include the mysql escape character for field names:
            if( itr->second == "int" || itr->second == "bigint" )
            {
                query1 << "`" << itr->first << "`, ";
                query2 << "'" << field->getLong() << "', ";
            }
            else if( itr->second == "decimal" || itr->second == "float" )
            {
                query1 << "`" << itr->first << "`, ";
                query2 << "'" << field->getFloat() << "', ";
            }
            else
            {
                query1 << "`" << itr->first << "`, ";
                query2 << "'" << sanitize( field->getString() ) << "', ";
            }

this allows field names like "m164.largedigits" to be imported to the database.

I wasn't sure if there was a better way to do this, but it works fine.

Steve

Original issue reported on code.google.com by [email protected] on 13 Jun 2011 at 8:12

@GoogleCodeExporter
Copy link
Author

Thanks for the report.  I remember fixing the escaped names, but I am unsure if 
it was released or not.  I believe this is fixed on the trunk.
Im going to leave this open until I can make sure and so I remember that I need 
to roll a new release.

Original comment by [email protected] on 21 Jun 2011 at 9:01

  • Added labels: OpSys-All

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant