mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > PrimeNet

Reply
 
Thread Tools
Old 2016-08-23, 17:05   #1112
axn
 
axn's Avatar
 
Jun 2003

4,789 Posts
Default

Quote:
Originally Posted by Madpoo View Post
But even that means making sure any updates/inserts aren't using implicit column placements...
You could always modify the current column's data type...
axn is offline   Reply With Quote
Old 2016-08-23, 18:39   #1113
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

222378 Posts
Default

Quote:
Originally Posted by axn View Post
You could always modify the current column's data type...
Already discussed. Is irreversible (other than by restoring a backup), and presumes that all the code can handle the different type.
chalsall is offline   Reply With Quote
Old 2016-08-24, 02:43   #1114
axn
 
axn's Avatar
 
Jun 2003

4,789 Posts
Default

Quote:
Originally Posted by chalsall View Post
Already discussed.
where?
Quote:
Originally Posted by chalsall View Post
Is irreversible
Says who?
axn is offline   Reply With Quote
Old 2016-08-24, 04:31   #1115
kladner
 
kladner's Avatar
 
"Kieren"
Jul 2011
In My Own Galaxy!

2·5,059 Posts
Default

Quote:
Originally Posted by axn View Post
where?

Says who?
Look at the previous page, starting with post #1106. There certainly is discussion of pros and cons of various strategies to achieve the goal.
kladner is offline   Reply With Quote
Old 2016-08-24, 05:18   #1116
axn
 
axn's Avatar
 
Jun 2003

4,789 Posts
Default

Quote:
Originally Posted by kladner View Post
Look at the previous page, starting with post #1106. There certainly is discussion of pros and cons of various strategies to achieve the goal.
I see Madpoo's comment on it (#1107) which is more or less a "glowing endorsement" of that approach

But seriously, I don't see any discussion of it being "irreversible".

If there is a dev environment where this can be tested, this would be the way to go. For the most part, clients (.Net, Java, PHP, whatever) are agnostic about varchar vs nvarchar.
axn is offline   Reply With Quote
Old 2016-08-24, 19:08   #1117
Madpoo
Serpentine Vermin Jar
 
Madpoo's Avatar
 
Jul 2014

2×11×149 Posts
Default

Quote:
Originally Posted by axn View Post
I see Madpoo's comment on it (#1107) which is more or less a "glowing endorsement" of that approach

But seriously, I don't see any discussion of it being "irreversible".

If there is a dev environment where this can be tested, this would be the way to go. For the most part, clients (.Net, Java, PHP, whatever) are agnostic about varchar vs nvarchar.
It's irreversible in the sense that, short of going to a backup copy, once the conversion happens it could be difficult to go back to varchar in some scenarios... I'm trying to envision such a scenario but having trouble thinking of one off the top of my head.

Like I mentioned before, it *should* be straightforward since varchar ~ nvarchar for most cases, but in my day job I deal with data in all kinds of languages (Cyrillic, CJK, English, various European languages, etc) and as a result we store things in nvarchar but it wasn't always and I recall some strange things happening that we didn't really expect once we switched.

Generically it could be something like comparing a login ID when someone types in a name with accented characters... it "accidentally" works now because it's broken on both sides, but if we fix the data we have to fix the code as well to make sure UTF-8 or whatever is used so it matches again.

That's just an example though... might not apply at all, so it's one of those things we'll have to look at anywhere that references that column.

If it's limited to a few calls, changing the existing column would be my preferred solution because it's SO much easier.

I also want to do that with the various places exponents are stored, switching from INT to BIGINT so we can keep track in Primenet of the factoring > 1e9 but then we run into the funky PHP issues, and how PHP on Windows (mis)treats INT.

Otherwise INT -> BIGINT without issue (and if small enough, BIGINT -> INT) with implicit casts, no need to rework a bunch of code except when dealing with explicitly declared things in sprocs.

At some point these DB updates may evolve into a mini update like the v4 -> v5 transition, just not as drastic...more behind the scenes than anything.

As it is, the exponent limit if 2^31 (and limited in the code to 1e9) isn't a big deal, nor is the unfortunate use of varchar since it's mostly a display issue. More of a "it'd be nice to work on that some rainy weekend" project. LOL
Madpoo is offline   Reply With Quote
Old 2016-08-24, 21:19   #1118
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

3·55 Posts
Default

Quote:
Originally Posted by axn View Post
But seriously, I don't see any discussion of it being "irreversible".
There wasn't a previous discussion of it being irreversible. That was my opinion based on the fact that as soon as Aaron changed the column type it would be updated within minutes. And, like Aaron, I have found that converting 8 bit to 16 bit character fields (and back again) doesn't always do what you might expect nor hope.

Quote:
Originally Posted by axn View Post
If there is a dev environment where this can be tested, this would be the way to go. For the most part, clients (.Net, Java, PHP, whatever) are agnostic about varchar vs nvarchar.
A full regressive test for Primenet upgrades would be ideal. But this would be rather difficult to implement considering the need to capture and replay TCP traffic.

A smarter "real world" path is to add a new column, and work the code over time to migrate to only using the new column to ensure everything is sane without breaking anything all at once.
chalsall is offline   Reply With Quote
Old 2016-08-26, 07:28   #1119
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

3×13×151 Posts
Default

Quote:
Originally Posted by chalsall View Post
... converting 8 bit to 16 bit character fields ...
I don't understand the need for 16-bit fields? UTF8 only needs bytes. Browsers submit UTF8 bytes, things are compared as UTF8 bytes, responses are delivered in UTF8 byes. There is no need to convert at any point.
retina is offline   Reply With Quote
Old 2016-08-26, 18:14   #1120
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

3×55 Posts
Default

Quote:
Originally Posted by retina View Post
I don't understand the need for 16-bit fields? UTF8 only needs bytes. Browsers submit UTF8 bytes, things are compared as UTF8 bytes, responses are delivered in UTF8 byes. There is no need to convert at any point.
You might be surprised.

Have you ever interacted with a web site which your browser renders as Chinese characters which should be graphical symbols?

The implementation of UTF8 is an ongoing effort.

Not everyone has this correct yet.
chalsall is offline   Reply With Quote
Old 2016-08-26, 19:08   #1121
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

588910 Posts
Default

Quote:
Originally Posted by chalsall View Post
You might be surprised.

Have you ever interacted with a web site which your browser renders as Chinese characters which should be graphical symbols?

The implementation of UTF8 is an ongoing effort.

Not everyone has this correct yet.
Even my FF3.6 renders and submits UTF-8 without any problem. If a website sets the document type incorrectly then of course the page shows weirdly, but that is not the browsers fault. If everything is set for UTF-8 format then it will all be fine, really.
retina is offline   Reply With Quote
Old 2016-08-26, 23:11   #1122
chalsall
If I May
 
chalsall's Avatar
 
"Chris Halsall"
Sep 2002
Barbados

3×55 Posts
Default

Quote:
Originally Posted by retina View Post
Even my FF3.6 renders and submits UTF-8 without any problem. If a website sets the document type incorrectly then of course the page shows weirdly, but that is not the browsers fault. If everything is set for UTF-8 format then it will all be fine, really.
OK. I stand (or sit) corrected.

As the saying goes, no good deed goes unpunished.

Of course, those who criticise the most tend to do the least.
chalsall is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Official "Faits erronés dans de belles-lettres" thread ewmayer Lounge 39 2015-05-19 01:08
Official "all-Greek-to-me Fiction Literature and Cinema" Thread ewmayer Science & Technology 41 2014-04-16 11:54
Official "Lasciate ogne speranza" whinge-thread cheesehead Soap Box 56 2013-06-29 01:42
Official "Ernst is a deceiving bully and George is a meanie" thread cheesehead Soap Box 61 2013-06-11 04:30
Official "String copy Statement Considered Harmful" thread Dubslow Programming 19 2012-05-31 17:49

All times are UTC. The time now is 00:17.

Sat Dec 5 00:17:38 UTC 2020 up 1 day, 20:28, 0 users, load averages: 1.11, 1.17, 1.33

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.