Sunday, December 22, 2019

Re: [google-cloud-sql-discuss] Create table command setting Default value for column not working

Hi Matt,
I figured this out. As Google cloud SQL is still on MySQL 5.7 , it is not supporting function use in default. My local MySQL was 8x so it was working there. To overcome this issue, i had to pass UUID from node.js app itself than depending on MySQL.

Thanks a lot
Kiran


On 23-Dec-2019 4:20 AM, 'Matt Turner' via Google Cloud SQL discuss <google-cloud-sql-discuss@googlegroups.com> wrote:
Kiran,

Do you know which part of the default is causing the error? Have you tried simplifying as a test? Also check the quotes you sometimes get conversions on copy and paste. 

Regards,

Matt

On Mon, 23 Dec 2019 at 6:47 am, Kiran Padiyar <kiran.padiyar@zenspectra.com> wrote:
Hi, 
We have set of tables developed earlier in onprem MySQL database. Now we are moving to Google SQL for production run. 
For example a sample table creation like follows onprem MySQL works perfect.
create table myschema.test (
valt int auto_increment primary key,
valkey varchar(50) default (replace(uuid(),''-'','''')),
valtree varchar(30)
)

However, when we connect to Google SQL instance and try to create same table, it shows error at the default. If we remove default for the column it works all ok.
Any idea how to fix this?

Thank you
Kiran

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/ded64fbc-e642-41b9-ad10-166a08a7a9ea%40googlegroups.com.
--


  
Matt Turner | mattyt@google.com
  Cloud Customer Engineer
  +61 (0) 447 533 754
  
Perth, Western Australia
The Sustainable Cloud

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/CADy4DuH%2BWQxfKd7mmYnwW14tZjGpoeaGAwr6JNa3Tooz9ZYmrw%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/fda8cc79-74f0-48c6-adf5-536ae22869f8%40email.android.com.

No comments:

Post a Comment