Lori Olson
2006-Apr-11 22:29 UTC
[Rails] Oracle unit test problem in Rails 1.1.2/Ruby-OCI 0.1.14
I''ve upgraded to Rails 1.1.2, and I''m trying to push this change through to our build server (Linux/Oracle) and we are getting some errors in the unit tests using Oracle. Looking at the data in the tests reveals a precision problem. Looking at the tables tells the whole story. My development database contains this table: SQL> describe dls_grids; Name Null? Type ----------------------------------------- -------- ---------------------------- ID NOT NULL NUMBER(38) LSD VARCHAR2(2) SECTION VARCHAR2(2) TOWNSHIP VARCHAR2(3) RANGE VARCHAR2(2) MERIDIAN VARCHAR2(2) LATITUDE_MIN NUMBER(8,5) LATITUDE_MAX NUMBER(8,5) LONGITUDE_MIN NUMBER(8,5) LONGITUDE_MAX NUMBER(8,5) But the table that gets created in test looks like this: SQL> describe dls_grids; Name Null? Type ----------------------------------------- -------- ---------------------------- ID NOT NULL NUMBER(38) LSD VARCHAR2(2) SECTION VARCHAR2(2) TOWNSHIP VARCHAR2(3) RANGE VARCHAR2(2) MERIDIAN VARCHAR2(2) LATITUDE_MIN NUMBER(8) LATITUDE_MAX NUMBER(8) LONGITUDE_MIN NUMBER(8) LONGITUDE_MAX NUMBER(8) This is a critical issue for our production application. -- Posted via http://www.ruby-forum.com/.
Wilson Bilkovich
2006-Apr-11 23:41 UTC
[Rails] Oracle unit test problem in Rails 1.1.2/Ruby-OCI 0.1.14
On 4/11/06, Lori Olson <loriolson@labradortechnologies.com> wrote:> I''ve upgraded to Rails 1.1.2, and I''m trying to push this change through > to our build server (Linux/Oracle) and we are getting some errors in the > unit tests using Oracle. Looking at the data in the tests reveals a > precision problem. Looking at the tables tells the whole story. > > My development database contains this table: >Are you using migrations to create that table, or db:test:clone_structure? If you''re using a migration, you could use "execute" to issue the direct DDL statement.
Lori Olson
2006-Apr-12 01:44 UTC
[Rails] Re: Oracle unit test problem in Rails 1.1.2/Ruby-OCI 0.1.14
Wilson Bilkovich wrote:> On 4/11/06, Lori Olson <loriolson@labradortechnologies.com> wrote: >> I''ve upgraded to Rails 1.1.2, and I''m trying to push this change through >> to our build server (Linux/Oracle) and we are getting some errors in the >> unit tests using Oracle. Looking at the data in the tests reveals a >> precision problem. Looking at the tables tells the whole story. >> >> My development database contains this table: >> > > Are you using migrations to create that table, or > db:test:clone_structure? > If you''re using a migration, you could use "execute" to issue the > direct DDL statement.You are misunderstanding. The Oracle DEVELOPMENT database, created by migrations, is working just fine. The Oracle TEST database, created AUTOMATICALLY by RAKE, in the process of executing a "rake test:units" command is BAD. The database cloning for Oracle is *broken*. -- Posted via http://www.ruby-forum.com/.
Wilson Bilkovich
2006-Apr-12 02:00 UTC
[Rails] Re: Oracle unit test problem in Rails 1.1.2/Ruby-OCI 0.1.14
On 4/11/06, Lori Olson <loriolson@labradortechnologies.com> wrote:> Wilson Bilkovich wrote: > > On 4/11/06, Lori Olson <loriolson@labradortechnologies.com> wrote: > >> I''ve upgraded to Rails 1.1.2, and I''m trying to push this change through > >> to our build server (Linux/Oracle) and we are getting some errors in the > >> unit tests using Oracle. Looking at the data in the tests reveals a > >> precision problem. Looking at the tables tells the whole story. > >> > >> My development database contains this table: > >> > > > > Are you using migrations to create that table, or > > db:test:clone_structure? > > If you''re using a migration, you could use "execute" to issue the > > direct DDL statement. > > You are misunderstanding. The Oracle DEVELOPMENT database, created by > migrations, is working just fine. The Oracle TEST database, created > AUTOMATICALLY by RAKE, in the process of executing a "rake test:units" > command is BAD. > > The database cloning for Oracle is *broken*. >I understood that you were talking about the test database, but you''re right, it does look broken. I just had a conversation on IRC that revealed that the Oracle schema dumper also doesn''t handle boolean (i.e. NUMBER(1)) columns properly. Sounds like it''s time for a ticket.
Lori Olson
2006-Apr-12 02:04 UTC
[Rails] Re: Re: Oracle unit test problem in Rails 1.1.2/Ruby-OCI 0.1
Wilson Bilkovich wrote:> On 4/11/06, Lori Olson <loriolson@labradortechnologies.com> wrote: >> > Are you using migrations to create that table, or >> > I understood that you were talking about the test database, but you''re > right, it does look broken. I just had a conversation on IRC that > revealed that the Oracle schema dumper also doesn''t handle boolean > (i.e. NUMBER(1)) columns properly. > > Sounds like it''s time for a ticket.Okey, dokey. I''ll see about posting an example. Thanks for confirming. -- Posted via http://www.ruby-forum.com/.
Lori Olson
2006-Apr-12 04:25 UTC
[Rails] Re: Re: Oracle unit test problem in Rails 1.1.2/Ruby-OCI 0.1
Lori Olson wrote:> Wilson Bilkovich wrote: >> On 4/11/06, Lori Olson <loriolson@labradortechnologies.com> wrote: >>> > Are you using migrations to create that table, or >>> >> I understood that you were talking about the test database, but you''re >> right, it does look broken. I just had a conversation on IRC that >> revealed that the Oracle schema dumper also doesn''t handle boolean >> (i.e. NUMBER(1)) columns properly. >> >> Sounds like it''s time for a ticket. > > Okey, dokey. I''ll see about posting an example. Thanks for confirming.Ok, this is bad. It doesn''t actually work right for MySQL, either. This is the development database: mysql> describe dls_grids; +---------------+------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | lsd | varchar(2) | YES | | NULL | | | section | varchar(2) | YES | | NULL | | | township | varchar(3) | YES | | NULL | | | range | varchar(2) | YES | | NULL | | | meridian | varchar(2) | YES | | NULL | | | latitude_min | float(8,5) | YES | | NULL | | | latitude_max | float(8,5) | YES | | NULL | | | longitude_min | float(8,5) | YES | | NULL | | | longitude_max | float(8,5) | YES | | NULL | | +---------------+------------+------+-----+---------+----------------+ 10 rows in set (0.03 sec) And then this is the test database, after running a rake test:units : mysql> describe dls_grids; +---------------+------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------------+------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | lsd | varchar(2) | YES | | NULL | | | section | varchar(2) | YES | | NULL | | | township | varchar(3) | YES | | NULL | | | range | varchar(2) | YES | | NULL | | | meridian | varchar(2) | YES | | NULL | | | latitude_min | float | YES | | NULL | | | latitude_max | float | YES | | NULL | | | longitude_min | float | YES | | NULL | | | longitude_max | float | YES | | NULL | | +---------------+------------+------+-----+---------+----------------+ 10 rows in set (0.03 sec) -- Posted via http://www.ruby-forum.com/.