List:Commits« Previous MessageNext Message »
From:Craig L Russell Date:October 2 2011 9:22pm
Subject:bzr push into mysql-5.1-telco-7.1 branch (Craig.Russell:4295 to 4296)
View as plain text  
 4296 Craig L Russell	2011-10-02
      Add isNull and isNotNull to clusterj query

    added:
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/IsNotNullPredicateImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/IsNullPredicateImpl.java
    modified:
      storage/ndb/clusterj/clusterj-api/src/main/java/com/mysql/clusterj/query/PredicateOperand.java
      storage/ndb/clusterj/clusterj-core/Makefile.am
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainFieldHandlerImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/ParameterImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/PredicateImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/PropertyImpl.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/DomainFieldHandler.java
      storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/store/ScanFilter.java
      storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/AbstractQueryTest.java
      storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryNotNullTest.java
      storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryNullTest.java
      storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ScanFilterImpl.java
 4295 John David Duncan	2011-09-30
      This patch eliminates a warning that some Java compilers give because of a non-ascii character inside a comment.

    modified:
      storage/ndb/src/ndbjtie/test/test/MySqlUtilsCharsetMapTest.java
=== modified file 'storage/ndb/clusterj/clusterj-api/src/main/java/com/mysql/clusterj/query/PredicateOperand.java'
--- a/storage/ndb/clusterj/clusterj-api/src/main/java/com/mysql/clusterj/query/PredicateOperand.java	2011-05-26 21:04:45 +0000
+++ b/storage/ndb/clusterj/clusterj-api/src/main/java/com/mysql/clusterj/query/PredicateOperand.java	2011-10-02 21:20:50 +0000
@@ -88,4 +88,16 @@ public interface PredicateOperand {
      */
     Predicate like(PredicateOperand other);
 
+    /** Return a Predicate representing comparing this to null.
+     *
+     * @return a new Predicate
+     */
+    Predicate isNull();
+
+    /** Return a Predicate representing comparing this to not null.
+     *
+     * @return a new Predicate
+     */
+    Predicate isNotNull();
+
 }

=== modified file 'storage/ndb/clusterj/clusterj-core/Makefile.am'
--- a/storage/ndb/clusterj/clusterj-core/Makefile.am	2011-07-04 15:58:21 +0000
+++ b/storage/ndb/clusterj/clusterj-core/Makefile.am	2011-10-02 21:20:50 +0000
@@ -41,6 +41,8 @@ clusterj_core_java = \
   $(clusterj_core_src)/com/mysql/clusterj/core/query/EqualPredicateImpl.java \
   $(clusterj_core_src)/com/mysql/clusterj/core/query/GreaterEqualPredicateImpl.java \
   $(clusterj_core_src)/com/mysql/clusterj/core/query/GreaterThanPredicateImpl.java \
+  $(clusterj_core_src)/com/mysql/clusterj/core/query/IsNotNullPredicateImpl.java \
+  $(clusterj_core_src)/com/mysql/clusterj/core/query/IsNullPredicateImpl.java \
   $(clusterj_core_src)/com/mysql/clusterj/core/query/LessEqualPredicateImpl.java \
   $(clusterj_core_src)/com/mysql/clusterj/core/query/LessThanPredicateImpl.java \
   $(clusterj_core_src)/com/mysql/clusterj/core/query/LikePredicateImpl.java \

=== modified file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainFieldHandlerImpl.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainFieldHandlerImpl.java	2011-06-24 20:58:44 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/metadata/AbstractDomainFieldHandlerImpl.java	2011-10-02 21:20:50 +0000
@@ -174,6 +174,14 @@ public abstract class AbstractDomainFiel
         }
     }
 
+    public void filterIsNull(ScanFilter filter) {
+        filter.isNull(storeColumn);
+    }
+
+    public void filterIsNotNull(ScanFilter filter) {
+        filter.isNotNull(storeColumn);
+    }
+
     public String getColumnName() {
         return columnName;
     }

=== added file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/IsNotNullPredicateImpl.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/IsNotNullPredicateImpl.java	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/IsNotNullPredicateImpl.java	2011-10-02 21:20:50 +0000
@@ -0,0 +1,49 @@
+/*
+   Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
+*/
+
+package com.mysql.clusterj.core.query;
+
+import com.mysql.clusterj.core.spi.QueryExecutionContext;
+import com.mysql.clusterj.core.store.ScanFilter;
+import com.mysql.clusterj.core.store.ScanOperation;
+
+public class IsNotNullPredicateImpl extends PredicateImpl {
+
+    /** My property */
+    protected PropertyImpl property;
+
+    /** Construct a new IsNotNull predicate
+     * 
+     * @param dobj the query domain object that owns this predicate
+     * @param property the property
+     */
+    public IsNotNullPredicateImpl(QueryDomainTypeImpl<?> dobj, PropertyImpl property) {
+        super(dobj);
+        this.property = property;
+    }
+
+    /** Set the condition into the filter.
+     * @param context the query execution context with the parameter values (ignored for isNotNull)
+     * @param op the operation
+     * @param filter the filter
+     */
+    @Override
+    public void filterCmpValue(QueryExecutionContext context, ScanOperation op, ScanFilter filter) {
+        property.filterIsNotNull(filter);
+    }
+
+}

=== added file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/IsNullPredicateImpl.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/IsNullPredicateImpl.java	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/IsNullPredicateImpl.java	2011-10-02 21:20:50 +0000
@@ -0,0 +1,49 @@
+/*
+   Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
+*/
+
+package com.mysql.clusterj.core.query;
+
+import com.mysql.clusterj.core.spi.QueryExecutionContext;
+import com.mysql.clusterj.core.store.ScanFilter;
+import com.mysql.clusterj.core.store.ScanOperation;
+
+public class IsNullPredicateImpl extends PredicateImpl {
+
+    /** My property */
+    protected PropertyImpl property;
+
+    /** Construct a new IsNull predicate
+     * 
+     * @param dobj the query domain object that owns this predicate
+     * @param property the property
+     */
+    public IsNullPredicateImpl(QueryDomainTypeImpl<?> dobj, PropertyImpl property) {
+        super(dobj);
+        this.property = property;
+    }
+
+    /** Set the condition into the filter.
+     * @param context the query execution context with the parameter values (ignored for isNull)
+     * @param op the operation
+     * @param filter the filter
+     */
+    @Override
+    public void filterCmpValue(QueryExecutionContext context, ScanOperation op, ScanFilter filter) {
+        property.filterIsNull(filter);
+    }
+
+}

=== modified file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/ParameterImpl.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/ParameterImpl.java	2011-06-20 23:34:36 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/ParameterImpl.java	2011-10-02 21:20:50 +0000
@@ -118,6 +118,16 @@ public class ParameterImpl implements Pr
                 local.message("ERR_NotImplemented"));
     }
 
+    public Predicate isNull() {
+        throw new UnsupportedOperationException(
+                local.message("ERR_NotImplemented"));
+    }
+
+    public Predicate isNotNull() {
+        throw new UnsupportedOperationException(
+                local.message("ERR_NotImplemented"));
+    }
+
     public void setProperty(PropertyImpl property) {
         if (this.property != null && this.property.fmd.getType() != property.fmd.getType()) {
             throw new ClusterJUserException(local.message("ERR_Multiple_Parameter_Usage", parameterName,

=== modified file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/PredicateImpl.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/PredicateImpl.java	2011-06-20 23:34:36 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/PredicateImpl.java	2011-10-02 21:20:50 +0000
@@ -81,8 +81,7 @@ public abstract class PredicateImpl impl
     }
 
     void markBoundsForCandidateIndices(QueryExecutionContext context, CandidateIndexImpl[] candidateIndices) {
-        throw new ClusterJFatalInternalException(
-                local.message("ERR_Implementation_Should_Not_Occur"));
+        // default is nothing to do
     }
 
     public void operationSetBounds(QueryExecutionContext context,
@@ -161,10 +160,14 @@ public abstract class PredicateImpl impl
     }
 
     /** Mark all parameters as being required. */
-    public abstract void markParameters();
+    public void markParameters() {
+        // default is nothing to do
+    }
 
     /** Unmark all parameters as being required. */
-    public abstract void unmarkParameters();
+    public  void unmarkParameters() {
+        // default is nothing to do
+    }
 
     private void assertPredicateImpl(Predicate other) {
         if (!(other instanceof PredicateImpl)) {

=== modified file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/PropertyImpl.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/PropertyImpl.java	2011-06-20 23:34:36 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/query/PropertyImpl.java	2011-10-02 21:20:50 +0000
@@ -83,7 +83,7 @@ public class PropertyImpl implements Pre
             throw new ClusterJUserException(
                     local.message("ERR_Only_Parameters", "equal"));
         }
-        return (Predicate) new EqualPredicateImpl(dobj, this, (ParameterImpl)other);
+        return new EqualPredicateImpl(dobj, this, (ParameterImpl)other);
     }
 
     public Predicate between(PredicateOperand lower, PredicateOperand upper) {
@@ -91,7 +91,7 @@ public class PropertyImpl implements Pre
             throw new ClusterJUserException(
                     local.message("ERR_Only_Parameters", "between"));
         }
-        return (Predicate) new BetweenPredicateImpl(dobj, this, (ParameterImpl)lower, (ParameterImpl)upper);
+        return new BetweenPredicateImpl(dobj, this, (ParameterImpl)lower, (ParameterImpl)upper);
     }
 
     public Predicate greaterThan(PredicateOperand other) {
@@ -99,7 +99,7 @@ public class PropertyImpl implements Pre
             throw new ClusterJUserException(
                     local.message("ERR_Only_Parameters", "greaterThan"));
         }
-        return (Predicate) new GreaterThanPredicateImpl(dobj, this, (ParameterImpl)other);
+        return new GreaterThanPredicateImpl(dobj, this, (ParameterImpl)other);
     }
 
     public Predicate greaterEqual(PredicateOperand other) {
@@ -107,7 +107,7 @@ public class PropertyImpl implements Pre
             throw new ClusterJUserException(
                     local.message("ERR_Only_Parameters", "greaterEqual"));
         }
-        return (Predicate) new GreaterEqualPredicateImpl(dobj, this, (ParameterImpl)other);
+        return new GreaterEqualPredicateImpl(dobj, this, (ParameterImpl)other);
     }
 
     public Predicate lessThan(PredicateOperand other) {
@@ -115,7 +115,7 @@ public class PropertyImpl implements Pre
             throw new ClusterJUserException(
                     local.message("ERR_Only_Parameters", "lessThan"));
         }
-        return (Predicate) new LessThanPredicateImpl(dobj, this, (ParameterImpl)other);
+        return new LessThanPredicateImpl(dobj, this, (ParameterImpl)other);
     }
 
     public Predicate lessEqual(PredicateOperand other) {
@@ -123,7 +123,7 @@ public class PropertyImpl implements Pre
             throw new ClusterJUserException(
                     local.message("ERR_Only_Parameters", "lessEqual"));
         }
-        return (Predicate) new LessEqualPredicateImpl(dobj, this, (ParameterImpl)other);
+        return new LessEqualPredicateImpl(dobj, this, (ParameterImpl)other);
     }
 
     public Predicate in(PredicateOperand other) {
@@ -131,7 +131,7 @@ public class PropertyImpl implements Pre
             throw new ClusterJUserException(
                     local.message("ERR_Only_Parameters", "in"));
         }
-        return (Predicate) new InPredicateImpl(dobj, this, (ParameterImpl)other);
+        return new InPredicateImpl(dobj, this, (ParameterImpl)other);
     }
 
     public Predicate like(PredicateOperand other) {
@@ -139,7 +139,15 @@ public class PropertyImpl implements Pre
             throw new ClusterJUserException(
                     local.message("ERR_Only_Parameters", "like"));
         }
-        return (Predicate) new LikePredicateImpl(dobj, this, (ParameterImpl)other);
+        return new LikePredicateImpl(dobj, this, (ParameterImpl)other);
+    }
+
+    public Predicate isNull() {
+        return new IsNullPredicateImpl(dobj, this);
+    }
+
+    public Predicate isNotNull() {
+        return new IsNotNullPredicateImpl(dobj, this);
     }
 
     void markLowerBound(CandidateIndexImpl[] candidateIndices, PredicateImpl predicate, boolean strict) {
@@ -167,4 +175,12 @@ public class PropertyImpl implements Pre
         }
     }
 
+    public void filterIsNull(ScanFilter filter) {
+        fmd.filterIsNull(filter);
+    }
+
+    public void filterIsNotNull(ScanFilter filter) {
+        fmd.filterIsNotNull(filter);
+    }
+
 }

=== modified file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/DomainFieldHandler.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/DomainFieldHandler.java	2011-06-20 23:34:36 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/spi/DomainFieldHandler.java	2011-10-02 21:20:50 +0000
@@ -78,4 +78,8 @@ public interface DomainFieldHandler {
 
     Object getValue(QueryExecutionContext context, String parameterName);
 
+    void filterIsNull(ScanFilter filter);
+
+    void filterIsNotNull(ScanFilter filter);
+
 }

=== modified file 'storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/store/ScanFilter.java'
--- a/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/store/ScanFilter.java	2011-05-26 21:04:45 +0000
+++ b/storage/ndb/clusterj/clusterj-core/src/main/java/com/mysql/clusterj/core/store/ScanFilter.java	2011-10-02 21:20:50 +0000
@@ -59,6 +59,8 @@ public interface ScanFilter {
 
     public void isNull(Column storeColumn);
     
+    public void isNotNull(Column storeColumn);
+    
     public void delete();
 
 }

=== modified file 'storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/AbstractQueryTest.java'
--- a/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/AbstractQueryTest.java	2011-07-05 22:11:45 +0000
+++ b/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/AbstractQueryTest.java	2011-10-02 21:20:50 +0000
@@ -87,6 +87,8 @@ abstract public class AbstractQueryTest 
         public PredicateOperand paramUpperPredicate;
         public PredicateOperand paramInPredicate;
         public Predicate equal;
+        public Predicate isNull;
+        public Predicate isNotNull;
         public Predicate equalOrEqual;
         public Predicate greaterThan;
         public Predicate greaterEqual;
@@ -117,6 +119,8 @@ abstract public class AbstractQueryTest 
         public PredicateOperand extraParamInPredicate;
         public PredicateOperand extraProperty;
         public Predicate extraEqual;
+        public Predicate extraIsNull;
+        public Predicate extraIsNotNull;
         public Predicate extraGreaterThan;
         public Predicate extraGreaterEqual;
         public Predicate extraLessThan;
@@ -150,6 +154,8 @@ abstract public class AbstractQueryTest 
             propertyPredicate = dobj.get(propertyName);
             // comparison operations
             equal = propertyPredicate.equal(paramEqualPredicate);
+            isNull = propertyPredicate.isNull();
+            isNotNull = propertyPredicate.isNotNull();
             greaterThan = propertyPredicate.greaterThan(paramLowerPredicate);
             greaterEqual = propertyPredicate.greaterEqual(paramLowerPredicate);
             lessThan = propertyPredicate.lessThan(paramUpperPredicate);
@@ -186,6 +192,8 @@ abstract public class AbstractQueryTest 
             this.extraProperty = dobj.get(extraPropertyName);
             // comparison operations
             this.extraEqual = extraProperty.equal(extraParamEqualPredicate);
+            this.extraIsNull = extraProperty.isNull();
+            this.extraIsNotNull = extraProperty.isNotNull();
             this.extraGreaterThan = extraProperty.greaterThan(extraParamLowerPredicate);
             this.extraGreaterEqual = extraProperty.greaterEqual(extraParamLowerPredicate);
             this.extraLessThan = extraProperty.lessThan(extraParamUpperPredicate);
@@ -307,6 +315,26 @@ abstract public class AbstractQueryTest 
             }
             };
                     
+    PredicateProvider extraIsNullPredicateProvider = 
+        new PredicateProvider() {
+            public Predicate getPredicate(QueryHolder holder) {
+                return holder.extraIsNull;
+                }
+            public String toString() {
+                return " isNull";
+            }
+            };
+                            
+    PredicateProvider extraIsNotNullPredicateProvider = 
+        new PredicateProvider() {
+            public Predicate getPredicate(QueryHolder holder) {
+                return holder.extraIsNotNull;
+                }
+            public String toString() {
+                return " isNotNull";
+            }
+            };
+                                    
     /** Print the result instance. Override this in a subclass if needed.
      * 
      * @param instance the instance to print if needed
@@ -330,6 +358,32 @@ abstract public class AbstractQueryTest 
         tx.commit();
     }
 
+    public void isNullQuery(String propertyName, String expectedIndex, int... expected) {
+        tx.begin();
+        QueryHolder holder = new QueryHolder(getInstanceType(), propertyName, expectedIndex);
+        // specify the where clause
+        holder.dobj.where(holder.isNull);
+        // create the query
+        holder.createQuery(session);
+        // get the results
+        holder.setExpectedResultIds(expected);
+        holder.checkResults(propertyName + " isNull");
+        tx.commit();
+    }
+
+    public void isNotNullQuery(String propertyName, String expectedIndex, int... expected) {
+        tx.begin();
+        QueryHolder holder = new QueryHolder(getInstanceType(), propertyName, expectedIndex);
+        // specify the where clause
+        holder.dobj.where(holder.isNotNull);
+        // create the query
+        holder.createQuery(session);
+        // get the results
+        holder.setExpectedResultIds(expected);
+        holder.checkResults(propertyName + " isNotNull");
+        tx.commit();
+    }
+
     public void likeQuery(String propertyName, String expectedIndex,
             Object parameterValue, int... expected) {
         tx.begin();

=== modified file 'storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryNotNullTest.java'
--- a/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryNotNullTest.java	2011-06-30 16:04:23 +0000
+++ b/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryNotNullTest.java	2011-10-02 21:20:50 +0000
@@ -1,6 +1,5 @@
 /*
-Copyright (c) 2010 Sun Microsystems, Inc.
-Use is subject to license terms.
+   Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -110,4 +109,36 @@ public class QueryNotNullTest extends Ab
         failOnError();        
     }
 
+    public void testExtraEqualIsNotNull() {
+        equalAnd1ExtraQuery("int_not_null_btree", 8, "int_null_none", extraIsNotNullPredicateProvider, "dummy unused value", "idx_int_not_null_btree", 8);
+        equalAnd1ExtraQuery("int_not_null_hash", 8, "int_null_none", extraIsNotNullPredicateProvider, "dummy unused value", "none", 8);
+        equalAnd1ExtraQuery("int_not_null_both", 8, "int_null_none", extraIsNotNullPredicateProvider, "dummy unused value", "idx_int_not_null_both", 8);
+        equalAnd1ExtraQuery("int_not_null_none", 8, "int_null_none", extraIsNotNullPredicateProvider, "dummy unused value", "none", 8);
+        failOnError();        
+    }
+
+    public void testBtreeIsNotNull() {
+        isNotNullQuery("int_not_null_btree", "none", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        isNotNullQuery("int_null_btree", "none", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        failOnError();        
+    }
+
+    public void testHashIsNotNull() {
+        isNotNullQuery("int_not_null_hash", "none", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        isNotNullQuery("int_null_hash", "none", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        failOnError();        
+    }
+
+    public void testBothIsNotNull() {
+        isNotNullQuery("int_not_null_both", "none", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        isNotNullQuery("int_null_both", "none", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        failOnError();        
+    }
+
+    public void testNoneIsNotNull() {
+        isNotNullQuery("int_not_null_none", "none", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        isNotNullQuery("int_null_none", "none", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+        failOnError();        
+    }
+
 }

=== modified file 'storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryNullTest.java'
--- a/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryNullTest.java	2011-06-30 16:04:23 +0000
+++ b/storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/QueryNullTest.java	2011-10-02 21:20:50 +0000
@@ -1,6 +1,5 @@
 /*
-Copyright (c) 2010 Sun Microsystems, Inc.
-Use is subject to license terms.
+   Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -113,6 +112,38 @@ public class QueryNullTest extends Abstr
         failOnError();        
     }
 
+    public void testExtraIsNull() {
+        equalAnd1ExtraQuery("int_not_null_btree", 8, "int_null_none", extraIsNullPredicateProvider, "dummy unused value", "idx_int_not_null_btree");
+        equalAnd1ExtraQuery("int_not_null_hash", 8, "int_null_none", extraIsNullPredicateProvider, "dummy unused value", "none");
+        equalAnd1ExtraQuery("int_not_null_both", 8, "int_null_none", extraIsNullPredicateProvider, "dummy unused value", "idx_int_not_null_both");
+        equalAnd1ExtraQuery("int_not_null_none", 8, "int_null_none", extraIsNullPredicateProvider, "dummy unused value", "none");
+        failOnError();        
+    }
+
+    public void testBtreeIsNull() {
+        isNullQuery("int_not_null_btree", "none");
+        isNullQuery("int_null_btree", "none");
+        failOnError();        
+    }
+
+    public void testHashIsNull() {
+        isNullQuery("int_not_null_hash", "none");
+        isNullQuery("int_null_hash", "none");
+        failOnError();        
+    }
+
+    public void testBothIsNull() {
+        isNullQuery("int_not_null_both", "none");
+        isNullQuery("int_null_both", "none");
+        failOnError();        
+    }
+
+    public void testNoneIsNull() {
+        isNullQuery("int_not_null_none", "none");
+        isNullQuery("int_null_none", "none");
+        failOnError();        
+    }
+
     public void testGreaterThanNull() {
         try {
             greaterThanQuery("int_not_null_btree", "none", null);

=== modified file 'storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ScanFilterImpl.java'
--- a/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ScanFilterImpl.java	2011-06-30 16:04:23 +0000
+++ b/storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ScanFilterImpl.java	2011-10-02 21:20:50 +0000
@@ -160,6 +160,11 @@ class ScanFilterImpl implements ScanFilt
         handleError(returnCode, ndbScanFilter);
     }
 
+    public void isNotNull(Column storeColumn) {
+        int returnCode = ndbScanFilter.isnotnull(storeColumn.getColumnId());
+        handleError(returnCode, ndbScanFilter);
+    }
+
     public void end() {
         int returnCode = ndbScanFilter.end();
         handleError(returnCode, ndbScanFilter);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (Craig.Russell:4295 to 4296) Craig L Russell3 Oct