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

add next partition not using datetime fail after a value >= 10000 (or thereabouts) #75

Open
GoogleCodeExporter opened this issue Jun 18, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

Which version of common_schema are you using? (specify
revision+distribution)
common_schema-2.2.sql

Which component is failing? (specify the view, function, etc.)
 view _sql_range_partitions_summary

What is the expected output? What do you see instead?
I have partitions set up by range using the id field.
I manually create partitions by range of 2000,4000,6000

I call the common_schema function sql_add_next_partition. It adds a new 
partition of range less than 8000
I call it again, it adds a partition of range less than 10,000
I call it again, it complains of a duplicated range.

I've narrowed it down to this code in the view noted above:
    MAX(IF(PARTITION_DESCRIPTION != 'MAXVALUE', 
      IFNULL(_as_datetime(unquote(PARTITION_DESCRIPTION)), CAST(PARTITION_DESCRIPTION AS SIGNED)), 
      NULL)
_as_datetime seems to have problems with the value 10000, so the result of the 
query is 8000. The diff is added to this value to get the next partition name 
of p_10000 which already exists.
The code does not seem to manage datetimes and integral values it seems.

Original issue reported on code.google.com by [email protected] on 27 Apr 2015 at 7:39

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