.NET Exception on synchronise with 'Force Column Order'
senorplankton
Posts: 12
I've just come across a problem when trying to create the sync script between two dbs when 'Force Column Order' is set .
This happens in both 1.0.0.44 and 1.0.0.48.
It appears to occur when there is a difference in a table with a column definition of "timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP". The sync process has a problem with this and incorrectly flags it up as an invalid default (No value specified for a NOT NULL column). <<<EDIT - this is covered in http://www.red-gate.com/messageboard/vi ... 3706#43706 >>>
No matter which response is selected, the error occurs. Removing 'Force Column Order' prevents it.
Here is the source for two tables which will cause the error
This is the jist of the error text -
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at D.a(ColumnDifference )
at z.a(TableDifference )
at z.GetSql()
at RedGate.MySQL.Actions.SyncScript.<get_Lines>d__0.MoveNext()
at RedGate.MySQL.Actions.SyncScript.GetScript()
at RedGate.MySQL.Compare.EngineController.State.Script.ToString()
at an.a(Object , EventArgs )
at System.EventHandler.Invoke(Object sender, EventArgs e)
at bc.a(EventHandler )
at bc.f()
at bc.a.a()
at bc.NextPage()
at bb.a(Object , EventArgs )
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
<cut>
This happens in both 1.0.0.44 and 1.0.0.48.
It appears to occur when there is a difference in a table with a column definition of "timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP". The sync process has a problem with this and incorrectly flags it up as an invalid default (No value specified for a NOT NULL column). <<<EDIT - this is covered in http://www.red-gate.com/messageboard/vi ... 3706#43706 >>>
No matter which response is selected, the error occurs. Removing 'Force Column Order' prevents it.
Here is the source for two tables which will cause the error
CREATE TABLE `db1`.`test` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(45) NOT NULL, `new_field` varchar(45) NOT NULL, `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `db2`.`test` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(45) NOT NULL, `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
This is the jist of the error text -
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at D.a(ColumnDifference )
at z.a(TableDifference )
at z.GetSql()
at RedGate.MySQL.Actions.SyncScript.<get_Lines>d__0.MoveNext()
at RedGate.MySQL.Actions.SyncScript.GetScript()
at RedGate.MySQL.Compare.EngineController.State.Script.ToString()
at an.a(Object , EventArgs )
at System.EventHandler.Invoke(Object sender, EventArgs e)
at bc.a(EventHandler )
at bc.f()
at bc.a.a()
at bc.NextPage()
at bb.a(Object , EventArgs )
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
<cut>