table_function push() for NULL value doesn't work

Bug #538930 reported by Stewart Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
High
Stewart Smith
Cherry
Fix Released
High
Stewart Smith
Trunk
Fix Released
High
Stewart Smith

Bug Description

push() for a table_function column value of NULL doesn't work, instead you get the value of the last row.

embedded_innodb.config_table_function [ fail ] --- /home/stewart/drizzle/embedded-innodb/tests/../plugin/embedded_innodb/tests/r/config_table_function.result2010-03-15 08:31:25.384813577 +0300
+++ /home/stewart/drizzle/embedded-innodb/tests/../plugin/embedded_innodb/tests/r/config_table_function.reject 2010-03-15 08:31:27.304812653 +0300
@@ -76,7 +76,7 @@
 open_files ULINT 300
 read_io_threads ULINT 4
 write_io_threads ULINT 4
-pre_rollback_hook CALLBACK NULL
+pre_rollback_hook CALLBACK 4
 print_verbose_log BOOL true
 rollback_on_timeout BOOL true
 stats_sample_pages ULINT 8
@@ -86,7 +86,7 @@
 version TEXT 1.0.6.6750
 SELECT NAME,VALUE FROM DATA_DICTIONARY.INNODB_CONFIGURATION WHERE NAME IN ("data_file_path", "data_home_dir");
 NAME VALUE
-data_file_path NULL
+data_file_path true
 data_home_dir ./
 SELECT NAME,VALUE FROM DATA_DICTIONARY.INNODB_CONFIGURATION WHERE NAME = "file_per_table";
 NAME VALUE

(the failure is the current behaviour, the result file is what it *should* be).

This probably explains the timestamp default problem we saw the other day.

Related branches

Revision history for this message
Brian Aker (brianaker) wrote : Re: [Bug 538930] Re: table_function push() for NULL value doesn't work

Hi!

Do you have the declaration you made for this? (aka in code for the
column)

Cheers,
 -Brian

On Mar 14, 2010, at 10:53 PM, Stewart Smith wrote:

> ** Branch linked: lp:~stewart-flamingspork/drizzle/embedded-innodb-
> configuration-table-function
>
> ** Branch unlinked: lp:~stewart-flamingspork/drizzle/embedded-innodb-
> configuration-table-function
>
> --
> table_function push() for NULL value doesn't work
> https://bugs.launchpad.net/bugs/538930
> You received this bug notification because you are a member of
> Drizzle-
> developers, which is subscribed to Drizzle.
>
> Status in A Lightweight SQL Database for Cloud and Web: Confirmed
>
> Bug description:
> push() for a table_function column value of NULL doesn't work,
> instead you get the value of the last row.
>
>
> embedded_innodb.config_table_function [ fail ] --- /home/stewart/
> drizzle/embedded-innodb/tests/../plugin/embedded_innodb/tests/r/
> config_table_function.result2010-03-15 08:31:25.384813577 +0300
> +++ /home/stewart/drizzle/embedded-innodb/tests/../plugin/
> embedded_innodb/tests/r/config_table_function.reject 2010-03-15
> 08:31:27.304812653 +0300
> @@ -76,7 +76,7 @@
> open_files ULINT 300
> read_io_threads ULINT 4
> write_io_threads ULINT 4
> -pre_rollback_hook CALLBACK NULL
> +pre_rollback_hook CALLBACK 4
> print_verbose_log BOOL true
> rollback_on_timeout BOOL true
> stats_sample_pages ULINT 8
> @@ -86,7 +86,7 @@
> version TEXT 1.0.6.6750
> SELECT NAME,VALUE FROM DATA_DICTIONARY.INNODB_CONFIGURATION WHERE
> NAME IN ("data_file_path", "data_home_dir");
> NAME VALUE
> -data_file_path NULL
> +data_file_path true
> data_home_dir ./
> SELECT NAME,VALUE FROM DATA_DICTIONARY.INNODB_CONFIGURATION WHERE
> NAME = "file_per_table";
> NAME VALUE
>
>
> (the failure is the current behaviour, the result file is what it
> *should* be).
>
> This probably explains the timestamp default problem we saw the
> other day.
>
>

Revision history for this message
Stewart Smith (stewart) wrote :

On Mon, Mar 15, 2010 at 07:10:41AM -0000, Brian Aker wrote:
> Do you have the declaration you made for this? (aka in code for the
> column)

Now:
  add_field("VALUE", plugin::TableFunction::STRING, 64, true);

which requires this patch to work:

=== modified file 'drizzled/plugin/table_function.cc'
--- drizzled/plugin/table_function.cc 2010-02-18 17:24:08 +0000
+++ drizzled/plugin/table_function.cc 2010-03-15 09:28:33 +0000
@@ -154,12 +154,14 @@ bool plugin::TableFunction::Generator::s
 void plugin::TableFunction::Generator::push(uint64_t arg)
 {
   (*columns_iterator)->store(static_cast<int64_t>(arg), true);
+ (*columns_iterator)->set_notnull();
   columns_iterator++;
 }

 void plugin::TableFunction::Generator::push(int64_t arg)
 {
   (*columns_iterator)->store(arg, false);
+ (*columns_iterator)->set_notnull();
   columns_iterator++;
 }

--
Stewart Smith

Stewart Smith (stewart)
Changed in drizzle:
assignee: Brian Aker (brianaker) → Stewart Smith (stewart-flamingspork)
milestone: none → 2010-03-29
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.