Bug #82064 Date format error on SQL syntax
Submitted: 30 Jun 2016 6:02 Modified: 30 Jun 2016 6:37
Reporter: 현철 신 Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL for Windows: MySQL for Excel Severity:S2 (Serious)
Version:1.3.6 OS:Microsoft Windows (7 64bit)
Assigned to: CPU Architecture:Any
Tags: date, error, format, SQL, syntax

[30 Jun 2016 6:02] 현철 신
Description:
SQL syntax Error when I try to 'Append data' to MySQL
its syntax is like below.
INSERT INTO databaseName VALUES
('AAA','BBB','123',2016-06-29 00:00:00)

This only happens in 1.3.6 version. 1.3.4 and 1.3.5 version is okay.

MySQLForExcel Error: 1 : Application Exception on MySqlStatement.Execute - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '00:00:00),
('AAA','BBB','123',2016-06-29 00:00:00),
('CCC ' at line 4
   위치: MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   위치: MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
   위치: MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
   위치: MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
   위치: MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   위치: MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   위치: MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery()
   위치: MySQL.ForExcel.Classes.MySqlStatement.Execute(MySqlCommand mySqlCommand, UInt32 executionOrder, Boolean useOptimisticUpdate)
    DateTime=2016-06-30T04:14:41.4449177Z
    Timestamp=172168519407
    Callstack=   위치: System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   위치: System.Environment.get_StackTrace()
   위치: System.Diagnostics.TraceEventCache.get_Callstack()
   위치: System.Diagnostics.TraceListener.WriteFooter(TraceEventCache eventCache)
   위치: System.Diagnostics.TraceListener.TraceEvent(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, String message)
   위치: System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message)
   위치: MySQL.Utility.Classes.MySqlSourceTrace.WriteToLog(String message, SourceLevels messageType, Int32 messageId)
   위치: MySQL.Utility.Classes.MySqlSourceTrace.WriteAppErrorToLog(Exception exception, SourceLevels messageType, Boolean useInnerException)
   위치: MySQL.ForExcel.Classes.MySqlStatement.Execute(MySqlCommand mySqlCommand, UInt32 executionOrder, Boolean useOptimisticUpdate)
   위치: MySQL.ForExcel.Forms.MySqlScriptDialog.ApplyScript()
   위치: MySQL.ForExcel.Classes.MySqlDataTable.PushData(Boolean showMySqlScriptDialog)
   위치: MySQL.ForExcel.Forms.AppendDataForm.AppendData()
   위치: MySQL.ForExcel.Forms.AppendDataForm.AppendDataForm_FormClosing(Object sender, FormClosingEventArgs e)
   위치: System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
   위치: System.Windows.Forms.Form.CheckCloseDialog(Boolean closingOnly)
   위치: System.Windows.Forms.Application.ThreadContext.LocalModalMessageLoop(Form form)
   위치: System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   위치: System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   위치: System.Windows.Forms.Application.RunDialog(Form form)
   위치: System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
   위치: System.Windows.Forms.Form.ShowDialog()
   위치: MySQL.ForExcel.Controls.ExcelAddInPane.AppendDataToTable(DbTable toTableObject)
   위치: MySQL.ForExcel.Panels.DbObjectSelectionPanel.ExportDataToTable(DbTable appendToTable)
   위치: MySQL.ForExcel.Panels.DbObjectSelectionPanel.AppendDataHotLabel_Click(Object sender, EventArgs e)
   위치: System.Windows.Forms.Control.OnClick(EventArgs e)
   위치: MySQL.ForExcel.Controls.HotLabel.OnClick(EventArgs e)
   위치: System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   위치: System.Windows.Forms.Control.WndProc(Message& m)
   위치: System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   위치: System.Windows.Forms.ContainerControl.WndProc(Message& m)
   위치: System.Windows.Forms.UserControl.WndProc(Message& m)
   위치: System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   위치: System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   위치: System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

How to repeat:
Select cells including Date-formatted cells, and try MySQL for Excel 'Append data'

Suggested fix:
wrong syntax:
INSERT INTO databaseName VALUES
('AAA','BBB','123',2016-06-29 00:00:00)

correct syntax:
INSERT INTO databaseName VALUES
('AAA','BBB','123','2016-06-29 00:00:00')
[30 Jun 2016 6:37] Chiranjeevi Battula
Hello 현철 신,

Thank you for the bug report.
This is most likely duplicate of Bug #81970, please see Bug #81970.

Thanks,
Chiranjeevi.