fsprojects / Rezoom.SQL

Statically typechecks a common SQL dialect and translates it to various RDBMS backends
MIT License
670 stars 25 forks source link

Duplicate columns in Insert statements do not show as error #34

Closed rkosafo closed 6 years ago

rkosafo commented 6 years ago

When an Insert statement has a column duplicating, it results in a runtime error instead of a design time one.

insert into supportkinds (created, created)
  values (getdate(), getdate())

Error

Msg 264, Level 16, State 1, Line 1
The column name 'created' is specified more than once in the SET clause or column list of an INSERT. 
A column cannot be assigned more than one value in the same clause. 
Modify the clause to make sure that a column is updated only once. 
If this statement updates or inserts columns into a view, column aliasing can conceal the duplication in your code.
rspeele commented 6 years ago

Hi,

Thanks for the report. Glad that you're still getting good use out of Rezoom.SQL.

As of 0.7.2 this should be caught as a compile time error. The same problem for update statements is fixed as well.

Regards, Robert

rkosafo commented 6 years ago

Thanks. It's been good for far :)