Giter Site home page Giter Site logo

Comments (5)

cdevienne avatar cdevienne commented on August 17, 2024

If a clean the test db (by dropping the user table), the error becomes:

2016/08/01 11:58:49 INSERT INTO actors(id)
VALUES(?);
2016/08/01 11:58:49 [5]
2016/08/01 11:58:49 
2016/08/01 11:58:49 INSERT INTO actors(id)
VALUES(?);
2016/08/01 11:58:49 [10]
2016/08/01 11:58:49 
CREATE TABLE user (
    unknown VARCHAR(255),
    id VARCHAR(255),
    profile_id BIGINT,
    level INT,
    money FLOAT,
    email VARCHAR(255) UNIQUE NOT NULL,
    score FLOAT,
    facebook_id BIGINT,
    facebook_profile VARCHAR(255),
    user_type VARCHAR(255) DEFAULT 'guest',
    premium BOOLEAN,
    created_at TIMESTAMP NOT NULL,
    deleted_at TIMESTAMP NULL,
    secondary_id VARCHAR(255),
    profile_name VARCHAR(255),
    full_name VARCHAR(255) NOT NULL DEFAULT '',
    password TEXT,
    PRIMARY KEY(id, secondary_id),
    FOREIGN KEY(facebook_id, facebook_profile) REFERENCES facebook(id, profile_id),
    FOREIGN KEY(profile_id, profile_name) REFERENCES profile(id, name)
);
CREATE INDEX i_unknown ON user(unknown);
CREATE INDEX i_full_name_password ON user(full_name, password); 

CREATE TABLE user (
    id BIGINT
); 

CREATE TABLE user (
    _id VARCHAR(36),
    email VARCHAR(255) UNIQUE NOT NULL,
    PRIMARY KEY(_id)
); 

Invalid tag key=tag_should_raise_err value=val
--- FAIL: TestMysql (0.12s)
        Error Trace:    5: 
    Error:      Expected nil, but got: &errors.errorString{s:"Metadata is empty"}

        Error Trace:    mysql_test.go:52
    Error:      Expected nil, but got: &mysql.MySQLError{Number:0x42b, Message:"Invalid default value for 'expires_at'"}

        Error Trace:    mysql_test.go:70
    Error:      Expected nil, but got: &mysql.MySQLError{Number:0x47a, Message:"Table 'qb_test.session' doesn't exist"}

        Error Trace:    mysql_test.go:77
    Error:      Not equal: "" (expected)
                    != "[email protected]" (actual)

        Error Trace:    mysql_test.go:78
    Error:      Not equal: "" (expected)
                    != "Jack Nicholson" (actual)

        Error Trace:    mysql_test.go:79
    Error:      Not equal: "" (expected)
                    != "Jack Nicholson, an American actor, producer, screen-writer and director, is a three-time Academy Award winner and twelve-time nominee." (actual)

        Error Trace:    mysql_test.go:88
    Error:      Expected nil, but got: &mysql.MySQLError{Number:0x47a, Message:"Table 'qb_test.session' doesn't exist"}

        Error Trace:    mysql_test.go:89
    Error:      Not equal: 0 (expected)
                    != 1 (actual)

panic: runtime error: index out of range [recovered]
    panic: runtime error: index out of range

goroutine 78 [running]:
panic(0x9ca140, 0xc82000a0f0)
    /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
testing.tRunner.func1(0xc8204562d0)
    /usr/lib/go-1.6/src/testing/testing.go:467 +0x192
panic(0x9ca140, 0xc82000a0f0)
    /usr/lib/go-1.6/src/runtime/panic.go:443 +0x4e9
github.com/aacanakin/qb.(*MysqlTestSuite).TestMysql(0xc82032a4e0)
    /home/cdevienne/ws/ll/golang/src/github.com/aacanakin/qb/mysql_test.go:91 +0x2144
reflect.Value.call(0x902920, 0xa592b8, 0x13, 0xa62070, 0x4, 0xc820121ef8, 0x1, 0x1, 0x0, 0x0, ...)
    /usr/lib/go-1.6/src/reflect/value.go:435 +0x120d
reflect.Value.Call(0x902920, 0xa592b8, 0x13, 0xc820121ef8, 0x1, 0x1, 0x0, 0x0, 0x0)
    /usr/lib/go-1.6/src/reflect/value.go:303 +0xb1
github.com/stretchr/testify/suite.Run.func2(0xc8204562d0)
    /home/cdevienne/ws/ll/golang/src/github.com/stretchr/testify/suite/suite.go:95 +0x230
testing.tRunner(0xc8204562d0, 0xc82032b6e0)
    /usr/lib/go-1.6/src/testing/testing.go:473 +0x98
created by testing.RunTests
    /usr/lib/go-1.6/src/testing/testing.go:582 +0x892
exit status 2
FAIL    github.com/aacanakin/qb 0.161s

from qb.

cdevienne avatar cdevienne commented on August 17, 2024

I finally got the tests to pass by removing the "notnull" constraint on ExpiresAt (not CreatedAt, it is very weird).
The error when the constraint notnull is set is "Invalid default value for 'expires_at'".
I have no clue why... Any idea ?

from qb.

cdevienne avatar cdevienne commented on August 17, 2024

Yes I will submit a patch (now that I can run it, I am more confident pushing a PR).
I am at the airport though, so the PR might not be ready before tomorrow.

from qb.

cdevienne avatar cdevienne commented on August 17, 2024

I created a PR for the DNS passed as envvars.
The original issue remains: I still get a "Invalid default value for 'expires_at'".

If it helps, here is the output of "mysql --version":

mysql Ver 14.14 Distrib 5.7.13, for Linux (x86_64) using EditLine wrapper

from qb.

aacanakin avatar aacanakin commented on August 17, 2024

Ok then. Let me change the issue title to that.

from qb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.