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

create_defs.pl may incorrectly use 'unsigned' for a column depending on the columns name #8

Open
GoogleCodeExporter opened this issue Mar 29, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Run create_defs.pl for this table:
create table tz_bug (id bigint, wid int unsigned) engine=innodb;

This does not have the problem:
create table tz_ok (id bigint, wi int unsigned) engine=innodb;

The current regex used will make tz_bug.id use 'unsigned'

Output with the bug:
                        { /* bigint(20) */
                                name: "id",
                                type: FT_UINT,
                                fixed_length: 8,


Expected output:
                        { /* bigint(20) */
                                name: "id",
                                type: FT_INT,
                                fixed_length: 8,

Please provide any additional information below.
create_defs.pl has a bug that makes it use 'unsigned' for columns when
the column name is a substring of another column in the table and the
other column is unsigned.

This patch for IsFieldUnsigned fixes the problem.
250c250
<         return ($row->[1] =~ /$field[^,]*unsigned/i);

---
>         return ($row->[1] =~ /`$field`[^,]*unsigned/i);



Original issue reported on code.google.com by [email protected] on 8 Oct 2009 at 3:57

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