You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Craig L Russell <cr...@oracle.com> on 2013/12/27 04:54:30 UTC

Apply this patch

Apply [1] 

Here's what I get with adapter ndb:

t6 Expected error received: { ndb_error: 
   { message: 'Illegal null attribute',
     handler_error_code: -1,
     code: 839,
     classification: 'ConstraintViolation',
     status: 'PermanentError' },
  message: 'Illegal null attribute [839]',
  sqlstate: '23000',
  cause: null }
[pass] t_basic DefaultValuesTest.js testPersistDomainObjectNotNullNoDefaultUndefined
t7 Expected error received: { message: 'Error',
  sqlstate: '23000',
  ndb_error: null,
  cause: 
   { ndb_error: 
      { message: 'Constraint violation e.g. duplicate value in unique index',
        handler_error_code: 121,
        code: 893,
        classification: 'ConstraintViolation',
        status: 'PermanentError' },
     message: 'Constraint violation e.g. duplicate value in unique index [893]',
     sqlstate: '23000',
     cause: [Circular] } }

Here's what I get with adapter mysql:

t6 Expected error received: { code: 0,
  sqlstate: 'HY000',
  message: 'ER_NO_DEFAULT_FOR_FIELD: Field \'magic\' doesn\'t have a default value',
  cause: { [Error: ER_NO_DEFAULT_FOR_FIELD: Field 'magic' doesn't have a default value] code: 'ER_NO_DEFAULT_FOR_FIELD', index: 0 } }
[pass] t_basic DefaultValuesTest.js testPersistDomainObjectNotNullNoDefaultUndefined

t7 Expected error received: { code: 1048,
  sqlstate: '23000',
  message: 'ER_BAD_NULL_ERROR: Column \'magic\' cannot be null',
  cause: { [Error: ER_BAD_NULL_ERROR: Column 'magic' cannot be null] code: 'ER_BAD_NULL_ERROR', index: 0, sqlstate: '23000' } }

Which is correct? Both? Neither?

Craig

[1] === modified file 'test/t_basic/DefaultValuesTest.js'
--- test/t_basic/DefaultValuesTest.js	2013-04-29 02:17:42 +0000
+++ test/t_basic/DefaultValuesTest.js	2013-12-27 03:36:46 +0000
@@ -157,6 +157,8 @@ t6.run = function() {
     session.persist(object, function(err, session2) {
       if (!err) {
         testCase.appendErrorMessage('t6 Expected error not received for not null no default undefined');
+      } else {
+        console.log('t6 Expected error received:', err);
       }
       testCase.failOnError();
     }, session);
@@ -173,7 +175,9 @@ t7.run = function() {
   fail_openSession(testCase, function(session) {
     session.persist(object, function(err, session2) {
       if (!err) {
-        testCase.appendErrorMessage('t6 Expected error not received for not null no default null');
+        testCase.appendErrorMessage('t7 Expected error not received for not null no default null');
+      } else {
+        console.log('t7 Expected error received:', err);
       }
       testCase.failOnError();
     }, session);



Craig L Russell
Architect, Oracle
http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@oracle.com
P.S. A good JDO? O, Gasp!