[Cloud] Re: Scratch database instance?

2023-01-25 Thread Kunal Mehta
Hi, On 1/25/23 11:42, Roy Smith wrote: 2) Is there a scratch database instance I can run unit tests against?  I'd rather not do this kind of testing against anything that's in production, to ensure I don't accidentally cause any damage. Normally I just spin up a MariaDB container locally in

[Cloud] Re: Scratch database instance?

2023-01-25 Thread Platonides
MediaWiki uses a VARBINARY(255) NOT NULL for page_title in doubt, you would use VARCHAR(255) over other length, since that's the largest value for a VARCHAR (a value larger than 255 would automatically become a MEDIUMTEXT column) > sqlalchemy.exc.OperationalError:

[Cloud] Re: Scratch database instance?

2023-01-25 Thread Roy Smith
The next problem is that apparently mysql can't index a VARCHAR(255). You get: > sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1709, 'Index > column size too large. The maximum column size is 767 bytes.') One solution I saw mentioned was to not index the string, but to

[Cloud] Re: Scratch database instance?

2023-01-25 Thread Daniel Zahn
On Wed, Jan 25, 2023 at 12:33 PM Roy Smith wrote: > > Thanks. This field is intended to hold a wikipedia page title (including the > namespace). Would 255 be long enough to hold any legal title? Looks like that should be the actual limit, yea. "A pagename cannot exceed 255 bytes in length.

[Cloud] Re: Scratch database instance?

2023-01-25 Thread Roy Smith
Thanks. This field is intended to hold a wikipedia page title (including the namespace). Would 255 be long enough to hold any legal title? > On Jan 25, 2023, at 11:53 AM, Daniel Zahn wrote: > > Yea, it's variable length but it still wants you to give it a maximum length.

[Cloud] Re: Scratch database instance?

2023-01-25 Thread Daniel Zahn
On Wed, Jan 25, 2023 at 8:43 AM Roy Smith wrote: > I suppose I could just declare an explicit length for that column, but what > part of VARCHAR did they not understand? Yea, it's variable length but it still wants you to give it a maximum length. upstream says: "The CHAR and VARCHAR types

[Cloud] Scratch database instance?

2023-01-25 Thread Roy Smith
I just discovered that some code I've been working on, which passes all its unit tests against sqllite, fails when I run it against tools.db.svc.wikimedia.cloud. It's apparently due differences in the two drivers (see for example, this bug ).