shlomi-noach / openarkkit

Automatically exported from code.google.com/p/openarkkit
24 stars 16 forks source link

oak-online-alter-table can fail if target table only has a single row #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Easily reproducible by attempting to add a column to a table with only a single 
row.

Python will throw an exception about float() requiring a string or number as a 
parameter.

This is caused by the different "ratio_complete_query" queries not handling 
divide by zero errors that will occur when trying to calculate ratio complete.

I provided a fix patch that simply wraps these ratio calculations in 
IFNULL(…, 1) so that it considers "100%" completion ratio if it get's NULL 
returned by the calculation (assumed that was caused by divide by 0)

Original issue reported on code.google.com by lachlan....@gmail.com on 22 Sep 2011 at 11:14

Attachments:

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r194.

Original comment by shlomi.n...@gmail.com on 6 May 2013 at 7:45